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

Commit 2a79f17e authored by Al Viro's avatar Al Viro
Browse files

vfs: mnt_drop_write_file()



new helper (wrapper around mnt_drop_write()) to be used in pair with
mnt_want_write_file().

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 8c9379e9
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -259,7 +259,7 @@ static int btrfs_ioctl_setflags(struct file *file, void __user *arg)

	btrfs_end_transaction(trans, root);

	mnt_drop_write(file->f_path.mnt);
	mnt_drop_write_file(file);

	ret = 0;
 out_unlock:
@@ -1971,7 +1971,7 @@ static noinline int btrfs_ioctl_snap_destroy(struct file *file,
	dput(dentry);
out_unlock_dir:
	mutex_unlock(&dir->i_mutex);
	mnt_drop_write(file->f_path.mnt);
	mnt_drop_write_file(file);
out:
	kfree(vol_args);
	return err;
@@ -2040,7 +2040,7 @@ static int btrfs_ioctl_defrag(struct file *file, void __user *argp)
		ret = -EINVAL;
	}
out:
	mnt_drop_write(file->f_path.mnt);
	mnt_drop_write_file(file);
	return ret;
}

@@ -2510,7 +2510,7 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
out_fput:
	fput(src_file);
out_drop_write:
	mnt_drop_write(file->f_path.mnt);
	mnt_drop_write_file(file);
	return ret;
}

@@ -2565,7 +2565,7 @@ static long btrfs_ioctl_trans_start(struct file *file)

out_drop:
	atomic_dec(&root->fs_info->open_ioctl_trans);
	mnt_drop_write(file->f_path.mnt);
	mnt_drop_write_file(file);
out:
	return ret;
}
@@ -2800,7 +2800,7 @@ long btrfs_ioctl_trans_end(struct file *file)

	atomic_dec(&root->fs_info->open_ioctl_trans);

	mnt_drop_write(file->f_path.mnt);
	mnt_drop_write_file(file);
	return 0;
}

+3 −3
Original line number Diff line number Diff line
@@ -83,7 +83,7 @@ long ext2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
		inode->i_ctime = CURRENT_TIME_SEC;
		mark_inode_dirty(inode);
setflags_out:
		mnt_drop_write(filp->f_path.mnt);
		mnt_drop_write_file(filp);
		return ret;
	}
	case EXT2_IOC_GETVERSION:
@@ -100,7 +100,7 @@ long ext2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
			inode->i_ctime = CURRENT_TIME_SEC;
			mark_inode_dirty(inode);
		}
		mnt_drop_write(filp->f_path.mnt);
		mnt_drop_write_file(filp);
		return ret;
	case EXT2_IOC_GETRSVSZ:
		if (test_opt(inode->i_sb, RESERVATION)
@@ -145,7 +145,7 @@ long ext2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
			rsv->rsv_goal_size = rsv_window_size;
		}
		mutex_unlock(&ei->truncate_mutex);
		mnt_drop_write(filp->f_path.mnt);
		mnt_drop_write_file(filp);
		return 0;
	}
	default:
+5 −5
Original line number Diff line number Diff line
@@ -110,7 +110,7 @@ long ext3_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
			err = ext3_change_inode_journal_flag(inode, jflag);
flags_out:
		mutex_unlock(&inode->i_mutex);
		mnt_drop_write(filp->f_path.mnt);
		mnt_drop_write_file(filp);
		return err;
	}
	case EXT3_IOC_GETVERSION:
@@ -147,7 +147,7 @@ long ext3_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
		}
		ext3_journal_stop(handle);
setversion_out:
		mnt_drop_write(filp->f_path.mnt);
		mnt_drop_write_file(filp);
		return err;
	}
	case EXT3_IOC_GETRSVSZ:
@@ -195,7 +195,7 @@ long ext3_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
		}
		mutex_unlock(&ei->truncate_mutex);
setrsvsz_out:
		mnt_drop_write(filp->f_path.mnt);
		mnt_drop_write_file(filp);
		return err;
	}
	case EXT3_IOC_GROUP_EXTEND: {
@@ -221,7 +221,7 @@ long ext3_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
		if (err == 0)
			err = err2;
group_extend_out:
		mnt_drop_write(filp->f_path.mnt);
		mnt_drop_write_file(filp);
		return err;
	}
	case EXT3_IOC_GROUP_ADD: {
@@ -249,7 +249,7 @@ long ext3_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
		if (err == 0)
			err = err2;
group_add_out:
		mnt_drop_write(filp->f_path.mnt);
		mnt_drop_write_file(filp);
		return err;
	}
	case FITRIM: {
+7 −7
Original line number Diff line number Diff line
@@ -134,7 +134,7 @@ long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
			err = ext4_ext_migrate(inode);
flags_out:
		mutex_unlock(&inode->i_mutex);
		mnt_drop_write(filp->f_path.mnt);
		mnt_drop_write_file(filp);
		return err;
	}
	case EXT4_IOC_GETVERSION:
@@ -171,7 +171,7 @@ long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
		}
		ext4_journal_stop(handle);
setversion_out:
		mnt_drop_write(filp->f_path.mnt);
		mnt_drop_write_file(filp);
		return err;
	}
	case EXT4_IOC_GROUP_EXTEND: {
@@ -204,7 +204,7 @@ long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
		}
		if (err == 0)
			err = err2;
		mnt_drop_write(filp->f_path.mnt);
		mnt_drop_write_file(filp);
		ext4_resize_end(sb);

		return err;
@@ -246,7 +246,7 @@ long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)

		err = ext4_move_extents(filp, donor_filp, me.orig_start,
					me.donor_start, me.len, &me.moved_len);
		mnt_drop_write(filp->f_path.mnt);
		mnt_drop_write_file(filp);
		if (me.moved_len > 0)
			file_remove_suid(donor_filp);

@@ -289,7 +289,7 @@ long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
		}
		if (err == 0)
			err = err2;
		mnt_drop_write(filp->f_path.mnt);
		mnt_drop_write_file(filp);
		ext4_resize_end(sb);

		return err;
@@ -313,7 +313,7 @@ long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
		mutex_lock(&(inode->i_mutex));
		err = ext4_ext_migrate(inode);
		mutex_unlock(&(inode->i_mutex));
		mnt_drop_write(filp->f_path.mnt);
		mnt_drop_write_file(filp);
		return err;
	}

@@ -327,7 +327,7 @@ long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
		if (err)
			return err;
		err = ext4_alloc_da_blocks(inode);
		mnt_drop_write(filp->f_path.mnt);
		mnt_drop_write_file(filp);
		return err;
	}

+1 −1
Original line number Diff line number Diff line
@@ -108,7 +108,7 @@ static int fat_ioctl_set_attributes(struct file *file, u32 __user *user_attr)
	fat_save_attrs(inode, attr);
	mark_inode_dirty(inode);
out_drop_write:
	mnt_drop_write(file->f_path.mnt);
	mnt_drop_write_file(file);
out_unlock_inode:
	mutex_unlock(&inode->i_mutex);
out:
Loading