lkml.org 
[lkml]   [2004]   [Nov]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    SubjectRe: [PATCH] [Request for inclusion] Filesystem in Userspace
    Hi Miklov,

    I have a couple of more comments.

    > --- /dev/null Wed Dec 31 16:00:00 196900
    > +++ b/fs/fuse/dev.c 2004-11-15 20:20:16 +01:00
    > @@ -0,0 +1,606 @@
    > +static int get_unique(struct fuse_conn *fc)
    > +{
    > + do fc->reqctr++;
    > + while (!fc->reqctr);
    > + return fc->reqctr;
    > +}
    > +

    What are you doing here? Why do you need to avoid zero? Anyway, if you
    really need to do that, this would be more readable IMHO:

    static int get_unique(struct fuse_conn *fc)
    {
    if (++fc->reqctr == 0)
    fc->reqctr = 1;
    return fc->reqctr;
    }

    An added bonus of producing better code for architectures that support
    conditional move...

    > +static struct proc_dir_entry *proc_fs_fuse;
    > +struct proc_dir_entry *proc_fuse_dev;
    >
    > +int fuse_dev_init(void)
    > +{
    > + proc_fs_fuse = NULL;
    > + proc_fuse_dev = NULL;

    Pointers with static storage class are initialized to NULL by default
    so these are redundant.

    > --- /dev/null Wed Dec 31 16:00:00 196900
    > +++ b/fs/fuse/inode.c 2004-11-15 20:20:16 +01:00
    > @@ -0,0 +1,523 @@
    [snip]

    > +enum { opt_fd,
    > + opt_rootmode,
    > + opt_uid,
    > + opt_default_permissions,
    > + opt_allow_other,
    > + opt_allow_root,
    > + opt_kernel_cache,
    > + opt_large_read,
    > + opt_direct_io,
    > + opt_max_read,
    > + opt_err };
    > +

    Enums in upper case, please.

    Pekka
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-03-22 14:08    [W:3.490 / U:0.460 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site