aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/filesystems/vfs.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/filesystems/vfs.txt')
-rw-r--r--Documentation/filesystems/vfs.txt19
1 files changed, 8 insertions, 11 deletions
diff --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt
index 4a35f6614a66..51ba44e3fc40 100644
--- a/Documentation/filesystems/vfs.txt
+++ b/Documentation/filesystems/vfs.txt
@@ -901,10 +901,8 @@ defined:
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_weak_revalidate)(struct dentry *, unsigned int);
904 int (*d_hash)(const struct dentry *, const struct inode *, 904 int (*d_hash)(const struct dentry *, struct qstr *);
905 struct qstr *); 905 int (*d_compare)(const struct dentry *, const struct dentry *,
906 int (*d_compare)(const struct dentry *, const struct inode *,
907 const struct dentry *, const struct inode *,
908 unsigned int, const char *, const struct qstr *); 906 unsigned int, const char *, const struct qstr *);
909 int (*d_delete)(const struct dentry *); 907 int (*d_delete)(const struct dentry *);
910 void (*d_release)(struct dentry *); 908 void (*d_release)(struct dentry *);
@@ -949,25 +947,24 @@ struct dentry_operations {
949 947
950 d_hash: called when the VFS adds a dentry to the hash table. The first 948 d_hash: called when the VFS adds a dentry to the hash table. The first
951 dentry passed to d_hash is the parent directory that the name is 949 dentry passed to d_hash is the parent directory that the name is
952 to be hashed into. The inode is the dentry's inode. 950 to be hashed into.
953 951
954 Same locking and synchronisation rules as d_compare regarding 952 Same locking and synchronisation rules as d_compare regarding
955 what is safe to dereference etc. 953 what is safe to dereference etc.
956 954
957 d_compare: called to compare a dentry name with a given name. The first 955 d_compare: called to compare a dentry name with a given name. The first
958 dentry is the parent of the dentry to be compared, the second is 956 dentry is the parent of the dentry to be compared, the second is
959 the parent's inode, then the dentry and inode (may be NULL) of the 957 the child dentry. len and name string are properties of the dentry
960 child dentry. len and name string are properties of the dentry to be 958 to be compared. qstr is the name to compare it with.
961 compared. qstr is the name to compare it with.
962 959
963 Must be constant and idempotent, and should not take locks if 960 Must be constant and idempotent, and should not take locks if
964 possible, and should not or store into the dentry or inodes. 961 possible, and should not or store into the dentry.
965 Should not dereference pointers outside the dentry or inodes without 962 Should not dereference pointers outside the dentry without
966 lots of care (eg. d_parent, d_inode, d_name should not be used). 963 lots of care (eg. d_parent, d_inode, d_name should not be used).
967 964
968 However, our vfsmount is pinned, and RCU held, so the dentries and 965 However, our vfsmount is pinned, and RCU held, so the dentries and
969 inodes won't disappear, neither will our sb or filesystem module. 966 inodes won't disappear, neither will our sb or filesystem module.
970 ->i_sb and ->d_sb may be used. 967 ->d_sb may be used.
971 968
972 It is a tricky calling convention because it needs to be called under 969 It is a tricky calling convention because it needs to be called under
973 "rcu-walk", ie. without any locks or references on things. 970 "rcu-walk", ie. without any locks or references on things.