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

Commit 730d8a50 authored by Amit Pundir's avatar Amit Pundir
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.

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

Signed-off-by: default avatarAmit Pundir <amit.pundir@linaro.org>
parent 95c265f6
Loading
Loading
Loading
Loading
+5 −1
Original line number Original line Diff line number Diff line
@@ -443,7 +443,8 @@ static int sdcardfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode
 * superblock-level name-space lock for renames and copy-ups.
 * superblock-level name-space lock for renames and copy-ups.
 */
 */
static int sdcardfs_rename(struct inode *old_dir, struct dentry *old_dentry,
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;
	int err = 0;
	struct dentry *lower_old_dentry = NULL;
	struct dentry *lower_old_dentry = NULL;
@@ -455,6 +456,9 @@ static int sdcardfs_rename(struct inode *old_dir, struct dentry *old_dentry,
	struct path lower_old_path, lower_new_path;
	struct path lower_old_path, lower_new_path;
	const struct cred *saved_cred = NULL;
	const struct cred *saved_cred = NULL;


	if (flags)
		return -EINVAL;

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