aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2013-11-26 10:17:09 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2014-01-03 04:59:05 -0500
commit7aed98fb1dfbd3f6d7b78647ff2956de2fcc4150 (patch)
treee29dd8176593764106a1fc94f7a57f050b8820f0 /fs
parente4f2920625cc2c562941b280914823a553f6973d (diff)
GFS2: Remove gfs2_quota_change_host structure
There is only one place this is used, when reading in the quota changes at mount time. It is not really required and much simpler to just convert the fields from the on-disk structure as required. There should be no functional change as a result of this patch. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/gfs2/quota.c37
1 files changed, 12 insertions, 25 deletions
diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c
index 98236d0df3ca..1b6b3675ee1d 100644
--- a/fs/gfs2/quota.c
+++ b/fs/gfs2/quota.c
@@ -67,12 +67,6 @@
67#include "inode.h" 67#include "inode.h"
68#include "util.h" 68#include "util.h"
69 69
70struct gfs2_quota_change_host {
71 u64 qc_change;
72 u32 qc_flags; /* GFS2_QCF_... */
73 struct kqid qc_id;
74};
75
76/* Lock order: qd_lock -> qd->lockref.lock -> lru lock */ 70/* Lock order: qd_lock -> qd->lockref.lock -> lru lock */
77static DEFINE_SPINLOCK(qd_lock); 71static DEFINE_SPINLOCK(qd_lock);
78struct list_lru gfs2_qd_lru; 72struct list_lru gfs2_qd_lru;
@@ -1214,17 +1208,6 @@ int gfs2_quota_refresh(struct gfs2_sbd *sdp, struct kqid qid)
1214 return error; 1208 return error;
1215} 1209}
1216 1210
1217static void gfs2_quota_change_in(struct gfs2_quota_change_host *qc, const void *buf)
1218{
1219 const struct gfs2_quota_change *str = buf;
1220
1221 qc->qc_change = be64_to_cpu(str->qc_change);
1222 qc->qc_flags = be32_to_cpu(str->qc_flags);
1223 qc->qc_id = make_kqid(&init_user_ns,
1224 (qc->qc_flags & GFS2_QCF_USER)?USRQUOTA:GRPQUOTA,
1225 be32_to_cpu(str->qc_id));
1226}
1227
1228int gfs2_quota_init(struct gfs2_sbd *sdp) 1211int gfs2_quota_init(struct gfs2_sbd *sdp)
1229{ 1212{
1230 struct gfs2_inode *ip = GFS2_I(sdp->sd_qc_inode); 1213 struct gfs2_inode *ip = GFS2_I(sdp->sd_qc_inode);
@@ -1257,6 +1240,7 @@ int gfs2_quota_init(struct gfs2_sbd *sdp)
1257 1240
1258 for (x = 0; x < blocks; x++) { 1241 for (x = 0; x < blocks; x++) {
1259 struct buffer_head *bh; 1242 struct buffer_head *bh;
1243 const struct gfs2_quota_change *qc;
1260 unsigned int y; 1244 unsigned int y;
1261 1245
1262 if (!extlen) { 1246 if (!extlen) {
@@ -1274,25 +1258,28 @@ int gfs2_quota_init(struct gfs2_sbd *sdp)
1274 goto fail; 1258 goto fail;
1275 } 1259 }
1276 1260
1261 qc = (const struct gfs2_quota_change *)(bh->b_data + sizeof(struct gfs2_meta_header));
1277 for (y = 0; y < sdp->sd_qc_per_block && slot < sdp->sd_quota_slots; 1262 for (y = 0; y < sdp->sd_qc_per_block && slot < sdp->sd_quota_slots;
1278 y++, slot++) { 1263 y++, slot++) {
1279 struct gfs2_quota_change_host qc;
1280 struct gfs2_quota_data *qd; 1264 struct gfs2_quota_data *qd;
1281 1265 s64 qc_change = be64_to_cpu(qc->qc_change);
1282 gfs2_quota_change_in(&qc, bh->b_data + 1266 u32 qc_flags = be32_to_cpu(qc->qc_flags);
1283 sizeof(struct gfs2_meta_header) + 1267 enum quota_type qtype = (qc_flags & GFS2_QCF_USER) ?
1284 y * sizeof(struct gfs2_quota_change)); 1268 USRQUOTA : GRPQUOTA;
1285 if (!qc.qc_change) 1269 struct kqid qc_id = make_kqid(&init_user_ns, qtype,
1270 be32_to_cpu(qc->qc_id));
1271 qc++;
1272 if (!qc_change)
1286 continue; 1273 continue;
1287 1274
1288 error = qd_alloc(sdp, qc.qc_id, &qd); 1275 error = qd_alloc(sdp, qc_id, &qd);
1289 if (error) { 1276 if (error) {
1290 brelse(bh); 1277 brelse(bh);
1291 goto fail; 1278 goto fail;
1292 } 1279 }
1293 1280
1294 set_bit(QDF_CHANGE, &qd->qd_flags); 1281 set_bit(QDF_CHANGE, &qd->qd_flags);
1295 qd->qd_change = qc.qc_change; 1282 qd->qd_change = qc_change;
1296 qd->qd_slot = slot; 1283 qd->qd_slot = slot;
1297 qd->qd_slot_count = 1; 1284 qd->qd_slot_count = 1;
1298 1285