diff options
Diffstat (limited to 'Documentation/filesystems/vfs.txt')
-rw-r--r-- | Documentation/filesystems/vfs.txt | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt index 95c0a93f056c..250681b8c7cc 100644 --- a/Documentation/filesystems/vfs.txt +++ b/Documentation/filesystems/vfs.txt | |||
@@ -848,7 +848,9 @@ defined: | |||
848 | struct dentry_operations { | 848 | struct 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)(struct dentry *, struct qstr *); |
851 | int (*d_compare)(struct dentry *, struct qstr *, struct qstr *); | 851 | int (*d_compare)(const struct dentry *, const struct inode *, |
852 | const struct dentry *, const struct inode *, | ||
853 | unsigned int, const char *, const struct qstr *); | ||
852 | int (*d_delete)(const struct dentry *); | 854 | int (*d_delete)(const struct dentry *); |
853 | void (*d_release)(struct dentry *); | 855 | void (*d_release)(struct dentry *); |
854 | void (*d_iput)(struct dentry *, struct inode *); | 856 | void (*d_iput)(struct dentry *, struct inode *); |
@@ -860,9 +862,27 @@ struct dentry_operations { | |||
860 | dcache. Most filesystems leave this as NULL, because all their | 862 | dcache. Most filesystems leave this as NULL, because all their |
861 | dentries in the dcache are valid | 863 | dentries in the dcache are valid |
862 | 864 | ||
863 | d_hash: called when the VFS adds a dentry to the hash table | 865 | 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 | to be hashed into. | ||
864 | 868 | ||
865 | d_compare: called when a dentry should be compared with another | 869 | 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 | ||
871 | the parent's inode, then the dentry and inode (may be NULL) of the | ||
872 | child dentry. len and name string are properties of the dentry to be | ||
873 | compared. qstr is the name to compare it with. | ||
874 | |||
875 | Must be constant and idempotent, and should not take locks if | ||
876 | possible, and should not or store into the dentry or inodes. | ||
877 | Should not dereference pointers outside the dentry or inodes without | ||
878 | lots of care (eg. d_parent, d_inode, d_name should not be used). | ||
879 | |||
880 | However, our vfsmount is pinned, and RCU held, so the dentries and | ||
881 | inodes won't disappear, neither will our sb or filesystem module. | ||
882 | ->i_sb and ->d_sb may be used. | ||
883 | |||
884 | It is a tricky calling convention because it needs to be called under | ||
885 | "rcu-walk", ie. without any locks or references on things. | ||
866 | 886 | ||
867 | d_delete: called when the last reference to a dentry is dropped and the | 887 | d_delete: called when the last reference to a dentry is dropped and the |
868 | dcache is deciding whether or not to cache it. Return 1 to delete | 888 | dcache is deciding whether or not to cache it. Return 1 to delete |