Return-Path: Date: Thu, 22 Oct 2015 01:34:49 -0700 From: Christoph Hellwig To: Trond Myklebust Cc: Jeff Layton , Benjamin Coddington , Linux NFS Mailing List , Anna Schumaker Subject: Re: [PATCH 08/10] NFS: Move do_vfs_lock to shared inline Message-ID: <20151022083449.GA3919@infradead.org> References: <1ad951a190be5b737d285ae91c3d8acbfb84ff18.1444846590.git.bcodding@redhat.com> <20151014155521.28475a2d@synchrony.poochiereds.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: List-ID: On Wed, Oct 21, 2015 at 02:48:45PM -0700, Trond Myklebust wrote: > > > +static inline int do_vfs_lock(struct inode *inode, struct file_lock *fl) > > > +{ > > > + int res = 0; > > > + switch (fl->fl_flags & (FL_POSIX|FL_FLOCK)) { > > > + case FL_POSIX: > > > + res = posix_lock_inode_wait(inode, fl); > > > + break; > > > + case FL_FLOCK: > > > + res = flock_lock_inode_wait(inode, fl); > > > + break; > > > + default: > > > + BUG(); > > > + } > > > + return res; > > > +} This is a) not a good name for a global function, and b) probably shouldn't be inline. Given how similar the functions are I'd rather have a file_lock_inode_wait that handles both cases right in fs/locks.c