Re: [PATCH] [Request for inclusion] Filesystem in Userspace

From: Pekka Enberg
Date: Tue Nov 16 2004 - 07:22:04 EST


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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/