aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/filesystems
diff options
context:
space:
mode:
authorNick Piggin <npiggin@kernel.dk>2011-01-07 01:49:28 -0500
committerNick Piggin <npiggin@kernel.dk>2011-01-07 01:50:20 -0500
commitb1e6a015a580ad145689ad1d6b4aa0e03e6c868b (patch)
tree57a10ef164e4d2f798d9b832dbeaf973aca2ab83 /Documentation/filesystems
parent621e155a3591962420eacdd39f6f0aa29ceb221e (diff)
fs: change d_hash for rcu-walk
Change d_hash so it may be called from lock-free RCU lookups. See similar patch for d_compare for details. For in-tree filesystems, this is just a mechanical change. Signed-off-by: Nick Piggin <npiggin@kernel.dk>
Diffstat (limited to 'Documentation/filesystems')
-rw-r--r--Documentation/filesystems/Locking5
-rw-r--r--Documentation/filesystems/porting7
-rw-r--r--Documentation/filesystems/vfs.txt8
3 files changed, 16 insertions, 4 deletions
diff --git a/Documentation/filesystems/Locking b/Documentation/filesystems/Locking
index 9a76f8d8bf95..a15ee207b449 100644
--- a/Documentation/filesystems/Locking
+++ b/Documentation/filesystems/Locking
@@ -10,7 +10,8 @@ be able to use diff(1).
10--------------------------- dentry_operations -------------------------- 10--------------------------- dentry_operations --------------------------
11prototypes: 11prototypes:
12 int (*d_revalidate)(struct dentry *, int); 12 int (*d_revalidate)(struct dentry *, int);
13 int (*d_hash) (struct dentry *, struct qstr *); 13 int (*d_hash)(const struct dentry *, const struct inode *,
14 struct qstr *);
14 int (*d_compare)(const struct dentry *, const struct inode *, 15 int (*d_compare)(const struct dentry *, const struct inode *,
15 const struct dentry *, const struct inode *, 16 const struct dentry *, const struct inode *,
16 unsigned int, const char *, const struct qstr *); 17 unsigned int, const char *, const struct qstr *);
@@ -22,7 +23,7 @@ prototypes:
22locking rules: 23locking rules:
23 dcache_lock rename_lock ->d_lock may block 24 dcache_lock rename_lock ->d_lock may block
24d_revalidate: no no no yes 25d_revalidate: no no no yes
25d_hash no no no yes 26d_hash no no no no
26d_compare: no yes no no 27d_compare: no yes no no
27d_delete: yes no yes no 28d_delete: yes no yes no
28d_release: no no no yes 29d_release: no no no yes
diff --git a/Documentation/filesystems/porting b/Documentation/filesystems/porting
index d44511e20828..9fd31940a8ef 100644
--- a/Documentation/filesystems/porting
+++ b/Documentation/filesystems/porting
@@ -333,3 +333,10 @@ unreferenced dentries, and is now only called when the dentry refcount goes to
333 .d_compare() calling convention and locking rules are significantly 333 .d_compare() calling convention and locking rules are significantly
334changed. Read updated documentation in Documentation/filesystems/vfs.txt (and 334changed. Read updated documentation in Documentation/filesystems/vfs.txt (and
335look at examples of other filesystems) for guidance. 335look at examples of other filesystems) for guidance.
336
337---
338[mandatory]
339
340 .d_hash() calling convention and locking rules are significantly
341changed. Read updated documentation in Documentation/filesystems/vfs.txt (and
342look at examples of other filesystems) for guidance.
diff --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt
index 250681b8c7cc..69b10ff5ec81 100644
--- a/Documentation/filesystems/vfs.txt
+++ b/Documentation/filesystems/vfs.txt
@@ -847,7 +847,8 @@ defined:
847 847
848struct dentry_operations { 848struct dentry_operations {
849 int (*d_revalidate)(struct dentry *, struct nameidata *); 849 int (*d_revalidate)(struct dentry *, struct nameidata *);
850 int (*d_hash)(struct dentry *, struct qstr *); 850 int (*d_hash)(const struct dentry *, const struct inode *,
851 struct qstr *);
851 int (*d_compare)(const struct dentry *, const struct inode *, 852 int (*d_compare)(const struct dentry *, const struct inode *,
852 const struct dentry *, const struct inode *, 853 const struct dentry *, const struct inode *,
853 unsigned int, const char *, const struct qstr *); 854 unsigned int, const char *, const struct qstr *);
@@ -864,7 +865,10 @@ struct dentry_operations {
864 865
865 d_hash: called when the VFS adds a dentry to the hash table. The first 866 d_hash: called when the VFS adds a dentry to the hash table. The first
866 dentry passed to d_hash is the parent directory that the name is 867 dentry passed to d_hash is the parent directory that the name is
867 to be hashed into. 868 to be hashed into. The inode is the dentry's inode.
869
870 Same locking and synchronisation rules as d_compare regarding
871 what is safe to dereference etc.
868 872
869 d_compare: called to compare a dentry name with a given name. The first 873 d_compare: called to compare a dentry name with a given name. The first
870 dentry is the parent of the dentry to be compared, the second is 874 dentry is the parent of the dentry to be compared, the second is