summaryrefslogtreecommitdiffstats
path: root/fs/affs/namei.c
diff options
context:
space:
mode:
authorFabian Frederick <fabf@skynet.be>2017-05-05 20:51:42 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2017-05-05 21:24:52 +0200
commitc6184028a75cf63036267089741ec7ef975ebc27 (patch)
treeff5f7ff224da467a6bd497ba058eac5020e03981 /fs/affs/namei.c
parentMake stat/lstat/fstatat pass AT_NO_AUTOMOUNT to vfs_statx() (diff)
downloadlinux-c6184028a75cf63036267089741ec7ef975ebc27.tar.xz
linux-c6184028a75cf63036267089741ec7ef975ebc27.zip
fs/affs: add rename2 to prepare multiple methods
Currently AFFS only supports RENAME_NOREPLACE. This patch isolates that method to a static function to prepare RENAME_EXCHANGE addition. Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/affs/namei.c')
-rw-r--r--fs/affs/namei.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/fs/affs/namei.c b/fs/affs/namei.c
index d9a40b5ca4d3..49a8dc12d604 100644
--- a/fs/affs/namei.c
+++ b/fs/affs/namei.c
@@ -394,21 +394,14 @@ affs_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry)
return affs_add_entry(dir, inode, dentry, ST_LINKFILE);
}
-int
+static int
affs_rename(struct inode *old_dir, struct dentry *old_dentry,
- struct inode *new_dir, struct dentry *new_dentry,
- unsigned int flags)
+ struct inode *new_dir, struct dentry *new_dentry)
{
struct super_block *sb = old_dir->i_sb;
struct buffer_head *bh = NULL;
int retval;
- if (flags & ~RENAME_NOREPLACE)
- return -EINVAL;
-
- pr_debug("%s(old=%lu,\"%pd\" to new=%lu,\"%pd\")\n", __func__,
- old_dir->i_ino, old_dentry, new_dir->i_ino, new_dentry);
-
retval = affs_check_name(new_dentry->d_name.name,
new_dentry->d_name.len,
affs_nofilenametruncate(old_dentry));
@@ -448,6 +441,20 @@ done:
return retval;
}
+int affs_rename2(struct inode *old_dir, struct dentry *old_dentry,
+ struct inode *new_dir, struct dentry *new_dentry,
+ unsigned int flags)
+{
+
+ if (flags & ~RENAME_NOREPLACE)
+ return -EINVAL;
+
+ pr_debug("%s(old=%lu,\"%pd\" to new=%lu,\"%pd\")\n", __func__,
+ old_dir->i_ino, old_dentry, new_dir->i_ino, new_dentry);
+
+ return affs_rename(old_dir, old_dentry, new_dir, new_dentry);
+}
+
static struct dentry *affs_get_parent(struct dentry *child)
{
struct inode *parent;