[])
])
+# 2.6.17 super_block use s_vfs_rename_mutex instead of s_vfs_rename_sem
+AC_DEFUN([LC_VFS_RENAME_MUTEX],
+[AC_MSG_CHECKING([super_block has s_vfs_rename_mutex])
+LB_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+],[
+ struct super_block sb;
+ mutex_lock(&sb.s_vfs_rename_mutex);
+],[
+ AC_DEFINE(HAVE_VFS_RENAME_MUTEX, 1,
+ [super_block has s_vfs_rename_mutex])
+ AC_MSG_RESULT([yes])
+],[
+ AC_MSG_RESULT([no])
+])
+])
+
#
# LC_PROG_LINUX
#
# 2.6.17
LC_INODE_IPRIVATE
LC_DQUOTOFF_MUTEX
+ LC_VFS_RENAME_MUTEX
# 2.6.18
LC_NR_PAGECACHE
#define SLAB_DESTROY_BY_RCU 0
#endif
+#ifdef HAVE_VFS_RENAME_MUTEX
+#define VFS_RENAME_LOCK(inode) mutex_lock(&((inode)->i_sb->s_vfs_rename_mutex))
+#define VFS_RENAME_UNLOCK(inode) mutex_unlock(&((inode)->i_sb->s_vfs_rename_mutex))
+#else
+#define VFS_RENAME_LOCK(inode) down(&((inode)->i_sb->s_vfs_rename_sem))
+#define VFS_RENAME_UNLOCK(inode) up(&((inode)->i_sb->s_vfs_rename_sem))
+#endif
+
#endif /* __KERNEL__ */
#endif /* _COMPAT25_H */
if (IS_ERR(handle))
GOTO(out_dput, rc = PTR_ERR(handle));
- lock_kernel();
+ VFS_RENAME_LOCK(mds->mds_objects_dir->d_inode);
rc = ll_vfs_rename(mds->mds_objects_dir->d_inode, filp->f_dentry,
filp->f_vfsmnt, mds->mds_objects_dir->d_inode,
new_child, filp->f_vfsmnt);
- unlock_kernel();
+
+ VFS_RENAME_UNLOCK(mds->mds_objects_dir->d_inode);
if (rc)
CERROR("error renaming new object "LPU64":%u: rc %d\n",
oa->o_id, oa->o_generation, rc);
filter = &exp->exp_obd->u.filter;
push_ctxt(&saved, &exp->exp_obd->obd_lvfs_ctxt, NULL);
- lock_kernel();
if (oa->o_valid &
(OBD_MD_FLMTIME | OBD_MD_FLATIME | OBD_MD_FLCTIME)) {
EXIT;
out_unlock:
- unlock_kernel();
f_dput(dentry);
pop_ctxt(&saved, &exp->exp_obd->obd_lvfs_ctxt, NULL);
return rc;