From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pekka Enberg Subject: Re: [PATCH] [Request for inclusion] Filesystem in Userspace Date: Tue, 16 Nov 2004 14:19:34 +0200 Message-ID: <84144f020411160419dc705fc@mail.gmail.com> References: <84144f0204111602136a9bbded@mail.gmail.com> <84144f020411160235616c529b@mail.gmail.com> Reply-To: Pekka Enberg Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: torvalds@osdl.org, akpm@osdl.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Return-path: Received: from wproxy.gmail.com ([64.233.184.205]:54174 "EHLO wproxy.gmail.com") by vger.kernel.org with ESMTP id S261962AbUKPMTe (ORCPT ); Tue, 16 Nov 2004 07:19:34 -0500 Received: by wproxy.gmail.com with SMTP id 63so577747wri for ; Tue, 16 Nov 2004 04:19:34 -0800 (PST) To: Miklos Szeredi In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org 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