diff options
Diffstat (limited to 'fs/gfs2/quota.c')
| -rw-r--r-- | fs/gfs2/quota.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c index f752b0184690..d3cd5171d7c7 100644 --- a/fs/gfs2/quota.c +++ b/fs/gfs2/quota.c | |||
| @@ -248,7 +248,7 @@ static void slot_put(struct gfs2_quota_data *qd) | |||
| 248 | static int bh_get(struct gfs2_quota_data *qd) | 248 | static int bh_get(struct gfs2_quota_data *qd) |
| 249 | { | 249 | { |
| 250 | struct gfs2_sbd *sdp = qd->qd_gl->gl_sbd; | 250 | struct gfs2_sbd *sdp = qd->qd_gl->gl_sbd; |
| 251 | struct gfs2_inode *ip = sdp->sd_qc_inode->u.generic_ip; | 251 | struct gfs2_inode *ip = GFS2_I(sdp->sd_qc_inode); |
| 252 | unsigned int block, offset; | 252 | unsigned int block, offset; |
| 253 | uint64_t dblock; | 253 | uint64_t dblock; |
| 254 | int new = 0; | 254 | int new = 0; |
| @@ -266,7 +266,7 @@ static int bh_get(struct gfs2_quota_data *qd) | |||
| 266 | block = qd->qd_slot / sdp->sd_qc_per_block; | 266 | block = qd->qd_slot / sdp->sd_qc_per_block; |
| 267 | offset = qd->qd_slot % sdp->sd_qc_per_block;; | 267 | offset = qd->qd_slot % sdp->sd_qc_per_block;; |
| 268 | 268 | ||
| 269 | error = gfs2_block_map(ip->i_vnode, block, &new, &dblock, &boundary); | 269 | error = gfs2_block_map(&ip->i_inode, block, &new, &dblock, &boundary); |
| 270 | if (error) | 270 | if (error) |
| 271 | goto fail; | 271 | goto fail; |
| 272 | error = gfs2_meta_read(ip->i_gl, dblock, DIO_START | DIO_WAIT, &bh); | 272 | error = gfs2_meta_read(ip->i_gl, dblock, DIO_START | DIO_WAIT, &bh); |
| @@ -444,7 +444,7 @@ static void qdsb_put(struct gfs2_quota_data *qd) | |||
| 444 | 444 | ||
| 445 | int gfs2_quota_hold(struct gfs2_inode *ip, uint32_t uid, uint32_t gid) | 445 | int gfs2_quota_hold(struct gfs2_inode *ip, uint32_t uid, uint32_t gid) |
| 446 | { | 446 | { |
| 447 | struct gfs2_sbd *sdp = ip->i_sbd; | 447 | struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); |
| 448 | struct gfs2_alloc *al = &ip->i_alloc; | 448 | struct gfs2_alloc *al = &ip->i_alloc; |
| 449 | struct gfs2_quota_data **qd = al->al_qd; | 449 | struct gfs2_quota_data **qd = al->al_qd; |
| 450 | int error; | 450 | int error; |
| @@ -493,7 +493,7 @@ int gfs2_quota_hold(struct gfs2_inode *ip, uint32_t uid, uint32_t gid) | |||
| 493 | 493 | ||
| 494 | void gfs2_quota_unhold(struct gfs2_inode *ip) | 494 | void gfs2_quota_unhold(struct gfs2_inode *ip) |
| 495 | { | 495 | { |
| 496 | struct gfs2_sbd *sdp = ip->i_sbd; | 496 | struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); |
| 497 | struct gfs2_alloc *al = &ip->i_alloc; | 497 | struct gfs2_alloc *al = &ip->i_alloc; |
| 498 | unsigned int x; | 498 | unsigned int x; |
| 499 | 499 | ||
| @@ -531,7 +531,7 @@ static int sort_qd(const void *a, const void *b) | |||
| 531 | static void do_qc(struct gfs2_quota_data *qd, int64_t change) | 531 | static void do_qc(struct gfs2_quota_data *qd, int64_t change) |
| 532 | { | 532 | { |
| 533 | struct gfs2_sbd *sdp = qd->qd_gl->gl_sbd; | 533 | struct gfs2_sbd *sdp = qd->qd_gl->gl_sbd; |
| 534 | struct gfs2_inode *ip = sdp->sd_qc_inode->u.generic_ip; | 534 | struct gfs2_inode *ip = GFS2_I(sdp->sd_qc_inode); |
| 535 | struct gfs2_quota_change *qc = qd->qd_bh_qc; | 535 | struct gfs2_quota_change *qc = qd->qd_bh_qc; |
| 536 | int64_t x; | 536 | int64_t x; |
| 537 | 537 | ||
| @@ -578,7 +578,7 @@ static void do_qc(struct gfs2_quota_data *qd, int64_t change) | |||
| 578 | static int gfs2_adjust_quota(struct gfs2_inode *ip, loff_t loc, | 578 | static int gfs2_adjust_quota(struct gfs2_inode *ip, loff_t loc, |
| 579 | int64_t change, struct gfs2_quota_data *qd) | 579 | int64_t change, struct gfs2_quota_data *qd) |
| 580 | { | 580 | { |
| 581 | struct inode *inode = ip->i_vnode; | 581 | struct inode *inode = &ip->i_inode; |
| 582 | struct address_space *mapping = inode->i_mapping; | 582 | struct address_space *mapping = inode->i_mapping; |
| 583 | unsigned long index = loc >> PAGE_CACHE_SHIFT; | 583 | unsigned long index = loc >> PAGE_CACHE_SHIFT; |
| 584 | unsigned offset = loc & (PAGE_CACHE_SHIFT - 1); | 584 | unsigned offset = loc & (PAGE_CACHE_SHIFT - 1); |
| @@ -647,7 +647,7 @@ unlock: | |||
| 647 | static int do_sync(unsigned int num_qd, struct gfs2_quota_data **qda) | 647 | static int do_sync(unsigned int num_qd, struct gfs2_quota_data **qda) |
| 648 | { | 648 | { |
| 649 | struct gfs2_sbd *sdp = (*qda)->qd_gl->gl_sbd; | 649 | struct gfs2_sbd *sdp = (*qda)->qd_gl->gl_sbd; |
| 650 | struct gfs2_inode *ip = sdp->sd_quota_inode->u.generic_ip; | 650 | struct gfs2_inode *ip = GFS2_I(sdp->sd_quota_inode); |
| 651 | unsigned int data_blocks, ind_blocks; | 651 | unsigned int data_blocks, ind_blocks; |
| 652 | struct file_ra_state ra_state; | 652 | struct file_ra_state ra_state; |
| 653 | struct gfs2_holder *ghs, i_gh; | 653 | struct gfs2_holder *ghs, i_gh; |
| @@ -716,7 +716,7 @@ static int do_sync(unsigned int num_qd, struct gfs2_quota_data **qda) | |||
| 716 | goto out_gunlock; | 716 | goto out_gunlock; |
| 717 | } | 717 | } |
| 718 | 718 | ||
| 719 | file_ra_state_init(&ra_state, ip->i_vnode->i_mapping); | 719 | file_ra_state_init(&ra_state, ip->i_inode.i_mapping); |
| 720 | for (x = 0; x < num_qd; x++) { | 720 | for (x = 0; x < num_qd; x++) { |
| 721 | qd = qda[x]; | 721 | qd = qda[x]; |
| 722 | offset = qd2offset(qd); | 722 | offset = qd2offset(qd); |
| @@ -758,7 +758,7 @@ static int do_glock(struct gfs2_quota_data *qd, int force_refresh, | |||
| 758 | struct gfs2_holder *q_gh) | 758 | struct gfs2_holder *q_gh) |
| 759 | { | 759 | { |
| 760 | struct gfs2_sbd *sdp = qd->qd_gl->gl_sbd; | 760 | struct gfs2_sbd *sdp = qd->qd_gl->gl_sbd; |
| 761 | struct gfs2_inode *ip = sdp->sd_quota_inode->u.generic_ip; | 761 | struct gfs2_inode *ip = GFS2_I(sdp->sd_quota_inode); |
| 762 | struct gfs2_holder i_gh; | 762 | struct gfs2_holder i_gh; |
| 763 | struct gfs2_quota q; | 763 | struct gfs2_quota q; |
| 764 | char buf[sizeof(struct gfs2_quota)]; | 764 | char buf[sizeof(struct gfs2_quota)]; |
| @@ -829,7 +829,7 @@ static int do_glock(struct gfs2_quota_data *qd, int force_refresh, | |||
| 829 | 829 | ||
| 830 | int gfs2_quota_lock(struct gfs2_inode *ip, uint32_t uid, uint32_t gid) | 830 | int gfs2_quota_lock(struct gfs2_inode *ip, uint32_t uid, uint32_t gid) |
| 831 | { | 831 | { |
| 832 | struct gfs2_sbd *sdp = ip->i_sbd; | 832 | struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); |
| 833 | struct gfs2_alloc *al = &ip->i_alloc; | 833 | struct gfs2_alloc *al = &ip->i_alloc; |
| 834 | unsigned int x; | 834 | unsigned int x; |
| 835 | int error = 0; | 835 | int error = 0; |
| @@ -958,7 +958,7 @@ static int print_message(struct gfs2_quota_data *qd, char *type) | |||
| 958 | 958 | ||
| 959 | int gfs2_quota_check(struct gfs2_inode *ip, uint32_t uid, uint32_t gid) | 959 | int gfs2_quota_check(struct gfs2_inode *ip, uint32_t uid, uint32_t gid) |
| 960 | { | 960 | { |
| 961 | struct gfs2_sbd *sdp = ip->i_sbd; | 961 | struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); |
| 962 | struct gfs2_alloc *al = &ip->i_alloc; | 962 | struct gfs2_alloc *al = &ip->i_alloc; |
| 963 | struct gfs2_quota_data *qd; | 963 | struct gfs2_quota_data *qd; |
| 964 | int64_t value; | 964 | int64_t value; |
| @@ -1008,7 +1008,7 @@ void gfs2_quota_change(struct gfs2_inode *ip, int64_t change, | |||
| 1008 | unsigned int x; | 1008 | unsigned int x; |
| 1009 | unsigned int found = 0; | 1009 | unsigned int found = 0; |
| 1010 | 1010 | ||
| 1011 | if (gfs2_assert_warn(ip->i_sbd, change)) | 1011 | if (gfs2_assert_warn(GFS2_SB(&ip->i_inode), change)) |
| 1012 | return; | 1012 | return; |
| 1013 | if (ip->i_di.di_flags & GFS2_DIF_SYSTEM) | 1013 | if (ip->i_di.di_flags & GFS2_DIF_SYSTEM) |
| 1014 | return; | 1014 | return; |
| @@ -1126,7 +1126,7 @@ int gfs2_quota_read(struct gfs2_sbd *sdp, int user, uint32_t id, | |||
| 1126 | 1126 | ||
| 1127 | int gfs2_quota_init(struct gfs2_sbd *sdp) | 1127 | int gfs2_quota_init(struct gfs2_sbd *sdp) |
| 1128 | { | 1128 | { |
| 1129 | struct gfs2_inode *ip = sdp->sd_qc_inode->u.generic_ip; | 1129 | struct gfs2_inode *ip = GFS2_I(sdp->sd_qc_inode); |
| 1130 | unsigned int blocks = ip->i_di.di_size >> sdp->sd_sb.sb_bsize_shift; | 1130 | unsigned int blocks = ip->i_di.di_size >> sdp->sd_sb.sb_bsize_shift; |
| 1131 | unsigned int x, slot = 0; | 1131 | unsigned int x, slot = 0; |
| 1132 | unsigned int found = 0; | 1132 | unsigned int found = 0; |
| @@ -1162,7 +1162,7 @@ int gfs2_quota_init(struct gfs2_sbd *sdp) | |||
| 1162 | 1162 | ||
| 1163 | if (!extlen) { | 1163 | if (!extlen) { |
| 1164 | int new = 0; | 1164 | int new = 0; |
| 1165 | error = gfs2_extent_map(ip->i_vnode, x, &new, &dblock, &extlen); | 1165 | error = gfs2_extent_map(&ip->i_inode, x, &new, &dblock, &extlen); |
| 1166 | if (error) | 1166 | if (error) |
| 1167 | goto fail; | 1167 | goto fail; |
| 1168 | } | 1168 | } |
