summaryrefslogtreecommitdiffstats
path: root/fs/dcache.c
diff options
context:
space:
mode:
authorDavid Howells2015-02-11 14:40:17 +0100
committerAl Viro2015-04-15 21:04:42 +0200
commit525d27b23555419e0e7b73fb6e78d4d678cb4f32 (patch)
treecf89cdba77a6d468503131bdd6bf3e4742d0c8c7 /fs/dcache.c
parentnfs: generic_write_checks() shouldn't be done on swapout... (diff)
downloadkernel-qcow2-linux-525d27b23555419e0e7b73fb6e78d4d678cb4f32.tar.gz
kernel-qcow2-linux-525d27b23555419e0e7b73fb6e78d4d678cb4f32.tar.xz
kernel-qcow2-linux-525d27b23555419e0e7b73fb6e78d4d678cb4f32.zip
VFS: Add owner-filesystem positive/negative dentry checks
Supply two functions to test whether a filesystem's own dentries are positive or negative (d_really_is_positive() and d_really_is_negative()). The problem is that the DCACHE_ENTRY_TYPE field of dentry->d_flags may be overridden by the union part of a layered filesystem and isn't thus necessarily indicative of the type of dentry. Normally, this would involve a negative dentry (ie. ->d_inode == NULL) having ->d_layer.lower pointed to a lower layer dentry, DCACHE_PINNING_LOWER set and the DCACHE_ENTRY_TYPE field set to something other than DCACHE_MISS_TYPE - but it could also involve, say, a DCACHE_SPECIAL_TYPE being overridden to DCACHE_WHITEOUT_TYPE if a 0,0 chardev is detected in the top layer. However, inside a filesystem, when that fs is looking at its own dentries, it probably wants to know if they are really negative or not - and doesn't care about the fallthrough bits used by the union. To this end, a filesystem should normally use d_really_is_positive/negative() when looking at its own dentries rather than d_is_positive/negative() and should use d_inode() to get at the inode. Anyone looking at someone else's dentries (this includes pathwalk) should use d_is_xxx() and d_backing_inode(). Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/dcache.c')
0 files changed, 0 insertions, 0 deletions