@@ -521,12 +521,10 @@ static int make_dinode(struct gfs2_inode *dip, struct gfs2_glock *gl,
521521 int error ;
522522
523523 munge_mode_uid_gid (dip , & mode , & uid , & gid );
524- if (!gfs2_qadata_get (dip ))
525- return - ENOMEM ;
526524
527525 error = gfs2_quota_lock (dip , uid , gid );
528526 if (error )
529- goto out ;
527+ return error ;
530528
531529 error = gfs2_quota_check (dip , uid , gid );
532530 if (error )
@@ -542,24 +540,17 @@ static int make_dinode(struct gfs2_inode *dip, struct gfs2_glock *gl,
542540
543541out_quota :
544542 gfs2_quota_unlock (dip );
545- out :
546- gfs2_qadata_put (dip );
547543 return error ;
548544}
549545
550546static int link_dinode (struct gfs2_inode * dip , const struct qstr * name ,
551547 struct gfs2_inode * ip )
552548{
553549 struct gfs2_sbd * sdp = GFS2_SB (& dip -> i_inode );
554- struct gfs2_qadata * qa ;
555550 int alloc_required ;
556551 struct buffer_head * dibh ;
557552 int error ;
558553
559- qa = gfs2_qadata_get (dip );
560- if (!qa )
561- return - ENOMEM ;
562-
563554 error = gfs2_quota_lock (dip , NO_QUOTA_CHANGE , NO_QUOTA_CHANGE );
564555 if (error )
565556 goto fail ;
@@ -611,7 +602,6 @@ static int link_dinode(struct gfs2_inode *dip, const struct qstr *name,
611602 gfs2_quota_unlock (dip );
612603
613604fail :
614- gfs2_qadata_put (dip );
615605 return error ;
616606}
617607
@@ -734,7 +724,6 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry,
734724 if (gfs2_mb_reserved (dip ))
735725 gfs2_inplace_release (dip );
736726 gfs2_quota_unlock (dip );
737- gfs2_qadata_put (dip );
738727 mark_inode_dirty (inode );
739728 gfs2_glock_dq_uninit_m (2 , ghs );
740729 d_instantiate (dentry , inode );
@@ -883,16 +872,9 @@ static int gfs2_link(struct dentry *old_dentry, struct inode *dir,
883872 error = 0 ;
884873
885874 if (alloc_required ) {
886- struct gfs2_qadata * qa = gfs2_qadata_get (dip );
887-
888- if (!qa ) {
889- error = - ENOMEM ;
890- goto out_gunlock ;
891- }
892-
893875 error = gfs2_quota_lock_check (dip );
894876 if (error )
895- goto out_alloc ;
877+ goto out_gunlock ;
896878
897879 error = gfs2_inplace_reserve (dip , sdp -> sd_max_dirres );
898880 if (error )
@@ -935,9 +917,6 @@ static int gfs2_link(struct dentry *old_dentry, struct inode *dir,
935917out_gunlock_q :
936918 if (alloc_required )
937919 gfs2_quota_unlock (dip );
938- out_alloc :
939- if (alloc_required )
940- gfs2_qadata_put (dip );
941920out_gunlock :
942921 gfs2_glock_dq (ghs + 1 );
943922out_child :
@@ -1374,16 +1353,9 @@ static int gfs2_rename(struct inode *odir, struct dentry *odentry,
13741353 goto out_gunlock ;
13751354
13761355 if (alloc_required ) {
1377- struct gfs2_qadata * qa = gfs2_qadata_get (ndip );
1378-
1379- if (!qa ) {
1380- error = - ENOMEM ;
1381- goto out_gunlock ;
1382- }
1383-
13841356 error = gfs2_quota_lock_check (ndip );
13851357 if (error )
1386- goto out_alloc ;
1358+ goto out_gunlock ;
13871359
13881360 error = gfs2_inplace_reserve (ndip , sdp -> sd_max_dirres );
13891361 if (error )
@@ -1444,9 +1416,6 @@ static int gfs2_rename(struct inode *odir, struct dentry *odentry,
14441416out_gunlock_q :
14451417 if (alloc_required )
14461418 gfs2_quota_unlock (ndip );
1447- out_alloc :
1448- if (alloc_required )
1449- gfs2_qadata_put (ndip );
14501419out_gunlock :
14511420 while (x -- ) {
14521421 gfs2_glock_dq (ghs + x );
@@ -1607,12 +1576,9 @@ static int setattr_chown(struct inode *inode, struct iattr *attr)
16071576 if (!(attr -> ia_valid & ATTR_GID ) || ogid == ngid )
16081577 ogid = ngid = NO_QUOTA_CHANGE ;
16091578
1610- if (!gfs2_qadata_get (ip ))
1611- return - ENOMEM ;
1612-
16131579 error = gfs2_quota_lock (ip , nuid , ngid );
16141580 if (error )
1615- goto out_alloc ;
1581+ return error ;
16161582
16171583 if (ouid != NO_QUOTA_CHANGE || ogid != NO_QUOTA_CHANGE ) {
16181584 error = gfs2_quota_check (ip , nuid , ngid );
@@ -1638,8 +1604,6 @@ static int setattr_chown(struct inode *inode, struct iattr *attr)
16381604 gfs2_trans_end (sdp );
16391605out_gunlock_q :
16401606 gfs2_quota_unlock (ip );
1641- out_alloc :
1642- gfs2_qadata_put (ip );
16431607 return error ;
16441608}
16451609
0 commit comments