pull mnt_want_write()/mnt_drop_write() into kern_path_create()/done_path_create() resp.

One side effect - attempt to create a cross-device link on a read-only fs fails
with EROFS instead of EXDEV now.  Makes more sense, POSIX allows, etc.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
Al Viro
2012-07-20 02:25:00 +04:00
parent 8e4bfca1d1
commit a8104a9fcd
3 changed files with 18 additions and 50 deletions

View File

@@ -4466,16 +4466,9 @@ int ocfs2_reflink_ioctl(struct inode *inode,
goto out_dput;
}
error = mnt_want_write(new_path.mnt);
if (error) {
mlog_errno(error);
goto out_dput;
}
error = ocfs2_vfs_reflink(old_path.dentry,
new_path.dentry->d_inode,
new_dentry, preserve);
mnt_drop_write(new_path.mnt);
out_dput:
done_path_create(&new_path, new_dentry);
out: