Re: [PATCHSET driver-core-next] kernfs: implement kernfs_dir_ops

From: Greg KH
Date: Wed Dec 11 2013 - 16:17:30 EST


On Wed, Dec 11, 2013 at 04:02:54PM -0500, Tejun Heo wrote:
> Hello,
>
> kernfs is now properly separated out from sysfs and can be used for
> other pseudo filesystems too; however, there are still some missing
> features - kernfs filesystems can't process any directory manipulation
> systemcalls such as mkdir(2), rmdir(2) and rename(2), which cgroup,
> one of the prospect kernfs users, requires for cgroup management.
>
> This patchset implements those directory operation hooks so that
> kernfs users can be hooked into those system calls and implement
> appropriate actions, which may or may not match the actual semantics
> of those syscalls.
>
> The implementation is mostly straight forward except for one aspect.
> sysfs, and thus kernfs, never allowed negative dentries. They are
> actively shot down and lookup callback assumes that there's no
> negative dentries. This doesn't really have a lot of benefits and
> changing isn't difficult. The lookup path simply needs to tell the
> vfs layer that a full fresh lookup is necessary for negative dentries.

Very cool, will this let us move configfs to use kernfs as well? That's
one of the reasons that the two filesystems couldn't be merged in the
past from what I remember.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/