diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2012-09-16 06:11:50 -0400 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2012-09-18 04:01:40 -0400 |
commit | aca645a6a54e001e004f1f1e0eafd94f994bb1b3 (patch) | |
tree | 6e143c0077f22d5f3487d67408e7015805f74a69 /fs/ocfs2 | |
parent | 431f19744d15531825cdbc8e771b43854b0d005b (diff) |
userns: Modify dqget to take struct kqid
Modify dqget to take struct kqid instead of a type and an identifier
pair.
Modify the callers of dqget in ocfs2 and dquot to take generate
a struct kqid so they can continue to call dqget. The conversion
to create struct kqid should all be the final conversions that
are needed in those code paths.
Cc: Jan Kara <jack@suse.cz>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'fs/ocfs2')
-rw-r--r-- | fs/ocfs2/file.c | 6 | ||||
-rw-r--r-- | fs/ocfs2/quota_local.c | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index 46a1f6d75104..5a4ee77cec51 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c | |||
@@ -1184,8 +1184,7 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr) | |||
1184 | if (attr->ia_valid & ATTR_UID && attr->ia_uid != inode->i_uid | 1184 | if (attr->ia_valid & ATTR_UID && attr->ia_uid != inode->i_uid |
1185 | && OCFS2_HAS_RO_COMPAT_FEATURE(sb, | 1185 | && OCFS2_HAS_RO_COMPAT_FEATURE(sb, |
1186 | OCFS2_FEATURE_RO_COMPAT_USRQUOTA)) { | 1186 | OCFS2_FEATURE_RO_COMPAT_USRQUOTA)) { |
1187 | transfer_to[USRQUOTA] = dqget(sb, attr->ia_uid, | 1187 | transfer_to[USRQUOTA] = dqget(sb, make_kqid_uid(attr->ia_uid)); |
1188 | USRQUOTA); | ||
1189 | if (!transfer_to[USRQUOTA]) { | 1188 | if (!transfer_to[USRQUOTA]) { |
1190 | status = -ESRCH; | 1189 | status = -ESRCH; |
1191 | goto bail_unlock; | 1190 | goto bail_unlock; |
@@ -1194,8 +1193,7 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr) | |||
1194 | if (attr->ia_valid & ATTR_GID && attr->ia_gid != inode->i_gid | 1193 | if (attr->ia_valid & ATTR_GID && attr->ia_gid != inode->i_gid |
1195 | && OCFS2_HAS_RO_COMPAT_FEATURE(sb, | 1194 | && OCFS2_HAS_RO_COMPAT_FEATURE(sb, |
1196 | OCFS2_FEATURE_RO_COMPAT_GRPQUOTA)) { | 1195 | OCFS2_FEATURE_RO_COMPAT_GRPQUOTA)) { |
1197 | transfer_to[GRPQUOTA] = dqget(sb, attr->ia_gid, | 1196 | transfer_to[GRPQUOTA] = dqget(sb, make_kqid_gid(attr->ia_gid)); |
1198 | GRPQUOTA); | ||
1199 | if (!transfer_to[GRPQUOTA]) { | 1197 | if (!transfer_to[GRPQUOTA]) { |
1200 | status = -ESRCH; | 1198 | status = -ESRCH; |
1201 | goto bail_unlock; | 1199 | goto bail_unlock; |
diff --git a/fs/ocfs2/quota_local.c b/fs/ocfs2/quota_local.c index f100bf70a906..020f0ba29ee5 100644 --- a/fs/ocfs2/quota_local.c +++ b/fs/ocfs2/quota_local.c | |||
@@ -501,7 +501,9 @@ static int ocfs2_recover_local_quota_file(struct inode *lqinode, | |||
501 | } | 501 | } |
502 | dqblk = (struct ocfs2_local_disk_dqblk *)(qbh->b_data + | 502 | dqblk = (struct ocfs2_local_disk_dqblk *)(qbh->b_data + |
503 | ol_dqblk_block_off(sb, chunk, bit)); | 503 | ol_dqblk_block_off(sb, chunk, bit)); |
504 | dquot = dqget(sb, le64_to_cpu(dqblk->dqb_id), type); | 504 | dquot = dqget(sb, |
505 | make_kqid(&init_user_ns, type, | ||
506 | le64_to_cpu(dqblk->dqb_id))); | ||
505 | if (!dquot) { | 507 | if (!dquot) { |
506 | status = -EIO; | 508 | status = -EIO; |
507 | mlog(ML_ERROR, "Failed to get quota structure " | 509 | mlog(ML_ERROR, "Failed to get quota structure " |