Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1664165 > unrolled thread

Re: [PATCH 04/11] kernfs: don't set dentry->d_fsdata

Started byTejun Heo <tj@kernel.org>
First post2017-06-12 20:30 +0200
Last post2017-06-12 20:30 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH 04/11] kernfs: don't set dentry->d_fsdata Tejun Heo <tj@kernel.org> - 2017-06-12 20:30 +0200

#1664165 — Re: [PATCH 04/11] kernfs: don't set dentry->d_fsdata

FromTejun Heo <tj@kernel.org>
Date2017-06-12 20:30 +0200
SubjectRe: [PATCH 04/11] kernfs: don't set dentry->d_fsdata
Message-ID<tRCgb-5LZ-37@gated-at.bofh.it>
Hello,

On Fri, Jun 02, 2017 at 02:53:57PM -0700, Shaohua Li wrote:
> @@ -570,7 +570,8 @@ static int kernfs_dop_revalidate(struct dentry *dentry, unsigned int flags)
>  		goto out_bad;
>  
>  	/* The kernfs node has been moved? */
> -	if (dentry->d_parent->d_fsdata != kn->parent)
> +	if (d_really_is_negative(dentry->d_parent) ||
> +	    kernfs_dentry_node(dentry->d_parent) != kn->parent)
>  		goto out_bad;

Can we move d_really_is_negative() into kernfs_dentry_node()?  That
might add an additional NULL test to some paths but I don't think that
will ever show up anywhere.

> diff --git a/fs/kernfs/kernfs-internal.h b/fs/kernfs/kernfs-internal.h
> index 3534cfe..82e11fa 100644
> --- a/fs/kernfs/kernfs-internal.h
> +++ b/fs/kernfs/kernfs-internal.h
> @@ -70,6 +70,8 @@ struct kernfs_super_info {
>  };
>  #define kernfs_info(SB) ((struct kernfs_super_info *)(SB->s_fs_info))
>  
> +#define kernfs_dentry_node(d)  ((d_inode(d))->i_private)

I know the prev one is a macro but let's make the new one an inline
function.

Thnaks.

-- 
tejun

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web