aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/quota.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/gfs2/quota.c')
-rw-r--r--fs/gfs2/quota.c49
1 files changed, 19 insertions, 30 deletions
diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c
index be87983a20a9..572b92eac367 100644
--- a/fs/gfs2/quota.c
+++ b/fs/gfs2/quota.c
@@ -105,7 +105,7 @@ static int qd_alloc(struct gfs2_sbd *sdp, int user, uint32_t id,
105 105
106 return 0; 106 return 0;
107 107
108 fail: 108fail:
109 kfree(qd); 109 kfree(qd);
110 return error; 110 return error;
111} 111}
@@ -199,7 +199,7 @@ static int slot_get(struct gfs2_quota_data *qd)
199 199
200 goto fail; 200 goto fail;
201 201
202 found: 202found:
203 for (b = 0; b < 8; b++) 203 for (b = 0; b < 8; b++)
204 if (!(byte & (1 << b))) 204 if (!(byte & (1 << b)))
205 break; 205 break;
@@ -214,7 +214,7 @@ static int slot_get(struct gfs2_quota_data *qd)
214 214
215 return 0; 215 return 0;
216 216
217 fail: 217fail:
218 qd->qd_slot_count--; 218 qd->qd_slot_count--;
219 spin_unlock(&sdp->sd_quota_spin); 219 spin_unlock(&sdp->sd_quota_spin);
220 return -ENOSPC; 220 return -ENOSPC;
@@ -283,10 +283,9 @@ static int bh_get(struct gfs2_quota_data *qd)
283 283
284 return 0; 284 return 0;
285 285
286 fail_brelse: 286fail_brelse:
287 brelse(bh); 287 brelse(bh);
288 288fail:
289 fail:
290 qd->qd_bh_count--; 289 qd->qd_bh_count--;
291 mutex_unlock(&sdp->sd_quota_mutex); 290 mutex_unlock(&sdp->sd_quota_mutex);
292 return error; 291 return error;
@@ -425,10 +424,9 @@ static int qdsb_get(struct gfs2_sbd *sdp, int user, uint32_t id, int create,
425 424
426 return 0; 425 return 0;
427 426
428 fail_slot: 427fail_slot:
429 slot_put(*qdp); 428 slot_put(*qdp);
430 429fail:
431 fail:
432 qd_put(*qdp); 430 qd_put(*qdp);
433 return error; 431 return error;
434} 432}
@@ -482,10 +480,9 @@ int gfs2_quota_hold(struct gfs2_inode *ip, uint32_t uid, uint32_t gid)
482 qd++; 480 qd++;
483 } 481 }
484 482
485 out: 483out:
486 if (error) 484 if (error)
487 gfs2_quota_unhold(ip); 485 gfs2_quota_unhold(ip);
488
489 return error; 486 return error;
490} 487}
491 488
@@ -728,26 +725,21 @@ static int do_sync(unsigned int num_qd, struct gfs2_quota_data **qda)
728 725
729 error = 0; 726 error = 0;
730 727
731 out_end_trans: 728out_end_trans:
732 gfs2_trans_end(sdp); 729 gfs2_trans_end(sdp);
733 730out_ipres:
734 out_ipres:
735 if (nalloc) 731 if (nalloc)
736 gfs2_inplace_release(ip); 732 gfs2_inplace_release(ip);
737 733out_alloc:
738 out_alloc:
739 if (nalloc) 734 if (nalloc)
740 gfs2_alloc_put(ip); 735 gfs2_alloc_put(ip);
741 736out_gunlock:
742 out_gunlock:
743 gfs2_glock_dq_uninit(&i_gh); 737 gfs2_glock_dq_uninit(&i_gh);
744 738out:
745 out:
746 while (qx--) 739 while (qx--)
747 gfs2_glock_dq_uninit(&ghs[qx]); 740 gfs2_glock_dq_uninit(&ghs[qx]);
748 kfree(ghs); 741 kfree(ghs);
749 gfs2_log_flush(ip->i_gl->gl_sbd, ip->i_gl); 742 gfs2_log_flush(ip->i_gl->gl_sbd, ip->i_gl);
750
751 return error; 743 return error;
752} 744}
753 745
@@ -764,7 +756,7 @@ static int do_glock(struct gfs2_quota_data *qd, int force_refresh,
764 struct gfs2_quota_lvb *qlvb; 756 struct gfs2_quota_lvb *qlvb;
765 757
766 file_ra_state_init(&ra_state, sdp->sd_quota_inode->i_mapping); 758 file_ra_state_init(&ra_state, sdp->sd_quota_inode->i_mapping);
767 restart: 759restart:
768 error = gfs2_glock_nq_init(qd->qd_gl, LM_ST_SHARED, 0, q_gh); 760 error = gfs2_glock_nq_init(qd->qd_gl, LM_ST_SHARED, 0, q_gh);
769 if (error) 761 if (error)
770 return error; 762 return error;
@@ -812,12 +804,10 @@ static int do_glock(struct gfs2_quota_data *qd, int force_refresh,
812 804
813 return 0; 805 return 0;
814 806
815 fail_gunlock: 807fail_gunlock:
816 gfs2_glock_dq_uninit(&i_gh); 808 gfs2_glock_dq_uninit(&i_gh);
817 809fail:
818 fail:
819 gfs2_glock_dq_uninit(q_gh); 810 gfs2_glock_dq_uninit(q_gh);
820
821 return error; 811 return error;
822} 812}
823 813
@@ -919,7 +909,7 @@ void gfs2_quota_unlock(struct gfs2_inode *ip)
919 qd_unlock(qda[x]); 909 qd_unlock(qda[x]);
920 } 910 }
921 911
922 out: 912out:
923 gfs2_quota_unhold(ip); 913 gfs2_quota_unhold(ip);
924} 914}
925 915
@@ -1098,9 +1088,8 @@ int gfs2_quota_read(struct gfs2_sbd *sdp, int user, uint32_t id,
1098 1088
1099 gfs2_glock_dq_uninit(&q_gh); 1089 gfs2_glock_dq_uninit(&q_gh);
1100 1090
1101 out: 1091out:
1102 qd_put(qd); 1092 qd_put(qd);
1103
1104 return error; 1093 return error;
1105} 1094}
1106#endif /* 0 */ 1095#endif /* 0 */
@@ -1202,7 +1191,7 @@ int gfs2_quota_init(struct gfs2_sbd *sdp)
1202 1191
1203 return 0; 1192 return 0;
1204 1193
1205 fail: 1194fail:
1206 gfs2_quota_cleanup(sdp); 1195 gfs2_quota_cleanup(sdp);
1207 return error; 1196 return error;
1208} 1197}