Shailabh,

        Please inline your patches. My mail client doesn't include the patch in
the reply if you attach the patch.

On Tue, 2005-08-09 at 18:32 -0400, Shailabh Nagar wrote:

> Rename magic (CKRM RCFS rewrite)
> 
> Eliminate last uses of "magic".  
> 
> Signed-off-by: Shailabh Nagar <[EMAIL PROTECTED]>
> 
>  fs/rcfs/inode.c      |   10 +++++-----
>  include/linux/rcfs.h |   18 ++++--------------
>  2 files changed, 9 insertions(+), 19 deletions(-)
> 
> Index: linux-2.6.12/fs/rcfs/inode.c
> ===================================================================
> --- linux-2.6.12.orig/fs/rcfs/inode.c   2005-08-09 15:30:57.908097352
> -0400
> +++ linux-2.6.12/fs/rcfs/inode.c        2005-08-09 15:30:57.982086104
> -0400
> @@ -104,10 +104,10 @@ struct inode_operations rcfs_file_inode_
>  
>  
>  /*
> - * Address of variable used as flag to indicate a magic file,
> - * value unimportant
> + * Address of this variable used as a flag to indicate a virtual
> file.
> + * Value unimportant.
>   */
> -int RCFS_IS_MAGIC;
> +int RCFS_IS_VIRTUAL;
>  
>  /******************************
>   *
> @@ -494,7 +494,7 @@ int rcfs_destroy_virtual(struct dentry *
>         int rc=0;
>  
>         list_for_each_entry_safe(child, tmp, &parent->d_subdirs,
> d_child) {
> -               if (!rcfs_is_magic(child))
> +               if (!rcfs_is_virtual(child))
>                         continue;
>                 rc = __rcfs_destroy_file(child);
>                 if (rc) {
> @@ -521,7 +521,7 @@ int rcfs_create_virtual(struct dentry *p
>                 rcfs_get_inode_info(dentry->d_inode)->core =
>                          rcfs_get_inode_info(parent->d_inode)->core;
>                 rcfs_get_inode_info(dentry->d_inode)->mfdentry =
> dentry;
> -               dentry->d_fsdata = &RCFS_IS_MAGIC;
> +               dentry->d_fsdata = &RCFS_IS_VIRTUAL;
>         }
>         return 0;
>  
> Index: linux-2.6.12/include/linux/rcfs.h
> ===================================================================
> --- linux-2.6.12.orig/include/linux/rcfs.h      2005-08-09
> 15:30:57.909097200 -0400
> +++ linux-2.6.12/include/linux/rcfs.h   2005-08-09 15:30:57.982086104
> -0400
> @@ -7,18 +7,12 @@
>  #include <linux/ckrm_rc.h>
>  #include <linux/ckrm_ce.h>
>  
> -/*
> - * The following declarations cannot be included in any of ckrm*.h
> files
> - * without jumping hoops. Remove later when rearrangements done
> - */
> -
>  #define RCFS_MAGIC     0x4feedbac
>  #define RCFS_MAGF_NAMELEN 20
> -extern int RCFS_IS_MAGIC;
> +extern int RCFS_IS_VIRTUAL;
>  
>  /*
> - * Following strings are the names of the system defined files under
> - * the rcfs filesystem
> + * Names of virtual files created by rcfs
>   */
>  
>  #define RCFS_CONFIG_NAME       "config"
> @@ -27,7 +21,7 @@ extern int RCFS_IS_MAGIC;
>  #define RCFS_SHARES_NAME       "shares"
>  #define RCFS_RECLASSIFY_NAME   "reclassify"
>  
> -#define rcfs_is_magic(dentry)  ((dentry)->d_fsdata == &RCFS_IS_MAGIC)
> +#define rcfs_is_virtual(dentry)  ((dentry)->d_fsdata ==
> &RCFS_IS_VIRTUAL)
>  
>  struct rcfs_inode_info {
>         struct ckrm_core_class *core;
> @@ -47,12 +41,8 @@ struct rcfs_magf {
>  };
> 
>  struct rcfs_mfdesc {
> -       struct rcfs_magf *rootmf;       /* Root directory and its
> magic files */
> +       struct rcfs_magf *rootmf;       /* root dir & its virtual
> files */


        The structure name still contains an abbreviated reference to "magic".
Is there any reason you can't simple use "struct rcfs_file" ? Also the
field name refers to magic files.


>         int rootmflen;                  /* length of above array */


        The field also contains an abbreviated reference to "magic file". If
you don't address all instances of "mf" and "magf" then renaming "magic"
is pointless and, in fact, harmful.


> -       /*
> -        * Can have a different magf describing magic files
> -        * for non-root entries too.
> -        */
>  };
>  
>  extern struct rcfs_mfdesc *genmfdesc[];


Here too. Probably lots of other locations this particular point is
relevant.


Cheers,
        -Matt



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
ckrm-tech mailing list
https://lists.sourceforge.net/lists/listinfo/ckrm-tech

Reply via email to