Re: [PATCH 1/2] VFS: Cut down inode->i_op->xyz accesses in path walking

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jul 22, 2011 at 10:37:58AM -0700, Linus Torvalds wrote:
> +		if (unlikely(inode->i_op->lookup))
> +			dentry->d_flags |= DCACHE_OP_LOOKUP;

Would simply adding an S_ISDIR check first help the same without adding
another flag?

> +		if (unlikely(inode->i_op->permission))
> +			dentry->d_flags |= DCACHE_OP_PERMISSION;
> +		if (unlikely(inode->i_op->follow_link))
> +			dentry->d_flags |= DCACHE_OP_FOLLOW_LINK;

Now that the follow_link abuse for automoun is gone I wonder if we really
need to keep supporting it on anything but links.  If not we could
avoid the additional flag by simply checking of S_ISLNK first.


We can also add new dentry to inode pointers without going through
__d_instanciate in d_obtain_alias, so that case also needs to set your
flags.

> diff --git a/fs/namei.c b/fs/namei.c
> index 14ab8d3f2f0c..02b680e0e816 100644
> --- a/fs/namei.c
> +++ b/fs/namei.c
> @@ -577,12 +577,12 @@ static int complete_walk(struct nameidata *nd)
>   * short-cut DAC fails, then call ->permission() to do more
>   * complete permission check.
>   */
> -static inline int exec_permission(struct inode *inode, unsigned int flags)
> +static inline int exec_permission(struct dentry *dentry, struct inode *inode, unsigned int flags)
>  {
>  	int ret;
>  	struct user_namespace *ns = inode_userns(inode);
>  
> -	if (inode->i_op->permission) {
> +	if (dentry->d_flags & DCACHE_OP_PERMISSION) {
>  		ret = inode->i_op->permission(inode, MAY_EXEC, flags);
>  	} else {

The permission bits clash with Al changes in that area, including the
removal of exec_permission and the ->permission prototype change.

I think you should rebase ontop of his for-next tree.

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux