aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/filesystems
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-02-26 23:16:07 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-26 23:16:07 -0500
commitd895cb1af15c04c522a25c79cc429076987c089b (patch)
tree895dc9157e28f603d937a58be664e4e440d5530c /Documentation/filesystems
parent9626357371b519f2b955fef399647181034a77fe (diff)
parentd3d009cb965eae7e002ea5badf603ea8f4c34915 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs pile (part one) from Al Viro: "Assorted stuff - cleaning namei.c up a bit, fixing ->d_name/->d_parent locking violations, etc. The most visible changes here are death of FS_REVAL_DOT (replaced with "has ->d_weak_revalidate()") and a new helper getting from struct file to inode. Some bits of preparation to xattr method interface changes. Misc patches by various people sent this cycle *and* ocfs2 fixes from several cycles ago that should've been upstream right then. PS: the next vfs pile will be xattr stuff." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (46 commits) saner proc_get_inode() calling conventions proc: avoid extra pde_put() in proc_fill_super() fs: change return values from -EACCES to -EPERM fs/exec.c: make bprm_mm_init() static ocfs2/dlm: use GFP_ATOMIC inside a spin_lock ocfs2: fix possible use-after-free with AIO ocfs2: Fix oops in ocfs2_fast_symlink_readpage() code path get_empty_filp()/alloc_file() leave both ->f_pos and ->f_version zero target: writev() on single-element vector is pointless export kernel_write(), convert open-coded instances fs: encode_fh: return FILEID_INVALID if invalid fid_type kill f_vfsmnt vfs: kill FS_REVAL_DOT by adding a d_weak_revalidate dentry op nfsd: handle vfs_getattr errors in acl protocol switch vfs_getattr() to struct path default SET_PERSONALITY() in linux/elf.h ceph: prepopulate inodes only when request is aborted d_hash_and_lookup(): export, switch open-coded instances 9p: switch v9fs_set_create_acl() to inode+fid, do it before d_instantiate() 9p: split dropping the acls from v9fs_set_create_acl() ...
Diffstat (limited to 'Documentation/filesystems')
-rw-r--r--Documentation/filesystems/Locking2
-rw-r--r--Documentation/filesystems/porting4
-rw-r--r--Documentation/filesystems/vfs.txt24
3 files changed, 28 insertions, 2 deletions
diff --git a/Documentation/filesystems/Locking b/Documentation/filesystems/Locking
index f48e0c6b4c42..0706d32a61e6 100644
--- a/Documentation/filesystems/Locking
+++ b/Documentation/filesystems/Locking
@@ -10,6 +10,7 @@ be able to use diff(1).
10--------------------------- dentry_operations -------------------------- 10--------------------------- dentry_operations --------------------------
11prototypes: 11prototypes:
12 int (*d_revalidate)(struct dentry *, unsigned int); 12 int (*d_revalidate)(struct dentry *, unsigned int);
13 int (*d_weak_revalidate)(struct dentry *, unsigned int);
13 int (*d_hash)(const struct dentry *, const struct inode *, 14 int (*d_hash)(const struct dentry *, const struct inode *,
14 struct qstr *); 15 struct qstr *);
15 int (*d_compare)(const struct dentry *, const struct inode *, 16 int (*d_compare)(const struct dentry *, const struct inode *,
@@ -25,6 +26,7 @@ prototypes:
25locking rules: 26locking rules:
26 rename_lock ->d_lock may block rcu-walk 27 rename_lock ->d_lock may block rcu-walk
27d_revalidate: no no yes (ref-walk) maybe 28d_revalidate: no no yes (ref-walk) maybe
29d_weak_revalidate:no no yes no
28d_hash no no no maybe 30d_hash no no no maybe
29d_compare: yes no no maybe 31d_compare: yes no no maybe
30d_delete: no yes no no 32d_delete: no yes no no
diff --git a/Documentation/filesystems/porting b/Documentation/filesystems/porting
index 0472c31c163b..4db22f6491e0 100644
--- a/Documentation/filesystems/porting
+++ b/Documentation/filesystems/porting
@@ -441,3 +441,7 @@ d_make_root() drops the reference to inode if dentry allocation fails.
441two, it gets "is it an O_EXCL or equivalent?" boolean argument. Note that 441two, it gets "is it an O_EXCL or equivalent?" boolean argument. Note that
442local filesystems can ignore tha argument - they are guaranteed that the 442local filesystems can ignore tha argument - they are guaranteed that the
443object doesn't exist. It's remote/distributed ones that might care... 443object doesn't exist. It's remote/distributed ones that might care...
444--
445[mandatory]
446 FS_REVAL_DOT is gone; if you used to have it, add ->d_weak_revalidate()
447in your dentry operations instead.
diff --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt
index e3869098163e..bc4b06b3160a 100644
--- a/Documentation/filesystems/vfs.txt
+++ b/Documentation/filesystems/vfs.txt
@@ -900,6 +900,7 @@ defined:
900 900
901struct dentry_operations { 901struct dentry_operations {
902 int (*d_revalidate)(struct dentry *, unsigned int); 902 int (*d_revalidate)(struct dentry *, unsigned int);
903 int (*d_weak_revalidate)(struct dentry *, unsigned int);
903 int (*d_hash)(const struct dentry *, const struct inode *, 904 int (*d_hash)(const struct dentry *, const struct inode *,
904 struct qstr *); 905 struct qstr *);
905 int (*d_compare)(const struct dentry *, const struct inode *, 906 int (*d_compare)(const struct dentry *, const struct inode *,
@@ -915,8 +916,13 @@ struct dentry_operations {
915 916
916 d_revalidate: called when the VFS needs to revalidate a dentry. This 917 d_revalidate: called when the VFS needs to revalidate a dentry. This
917 is called whenever a name look-up finds a dentry in the 918 is called whenever a name look-up finds a dentry in the
918 dcache. Most filesystems leave this as NULL, because all their 919 dcache. Most local filesystems leave this as NULL, because all their
919 dentries in the dcache are valid 920 dentries in the dcache are valid. Network filesystems are different
921 since things can change on the server without the client necessarily
922 being aware of it.
923
924 This function should return a positive value if the dentry is still
925 valid, and zero or a negative error code if it isn't.
920 926
921 d_revalidate may be called in rcu-walk mode (flags & LOOKUP_RCU). 927 d_revalidate may be called in rcu-walk mode (flags & LOOKUP_RCU).
922 If in rcu-walk mode, the filesystem must revalidate the dentry without 928 If in rcu-walk mode, the filesystem must revalidate the dentry without
@@ -927,6 +933,20 @@ struct dentry_operations {
927 If a situation is encountered that rcu-walk cannot handle, return 933 If a situation is encountered that rcu-walk cannot handle, return
928 -ECHILD and it will be called again in ref-walk mode. 934 -ECHILD and it will be called again in ref-walk mode.
929 935
936 d_weak_revalidate: called when the VFS needs to revalidate a "jumped" dentry.
937 This is called when a path-walk ends at dentry that was not acquired by
938 doing a lookup in the parent directory. This includes "/", "." and "..",
939 as well as procfs-style symlinks and mountpoint traversal.
940
941 In this case, we are less concerned with whether the dentry is still
942 fully correct, but rather that the inode is still valid. As with
943 d_revalidate, most local filesystems will set this to NULL since their
944 dcache entries are always valid.
945
946 This function has the same return code semantics as d_revalidate.
947
948 d_weak_revalidate is only called after leaving rcu-walk mode.
949
930 d_hash: called when the VFS adds a dentry to the hash table. The first 950 d_hash: called when the VFS adds a dentry to the hash table. The first
931 dentry passed to d_hash is the parent directory that the name is 951 dentry passed to d_hash is the parent directory that the name is
932 to be hashed into. The inode is the dentry's inode. 952 to be hashed into. The inode is the dentry's inode.