For dentry operations that cover multiple dentry aliases of
a single inode, create a compatibility wrapper to hide differences
between the older dget_locked() and the current dget().
No functional change should be incurred by this commit.
Change-Id: I2bb0d453417f37707018f6ba5859903c3d34c8ff
Reviewed-on: https://gerrit.openafs.org/12789
Reviewed-by: Andrew Deason <adeason@dson.org>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
#endif
}
+/* Use this instead of dget for dentry operations
+ * that occur under a higher lock (e.g. alias processing).
+ * Requires that the higher lock (e.g. dcache_lock or
+ * inode->i_lock) is already held.
+ */
+static inline void
+afs_linux_dget(struct dentry *dp) {
+#if defined(HAVE_DCACHE_LOCK)
+ dget_locked(dp);
+#else
+ dget(dp);
+#endif
+}
+
+
static inline int
afs_inode_setattr(struct osi_file *afile, struct iattr *newattrs) {
list_for_each_entry(dentry, &inode->i_dentry, d_alias) {
if (d_unhashed(dentry))
continue;
- dget_locked(dentry);
+ afs_linux_dget(dentry);
spin_unlock(&dcache_lock);
if (d_invalidate(dentry) == -EBUSY) {
continue;
}
spin_unlock(&dentry->d_lock);
- dget(dentry);
+ afs_linux_dget(dentry);
spin_unlock(&inode->i_lock);
if (afs_d_invalidate(dentry) == -EBUSY) {
# ifdef HAVE_DCACHE_LOCK
if (ret) {
- dget_locked(ret);
+ afs_linux_dget(ret);
}
spin_unlock(&dcache_lock);
# else
if (ret) {
- dget(ret);
+ afs_linux_dget(ret);
}
spin_unlock(&ip->i_lock);
# endif