From mboxrd@z Thu Jan 1 00:00:00 1970 From: James Morris Subject: Re: [PATCH 01/19] vfs: Add inode uid,gid,mode initialization with helper function Date: Thu, 18 Feb 2010 10:03:12 +1100 (EST) Message-ID: References: <1266431353-8549-1-git-send-email-dmonakhov@openvz.org> <1266431685-8781-1-git-send-email-dmonakhov@openvz.org> Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: linux-fsdevel@vger.kernel.org, viro@ZenIV.linux.org.uk To: Dmitry Monakhov Return-path: Received: from tundra.namei.org ([65.99.196.166]:59043 "EHLO tundra.namei.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757540Ab0BQXEF (ORCPT ); Wed, 17 Feb 2010 18:04:05 -0500 In-Reply-To: <1266431685-8781-1-git-send-email-dmonakhov@openvz.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, 17 Feb 2010, Dmitry Monakhov wrote: > + */ > +inline void inode_init_owner(struct inode *inode, const struct inode *dir, > + int mode) > +{ You should only try and inline functions which are smaller than about 100 bytes or which have fewer than four lines of code. Also, the compiler can generally figure out which functions to inline. > + inode->i_uid = current_fsuid(); > + if (dir && dir->i_mode & S_ISGID) { > + inode->i_gid = dir->i_gid; > + if (S_ISDIR(mode)) > + mode |= S_ISGID; > + } else > + inode->i_gid = current_fsgid(); > + inode->i_mode = mode; > +} > +EXPORT_SYMBOL(inode_init_owner); The rest of them look ok to me, although probably best to get acks from each fs maintainer. -- James Morris