|
@@ -1162,7 +1162,7 @@ static int ext4_release_dquot(struct dquot *dquot);
|
|
static int ext4_mark_dquot_dirty(struct dquot *dquot);
|
|
static int ext4_mark_dquot_dirty(struct dquot *dquot);
|
|
static int ext4_write_info(struct super_block *sb, int type);
|
|
static int ext4_write_info(struct super_block *sb, int type);
|
|
static int ext4_quota_on(struct super_block *sb, int type, int format_id,
|
|
static int ext4_quota_on(struct super_block *sb, int type, int format_id,
|
|
- char *path);
|
|
|
|
|
|
+ struct path *path);
|
|
static int ext4_quota_off(struct super_block *sb, int type);
|
|
static int ext4_quota_off(struct super_block *sb, int type);
|
|
static int ext4_quota_on_mount(struct super_block *sb, int type);
|
|
static int ext4_quota_on_mount(struct super_block *sb, int type);
|
|
static ssize_t ext4_quota_read(struct super_block *sb, int type, char *data,
|
|
static ssize_t ext4_quota_read(struct super_block *sb, int type, char *data,
|
|
@@ -4566,27 +4566,20 @@ static int ext4_quota_on_mount(struct super_block *sb, int type)
|
|
* Standard function to be called on quota_on
|
|
* Standard function to be called on quota_on
|
|
*/
|
|
*/
|
|
static int ext4_quota_on(struct super_block *sb, int type, int format_id,
|
|
static int ext4_quota_on(struct super_block *sb, int type, int format_id,
|
|
- char *name)
|
|
|
|
|
|
+ struct path *path)
|
|
{
|
|
{
|
|
int err;
|
|
int err;
|
|
- struct path path;
|
|
|
|
|
|
|
|
if (!test_opt(sb, QUOTA))
|
|
if (!test_opt(sb, QUOTA))
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
|
|
- err = kern_path(name, LOOKUP_FOLLOW, &path);
|
|
|
|
- if (err)
|
|
|
|
- return err;
|
|
|
|
-
|
|
|
|
/* Quotafile not on the same filesystem? */
|
|
/* Quotafile not on the same filesystem? */
|
|
- if (path.mnt->mnt_sb != sb) {
|
|
|
|
- path_put(&path);
|
|
|
|
|
|
+ if (path->mnt->mnt_sb != sb)
|
|
return -EXDEV;
|
|
return -EXDEV;
|
|
- }
|
|
|
|
/* Journaling quota? */
|
|
/* Journaling quota? */
|
|
if (EXT4_SB(sb)->s_qf_names[type]) {
|
|
if (EXT4_SB(sb)->s_qf_names[type]) {
|
|
/* Quotafile not in fs root? */
|
|
/* Quotafile not in fs root? */
|
|
- if (path.dentry->d_parent != sb->s_root)
|
|
|
|
|
|
+ if (path->dentry->d_parent != sb->s_root)
|
|
ext4_msg(sb, KERN_WARNING,
|
|
ext4_msg(sb, KERN_WARNING,
|
|
"Quota file not on filesystem root. "
|
|
"Quota file not on filesystem root. "
|
|
"Journaled quota will not work");
|
|
"Journaled quota will not work");
|
|
@@ -4597,7 +4590,7 @@ static int ext4_quota_on(struct super_block *sb, int type, int format_id,
|
|
* all updates to the file when we bypass pagecache...
|
|
* all updates to the file when we bypass pagecache...
|
|
*/
|
|
*/
|
|
if (EXT4_SB(sb)->s_journal &&
|
|
if (EXT4_SB(sb)->s_journal &&
|
|
- ext4_should_journal_data(path.dentry->d_inode)) {
|
|
|
|
|
|
+ ext4_should_journal_data(path->dentry->d_inode)) {
|
|
/*
|
|
/*
|
|
* We don't need to lock updates but journal_flush() could
|
|
* We don't need to lock updates but journal_flush() could
|
|
* otherwise be livelocked...
|
|
* otherwise be livelocked...
|
|
@@ -4605,15 +4598,11 @@ static int ext4_quota_on(struct super_block *sb, int type, int format_id,
|
|
jbd2_journal_lock_updates(EXT4_SB(sb)->s_journal);
|
|
jbd2_journal_lock_updates(EXT4_SB(sb)->s_journal);
|
|
err = jbd2_journal_flush(EXT4_SB(sb)->s_journal);
|
|
err = jbd2_journal_flush(EXT4_SB(sb)->s_journal);
|
|
jbd2_journal_unlock_updates(EXT4_SB(sb)->s_journal);
|
|
jbd2_journal_unlock_updates(EXT4_SB(sb)->s_journal);
|
|
- if (err) {
|
|
|
|
- path_put(&path);
|
|
|
|
|
|
+ if (err)
|
|
return err;
|
|
return err;
|
|
- }
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- err = dquot_quota_on_path(sb, type, format_id, &path);
|
|
|
|
- path_put(&path);
|
|
|
|
- return err;
|
|
|
|
|
|
+ return dquot_quota_on(sb, type, format_id, path);
|
|
}
|
|
}
|
|
|
|
|
|
static int ext4_quota_off(struct super_block *sb, int type)
|
|
static int ext4_quota_off(struct super_block *sb, int type)
|