diff options
author | Nick Piggin <npiggin@kernel.dk> | 2011-01-07 01:49:27 -0500 |
---|---|---|
committer | Nick Piggin <npiggin@kernel.dk> | 2011-01-07 01:50:19 -0500 |
commit | 621e155a3591962420eacdd39f6f0aa29ceb221e (patch) | |
tree | 387a9fb396f1bf24514b712c294182e36ba51076 /include/linux/dcache.h | |
parent | fb2d5b86aff355a27ebfc132d3c99f4a940cc3fe (diff) |
fs: change d_compare for rcu-walk
Change d_compare so it may be called from lock-free RCU lookups. This
does put significant restrictions on what may be done from the callback,
however there don't seem to have been any problems with in-tree fses.
If some strange use case pops up that _really_ cannot cope with the
rcu-walk rules, we can just add new rcu-unaware callbacks, which would
cause name lookup to drop out of rcu-walk mode.
For in-tree filesystems, this is just a mechanical change.
Signed-off-by: Nick Piggin <npiggin@kernel.dk>
Diffstat (limited to 'include/linux/dcache.h')
-rw-r--r-- | include/linux/dcache.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 6cdf4995c90a..75a072bf2a34 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h | |||
@@ -134,7 +134,9 @@ enum dentry_d_lock_class | |||
134 | struct dentry_operations { | 134 | struct dentry_operations { |
135 | int (*d_revalidate)(struct dentry *, struct nameidata *); | 135 | int (*d_revalidate)(struct dentry *, struct nameidata *); |
136 | int (*d_hash)(struct dentry *, struct qstr *); | 136 | int (*d_hash)(struct dentry *, struct qstr *); |
137 | int (*d_compare)(struct dentry *, struct qstr *, struct qstr *); | 137 | int (*d_compare)(const struct dentry *, const struct inode *, |
138 | const struct dentry *, const struct inode *, | ||
139 | unsigned int, const char *, const struct qstr *); | ||
138 | int (*d_delete)(const struct dentry *); | 140 | int (*d_delete)(const struct dentry *); |
139 | void (*d_release)(struct dentry *); | 141 | void (*d_release)(struct dentry *); |
140 | void (*d_iput)(struct dentry *, struct inode *); | 142 | void (*d_iput)(struct dentry *, struct inode *); |
@@ -145,12 +147,8 @@ struct dentry_operations { | |||
145 | * Locking rules for dentry_operations callbacks are to be found in | 147 | * Locking rules for dentry_operations callbacks are to be found in |
146 | * Documentation/filesystems/Locking. Keep it updated! | 148 | * Documentation/filesystems/Locking. Keep it updated! |
147 | * | 149 | * |
148 | * the dentry parameter passed to d_hash and d_compare is the parent | 150 | * FUrther descriptions are found in Documentation/filesystems/vfs.txt. |
149 | * directory of the entries to be compared. It is used in case these | 151 | * Keep it updated too! |
150 | * functions need any directory specific information for determining | ||
151 | * equivalency classes. Using the dentry itself might not work, as it | ||
152 | * might be a negative dentry which has no information associated with | ||
153 | * it. | ||
154 | */ | 152 | */ |
155 | 153 | ||
156 | /* d_flags entries */ | 154 | /* d_flags entries */ |