Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 373f7f5c authored by Amit Pundir's avatar Amit Pundir Committed by Daniel Rosenberg
Browse files

ANDROID: sdcardfs: make it use new .rename i_op



Since commit 2773bf00 ("fs: rename "rename2" i_op to "rename""),
syscall rename2 is merged with rename syscall and it broke sdcard_fs
build and we get following build error:

  CC [M]  fs/sdcardfs/inode.o
fs/sdcardfs/inode.c:786:13: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
  .rename  = sdcardfs_rename,
             ^
fs/sdcardfs/inode.c:786:13: note: (near initialization for ‘sdcardfs_dir_iops.rename’)

renameat2 syscall is the same as renameat with an added flags argument
and calling renameat2 with flags=0 is equivalent to calling renameat.

Change-Id: I48f3c76c3af481241188253a76f310670de6bd18
Signed-off-by: default avatarAmit Pundir <amit.pundir@linaro.org>
parent 37f547d7
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -457,7 +457,8 @@ static int sdcardfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode
 * superblock-level name-space lock for renames and copy-ups.
 */
static int sdcardfs_rename(struct inode *old_dir, struct dentry *old_dentry,
			 struct inode *new_dir, struct dentry *new_dentry)
			 struct inode *new_dir, struct dentry *new_dentry,
			 unsigned int flags)
{
	int err = 0;
	struct dentry *lower_old_dentry = NULL;
@@ -470,6 +471,9 @@ static int sdcardfs_rename(struct inode *old_dir, struct dentry *old_dentry,
	struct path lower_old_path, lower_new_path;
	const struct cred *saved_cred = NULL;

	if (flags)
		return -EINVAL;

	if(!check_caller_access_to_name(old_dir, old_dentry->d_name.name) ||
		!check_caller_access_to_name(new_dir, new_dentry->d_name.name)) {
		printk(KERN_INFO "%s: need to check the caller's gid in packages.list\n"