diff options
author | Christoph Hellwig <hch@infradead.org> | 2010-05-06 17:04:58 -0400 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2010-05-21 13:30:43 -0400 |
commit | b9b2dd36c1bc64430f8e13990ab135cbecc10076 (patch) | |
tree | 051bb6a238c9ff98fe135de3e8591c65cf242d46 /fs/quota/dquot.c | |
parent | 0636c73ee7b129f77f577aaaefc8dde057be6d18 (diff) |
quota: unify ->get_dqblk
Pass the larger struct fs_disk_quota to the ->get_dqblk operation so
that the Q_GETQUOTA and Q_XGETQUOTA operations can be implemented
with a single filesystem operation and we can retire the ->get_xquota
operation. The additional information (RT-subvolume accounting and
warn counts) are left zero for the VFS quota implementation.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/quota/dquot.c')
-rw-r--r-- | fs/quota/dquot.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index 01347e81d0ca..6aed77fc99c7 100644 --- a/fs/quota/dquot.c +++ b/fs/quota/dquot.c | |||
@@ -2301,25 +2301,30 @@ static inline qsize_t stoqb(qsize_t space) | |||
2301 | } | 2301 | } |
2302 | 2302 | ||
2303 | /* Generic routine for getting common part of quota structure */ | 2303 | /* Generic routine for getting common part of quota structure */ |
2304 | static void do_get_dqblk(struct dquot *dquot, struct if_dqblk *di) | 2304 | static void do_get_dqblk(struct dquot *dquot, struct fs_disk_quota *di) |
2305 | { | 2305 | { |
2306 | struct mem_dqblk *dm = &dquot->dq_dqb; | 2306 | struct mem_dqblk *dm = &dquot->dq_dqb; |
2307 | 2307 | ||
2308 | memset(di, 0, sizeof(*di)); | ||
2309 | di->d_version = FS_DQUOT_VERSION; | ||
2310 | di->d_flags = dquot->dq_type == USRQUOTA ? | ||
2311 | XFS_USER_QUOTA : XFS_GROUP_QUOTA; | ||
2312 | di->d_id = dquot->dq_id; | ||
2313 | |||
2308 | spin_lock(&dq_data_lock); | 2314 | spin_lock(&dq_data_lock); |
2309 | di->dqb_bhardlimit = stoqb(dm->dqb_bhardlimit); | 2315 | di->d_blk_hardlimit = stoqb(dm->dqb_bhardlimit); |
2310 | di->dqb_bsoftlimit = stoqb(dm->dqb_bsoftlimit); | 2316 | di->d_blk_softlimit = stoqb(dm->dqb_bsoftlimit); |
2311 | di->dqb_curspace = dm->dqb_curspace + dm->dqb_rsvspace; | 2317 | di->d_ino_hardlimit = dm->dqb_ihardlimit; |
2312 | di->dqb_ihardlimit = dm->dqb_ihardlimit; | 2318 | di->d_ino_softlimit = dm->dqb_isoftlimit; |
2313 | di->dqb_isoftlimit = dm->dqb_isoftlimit; | 2319 | di->d_bcount = dm->dqb_curspace + dm->dqb_rsvspace; |
2314 | di->dqb_curinodes = dm->dqb_curinodes; | 2320 | di->d_icount = dm->dqb_curinodes; |
2315 | di->dqb_btime = dm->dqb_btime; | 2321 | di->d_btimer = dm->dqb_btime; |
2316 | di->dqb_itime = dm->dqb_itime; | 2322 | di->d_itimer = dm->dqb_itime; |
2317 | di->dqb_valid = QIF_ALL; | ||
2318 | spin_unlock(&dq_data_lock); | 2323 | spin_unlock(&dq_data_lock); |
2319 | } | 2324 | } |
2320 | 2325 | ||
2321 | int vfs_get_dqblk(struct super_block *sb, int type, qid_t id, | 2326 | int vfs_get_dqblk(struct super_block *sb, int type, qid_t id, |
2322 | struct if_dqblk *di) | 2327 | struct fs_disk_quota *di) |
2323 | { | 2328 | { |
2324 | struct dquot *dquot; | 2329 | struct dquot *dquot; |
2325 | 2330 | ||