aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/eattr.c
diff options
context:
space:
mode:
authorSteven Whitehouse <steve@chygwyn.com>2006-01-18 06:19:28 -0500
committerSteven Whitehouse <steve@chygwyn.com>2006-01-18 06:19:28 -0500
commitd4e9c4c3bf861ef2ac96e0de659c75a00da92b28 (patch)
tree925ececc725ad5180b9253f732b50c51bfa0754d /fs/gfs2/eattr.c
parentb96ca4fa4e3b510d528a093a5bac0befbc2ba46d (diff)
[GFS2] Add an additional argument to gfs2_trans_add_bh()
This adds an extra argument to gfs2_trans_add_bh() to indicate whether the bh being added to the transaction is metadata or data. Its currently unused since all existing callers set it to 1 (metadata) but following patches will make use of it. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/eattr.c')
-rw-r--r--fs/gfs2/eattr.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/fs/gfs2/eattr.c b/fs/gfs2/eattr.c
index dec55dcb9dbc..02e45c4ecbec 100644
--- a/fs/gfs2/eattr.c
+++ b/fs/gfs2/eattr.c
@@ -268,7 +268,7 @@ static int ea_dealloc_unstuffed(struct gfs2_inode *ip, struct buffer_head *bh,
268 if (error) 268 if (error)
269 goto out_gunlock; 269 goto out_gunlock;
270 270
271 gfs2_trans_add_bh(ip->i_gl, bh); 271 gfs2_trans_add_bh(ip->i_gl, bh, 1);
272 272
273 dataptrs = GFS2_EA2DATAPTRS(ea); 273 dataptrs = GFS2_EA2DATAPTRS(ea);
274 for (x = 0; x < ea->ea_num_ptrs; x++, dataptrs++) { 274 for (x = 0; x < ea->ea_num_ptrs; x++, dataptrs++) {
@@ -309,7 +309,7 @@ static int ea_dealloc_unstuffed(struct gfs2_inode *ip, struct buffer_head *bh,
309 error = gfs2_meta_inode_buffer(ip, &dibh); 309 error = gfs2_meta_inode_buffer(ip, &dibh);
310 if (!error) { 310 if (!error) {
311 ip->i_di.di_ctime = get_seconds(); 311 ip->i_di.di_ctime = get_seconds();
312 gfs2_trans_add_bh(ip->i_gl, dibh); 312 gfs2_trans_add_bh(ip->i_gl, dibh, 1);
313 gfs2_dinode_out(&ip->i_di, dibh->b_data); 313 gfs2_dinode_out(&ip->i_di, dibh->b_data);
314 brelse(dibh); 314 brelse(dibh);
315 } 315 }
@@ -628,7 +628,7 @@ static int ea_alloc_blk(struct gfs2_inode *ip, struct buffer_head **bhp)
628 block = gfs2_alloc_meta(ip); 628 block = gfs2_alloc_meta(ip);
629 629
630 *bhp = gfs2_meta_new(ip->i_gl, block); 630 *bhp = gfs2_meta_new(ip->i_gl, block);
631 gfs2_trans_add_bh(ip->i_gl, *bhp); 631 gfs2_trans_add_bh(ip->i_gl, *bhp, 1);
632 gfs2_metatype_set(*bhp, GFS2_METATYPE_EA, GFS2_FORMAT_EA); 632 gfs2_metatype_set(*bhp, GFS2_METATYPE_EA, GFS2_FORMAT_EA);
633 gfs2_buffer_clear_tail(*bhp, sizeof(struct gfs2_meta_header)); 633 gfs2_buffer_clear_tail(*bhp, sizeof(struct gfs2_meta_header));
634 634
@@ -686,7 +686,7 @@ static int ea_write(struct gfs2_inode *ip, struct gfs2_ea_header *ea,
686 block = gfs2_alloc_meta(ip); 686 block = gfs2_alloc_meta(ip);
687 687
688 bh = gfs2_meta_new(ip->i_gl, block); 688 bh = gfs2_meta_new(ip->i_gl, block);
689 gfs2_trans_add_bh(ip->i_gl, bh); 689 gfs2_trans_add_bh(ip->i_gl, bh, 1);
690 gfs2_metatype_set(bh, GFS2_METATYPE_ED, GFS2_FORMAT_ED); 690 gfs2_metatype_set(bh, GFS2_METATYPE_ED, GFS2_FORMAT_ED);
691 691
692 ip->i_di.di_blocks++; 692 ip->i_di.di_blocks++;
@@ -759,7 +759,7 @@ static int ea_alloc_skeleton(struct gfs2_inode *ip, struct gfs2_ea_request *er,
759 ip->i_di.di_mode = er->er_mode; 759 ip->i_di.di_mode = er->er_mode;
760 } 760 }
761 ip->i_di.di_ctime = get_seconds(); 761 ip->i_di.di_ctime = get_seconds();
762 gfs2_trans_add_bh(ip->i_gl, dibh); 762 gfs2_trans_add_bh(ip->i_gl, dibh, 1);
763 gfs2_dinode_out(&ip->i_di, dibh->b_data); 763 gfs2_dinode_out(&ip->i_di, dibh->b_data);
764 brelse(dibh); 764 brelse(dibh);
765 } 765 }
@@ -839,7 +839,7 @@ static void ea_set_remove_stuffed(struct gfs2_inode *ip,
839 struct gfs2_ea_header *prev = el->el_prev; 839 struct gfs2_ea_header *prev = el->el_prev;
840 uint32_t len; 840 uint32_t len;
841 841
842 gfs2_trans_add_bh(ip->i_gl, el->el_bh); 842 gfs2_trans_add_bh(ip->i_gl, el->el_bh, 1);
843 843
844 if (!prev || !GFS2_EA_IS_STUFFED(ea)) { 844 if (!prev || !GFS2_EA_IS_STUFFED(ea)) {
845 ea->ea_type = GFS2_EATYPE_UNUSED; 845 ea->ea_type = GFS2_EATYPE_UNUSED;
@@ -877,7 +877,7 @@ static int ea_set_simple_noalloc(struct gfs2_inode *ip, struct buffer_head *bh,
877 if (error) 877 if (error)
878 return error; 878 return error;
879 879
880 gfs2_trans_add_bh(ip->i_gl, bh); 880 gfs2_trans_add_bh(ip->i_gl, bh, 1);
881 881
882 if (es->ea_split) 882 if (es->ea_split)
883 ea = ea_split_ea(ea); 883 ea = ea_split_ea(ea);
@@ -897,7 +897,7 @@ static int ea_set_simple_noalloc(struct gfs2_inode *ip, struct buffer_head *bh,
897 ip->i_di.di_mode = er->er_mode; 897 ip->i_di.di_mode = er->er_mode;
898 } 898 }
899 ip->i_di.di_ctime = get_seconds(); 899 ip->i_di.di_ctime = get_seconds();
900 gfs2_trans_add_bh(ip->i_gl, dibh); 900 gfs2_trans_add_bh(ip->i_gl, dibh, 1);
901 gfs2_dinode_out(&ip->i_di, dibh->b_data); 901 gfs2_dinode_out(&ip->i_di, dibh->b_data);
902 brelse(dibh); 902 brelse(dibh);
903 out: 903 out:
@@ -913,7 +913,7 @@ static int ea_set_simple_alloc(struct gfs2_inode *ip,
913 struct gfs2_ea_header *ea = es->es_ea; 913 struct gfs2_ea_header *ea = es->es_ea;
914 int error; 914 int error;
915 915
916 gfs2_trans_add_bh(ip->i_gl, es->es_bh); 916 gfs2_trans_add_bh(ip->i_gl, es->es_bh, 1);
917 917
918 if (es->ea_split) 918 if (es->ea_split)
919 ea = ea_split_ea(ea); 919 ea = ea_split_ea(ea);
@@ -1007,14 +1007,14 @@ static int ea_set_block(struct gfs2_inode *ip, struct gfs2_ea_request *er,
1007 goto out; 1007 goto out;
1008 } 1008 }
1009 1009
1010 gfs2_trans_add_bh(ip->i_gl, indbh); 1010 gfs2_trans_add_bh(ip->i_gl, indbh, 1);
1011 } else { 1011 } else {
1012 uint64_t blk; 1012 uint64_t blk;
1013 1013
1014 blk = gfs2_alloc_meta(ip); 1014 blk = gfs2_alloc_meta(ip);
1015 1015
1016 indbh = gfs2_meta_new(ip->i_gl, blk); 1016 indbh = gfs2_meta_new(ip->i_gl, blk);
1017 gfs2_trans_add_bh(ip->i_gl, indbh); 1017 gfs2_trans_add_bh(ip->i_gl, indbh, 1);
1018 gfs2_metatype_set(indbh, GFS2_METATYPE_IN, GFS2_FORMAT_IN); 1018 gfs2_metatype_set(indbh, GFS2_METATYPE_IN, GFS2_FORMAT_IN);
1019 gfs2_buffer_clear_tail(indbh, mh_size); 1019 gfs2_buffer_clear_tail(indbh, mh_size);
1020 1020
@@ -1163,7 +1163,7 @@ static int ea_remove_stuffed(struct gfs2_inode *ip, struct gfs2_ea_location *el)
1163 if (error) 1163 if (error)
1164 return error; 1164 return error;
1165 1165
1166 gfs2_trans_add_bh(ip->i_gl, el->el_bh); 1166 gfs2_trans_add_bh(ip->i_gl, el->el_bh, 1);
1167 1167
1168 if (prev) { 1168 if (prev) {
1169 uint32_t len; 1169 uint32_t len;
@@ -1179,7 +1179,7 @@ static int ea_remove_stuffed(struct gfs2_inode *ip, struct gfs2_ea_location *el)
1179 error = gfs2_meta_inode_buffer(ip, &dibh); 1179 error = gfs2_meta_inode_buffer(ip, &dibh);
1180 if (!error) { 1180 if (!error) {
1181 ip->i_di.di_ctime = get_seconds(); 1181 ip->i_di.di_ctime = get_seconds();
1182 gfs2_trans_add_bh(ip->i_gl, dibh); 1182 gfs2_trans_add_bh(ip->i_gl, dibh, 1);
1183 gfs2_dinode_out(&ip->i_di, dibh->b_data); 1183 gfs2_dinode_out(&ip->i_di, dibh->b_data);
1184 brelse(dibh); 1184 brelse(dibh);
1185 } 1185 }
@@ -1288,7 +1288,7 @@ static int ea_acl_chmod_unstuffed(struct gfs2_inode *ip,
1288 goto fail; 1288 goto fail;
1289 } 1289 }
1290 1290
1291 gfs2_trans_add_bh(ip->i_gl, bh[x]); 1291 gfs2_trans_add_bh(ip->i_gl, bh[x], 1);
1292 1292
1293 memcpy(bh[x]->b_data + sizeof(struct gfs2_meta_header), 1293 memcpy(bh[x]->b_data + sizeof(struct gfs2_meta_header),
1294 data, 1294 data,
@@ -1323,7 +1323,7 @@ int gfs2_ea_acl_chmod(struct gfs2_inode *ip, struct gfs2_ea_location *el,
1323 if (error) 1323 if (error)
1324 return error; 1324 return error;
1325 1325
1326 gfs2_trans_add_bh(ip->i_gl, el->el_bh); 1326 gfs2_trans_add_bh(ip->i_gl, el->el_bh, 1);
1327 memcpy(GFS2_EA2DATA(el->el_ea), 1327 memcpy(GFS2_EA2DATA(el->el_ea),
1328 data, 1328 data,
1329 GFS2_EA_DATA_LEN(el->el_ea)); 1329 GFS2_EA_DATA_LEN(el->el_ea));
@@ -1338,7 +1338,7 @@ int gfs2_ea_acl_chmod(struct gfs2_inode *ip, struct gfs2_ea_location *el,
1338 error = inode_setattr(ip->i_vnode, attr); 1338 error = inode_setattr(ip->i_vnode, attr);
1339 gfs2_assert_warn(ip->i_sbd, !error); 1339 gfs2_assert_warn(ip->i_sbd, !error);
1340 gfs2_inode_attr_out(ip); 1340 gfs2_inode_attr_out(ip);
1341 gfs2_trans_add_bh(ip->i_gl, dibh); 1341 gfs2_trans_add_bh(ip->i_gl, dibh, 1);
1342 gfs2_dinode_out(&ip->i_di, dibh->b_data); 1342 gfs2_dinode_out(&ip->i_di, dibh->b_data);
1343 brelse(dibh); 1343 brelse(dibh);
1344 } 1344 }
@@ -1416,7 +1416,7 @@ static int ea_dealloc_indirect(struct gfs2_inode *ip)
1416 if (error) 1416 if (error)
1417 goto out_gunlock; 1417 goto out_gunlock;
1418 1418
1419 gfs2_trans_add_bh(ip->i_gl, indbh); 1419 gfs2_trans_add_bh(ip->i_gl, indbh, 1);
1420 1420
1421 eablk = (uint64_t *)(indbh->b_data + sizeof(struct gfs2_meta_header)); 1421 eablk = (uint64_t *)(indbh->b_data + sizeof(struct gfs2_meta_header));
1422 bstart = 0; 1422 bstart = 0;
@@ -1450,7 +1450,7 @@ static int ea_dealloc_indirect(struct gfs2_inode *ip)
1450 1450
1451 error = gfs2_meta_inode_buffer(ip, &dibh); 1451 error = gfs2_meta_inode_buffer(ip, &dibh);
1452 if (!error) { 1452 if (!error) {
1453 gfs2_trans_add_bh(ip->i_gl, dibh); 1453 gfs2_trans_add_bh(ip->i_gl, dibh, 1);
1454 gfs2_dinode_out(&ip->i_di, dibh->b_data); 1454 gfs2_dinode_out(&ip->i_di, dibh->b_data);
1455 brelse(dibh); 1455 brelse(dibh);
1456 } 1456 }
@@ -1502,7 +1502,7 @@ static int ea_dealloc_block(struct gfs2_inode *ip)
1502 1502
1503 error = gfs2_meta_inode_buffer(ip, &dibh); 1503 error = gfs2_meta_inode_buffer(ip, &dibh);
1504 if (!error) { 1504 if (!error) {
1505 gfs2_trans_add_bh(ip->i_gl, dibh); 1505 gfs2_trans_add_bh(ip->i_gl, dibh, 1);
1506 gfs2_dinode_out(&ip->i_di, dibh->b_data); 1506 gfs2_dinode_out(&ip->i_di, dibh->b_data);
1507 brelse(dibh); 1507 brelse(dibh);
1508 } 1508 }