]> git.baikalelectronics.ru Git - kernel.git/commit
Make ->d_sb assign-once and always non-NULL
authorAl Viro <viro@zeniv.linux.org.uk>
Thu, 7 Jul 2011 19:03:58 +0000 (15:03 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Wed, 20 Jul 2011 05:44:17 +0000 (01:44 -0400)
commit18ce224a60d774c02d9a0676bb4eae5f8d0d1450
treed3c9332ab72cf5a4eba483ba1ff83c54ca4c42a0
parente9a18945458dcfe7887096947619777d5232c5ed
Make ->d_sb assign-once and always non-NULL

New helper (non-exported, fs/internal.h-only): __d_alloc(sb, name).
Allocates dentry, sets its ->d_sb to given superblock and sets
->d_op accordingly.  Old d_alloc(NULL, name) callers are converted
to that (all of them know what superblock they want).  d_alloc()
itself is left only for parent != NULl case; uses __d_alloc(),
inserts result into the list of parent's children.

Note that now ->d_sb is assign-once and never NULL *and*
->d_parent is never NULL either.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/dcache.c
fs/internal.h
fs/libfs.c