Re: [PATCH v2] rpc_pipe: set dentry operations at d_alloc time

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

 



On Sun, 14 Jul 2013 15:00:11 +0100
Al Viro <viro@xxxxxxxxxxxxxxxxxx> wrote:

> On Tue, Jul 02, 2013 at 01:00:52PM -0400, Jeff Layton wrote:
> > Currently the way these get set is a little convoluted. If the dentry is
> > allocated via lookup from userland, then it gets set by simple_lookup.
> > If it gets allocated when the kernel is populating the directory, then
> > it gets set via __rpc_lookup_create_exclusive, which has to check
> > whether they might already be set. Between both of these, this ensures
> > that all dentries have their d_op pointer set.
> > 
> > Instead of doing that, just have them set at d_alloc time by pointing
> > sb->s_d_op at them. With that change, we no longer want the lookup op
> > to set them, so we must move to using our own lookup routine.
> 
> There's a better solution - just make simple_lookup() skip d_set_d_op()
> if superblock already has ->s_d_op (and thus d_alloc() has already
> set the damn thing).  Voila - we can just set ->s_d_op and leave
> inode_operations as is.

Yeah, that is a better solution and the code now in mainline looks
reasonable. Trond already merged this patch however, so I'll spin up
another patch on top of mainline to convert this back to
simple_dir_inode_operations.

Thanks,
-- 
Jeff Layton <jlayton@xxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux