summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2009-05-20 11:31:55 -0700
committerBrian Behlendorf <[email protected]>2009-05-20 11:31:55 -0700
commita093c6a49927912642ccc35e99f74ecf37d00334 (patch)
tree47260ac77af483a77797fd3c85a491d0ac3631d7 /module
parent6c9433c150ad12d01f7ea4cfc72c8647a08ac5fc (diff)
SLES10 Fixes (part 4):
- Configure check for SLES specific API change to vfs_unlink() and vfs_rename() which added a 'struct vfsmount *' argument. This was for something called the linux-security-module, but it appears that it was never adopted upstream.
Diffstat (limited to 'module')
-rw-r--r--module/spl/spl-vnode.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/module/spl/spl-vnode.c b/module/spl/spl-vnode.c
index b19d9f1de..c5595dee0 100644
--- a/module/spl/spl-vnode.c
+++ b/module/spl/spl-vnode.c
@@ -290,7 +290,7 @@ vn_remove(const char *path, uio_seg_t seg, int flags)
mutex_lock_nested(&nd.nd_dentry->d_inode->i_mutex, I_MUTEX_PARENT);
#else
down(&nd.nd_dentry->d_inode->i_sem);
-#endif
+#endif /* HAVE_INODE_I_MUTEX */
dentry = vn_lookup_hash(&nd);
rc = PTR_ERR(dentry);
if (!IS_ERR(dentry)) {
@@ -301,7 +301,11 @@ vn_remove(const char *path, uio_seg_t seg, int flags)
inode = dentry->d_inode;
if (inode)
atomic_inc(&inode->i_count);
+#ifdef HAVE_2ARGS_VFS_UNLINK
rc = vfs_unlink(nd.nd_dentry->d_inode, dentry);
+#else
+ rc = vfs_unlink(nd.nd_dentry->d_inode, dentry, nd.mnt);
+#endif /* HAVE_2ARGS_VFS_UNLINK */
exit2:
dput(dentry);
}
@@ -309,7 +313,7 @@ exit2:
mutex_unlock(&nd.nd_dentry->d_inode->i_mutex);
#else
up(&nd.nd_dentry->d_inode->i_sem);
-#endif
+#endif /* HAVE_INODE_I_MUTEX */
if (inode)
iput(inode); /* truncate the inode here */
exit1:
@@ -328,9 +332,9 @@ EXPORT_SYMBOL(vn_remove);
int
vn_rename(const char *oldname, const char *newname, int x1)
{
- struct dentry * old_dir, * new_dir;
- struct dentry * old_dentry, *new_dentry;
- struct dentry * trap;
+ struct dentry *old_dir, *new_dir;
+ struct dentry *old_dentry, *new_dentry;
+ struct dentry *trap;
struct nameidata oldnd, newnd;
int rc = 0;
ENTRY;
@@ -393,8 +397,13 @@ vn_rename(const char *oldname, const char *newname, int x1)
if (new_dentry == trap)
GOTO(exit5, rc);
+#ifdef HAVE_4ARGS_VFS_RENAME
rc = vfs_rename(old_dir->d_inode, old_dentry,
new_dir->d_inode, new_dentry);
+#else
+ rc = vfs_rename(old_dir->d_inode, old_dentry, oldnd.mnt,
+ new_dir->d_inode, new_dentry, newnd.mnt);
+#endif /* HAVE_4ARGS_VFS_RENAME */
exit5:
dput(new_dentry);
exit4: