diff options
author | Steven Whitehouse <steve@chygwyn.com> | 2006-01-18 06:19:28 -0500 |
---|---|---|
committer | Steven Whitehouse <steve@chygwyn.com> | 2006-01-18 06:19:28 -0500 |
commit | d4e9c4c3bf861ef2ac96e0de659c75a00da92b28 (patch) | |
tree | 925ececc725ad5180b9253f732b50c51bfa0754d /fs/gfs2/dir.c | |
parent | b96ca4fa4e3b510d528a093a5bac0befbc2ba46d (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/dir.c')
-rw-r--r-- | fs/gfs2/dir.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/fs/gfs2/dir.c b/fs/gfs2/dir.c index f6304e55dbc1..93d3704ac58c 100644 --- a/fs/gfs2/dir.c +++ b/fs/gfs2/dir.c | |||
@@ -201,7 +201,7 @@ static void dirent_del(struct gfs2_inode *dip, struct buffer_head *bh, | |||
201 | return; | 201 | return; |
202 | } | 202 | } |
203 | 203 | ||
204 | gfs2_trans_add_bh(dip->i_gl, bh); | 204 | gfs2_trans_add_bh(dip->i_gl, bh, 1); |
205 | 205 | ||
206 | /* If there is no prev entry, this is the first entry in the block. | 206 | /* If there is no prev entry, this is the first entry in the block. |
207 | The de_rec_len is already as big as it needs to be. Just zero | 207 | The de_rec_len is already as big as it needs to be. Just zero |
@@ -264,7 +264,7 @@ int gfs2_dirent_alloc(struct gfs2_inode *dip, struct buffer_head *bh, | |||
264 | return -EIO; | 264 | return -EIO; |
265 | } | 265 | } |
266 | 266 | ||
267 | gfs2_trans_add_bh(dip->i_gl, bh); | 267 | gfs2_trans_add_bh(dip->i_gl, bh, 1); |
268 | 268 | ||
269 | dent->de_rec_len = bh->b_size - offset; | 269 | dent->de_rec_len = bh->b_size - offset; |
270 | dent->de_rec_len = cpu_to_be32(dent->de_rec_len); | 270 | dent->de_rec_len = cpu_to_be32(dent->de_rec_len); |
@@ -282,7 +282,7 @@ int gfs2_dirent_alloc(struct gfs2_inode *dip, struct buffer_head *bh, | |||
282 | 282 | ||
283 | if ((!dent->de_inum.no_addr && cur_rec_len >= rec_len) || | 283 | if ((!dent->de_inum.no_addr && cur_rec_len >= rec_len) || |
284 | (cur_rec_len >= GFS2_DIRENT_SIZE(cur_name_len) + rec_len)) { | 284 | (cur_rec_len >= GFS2_DIRENT_SIZE(cur_name_len) + rec_len)) { |
285 | gfs2_trans_add_bh(dip->i_gl, bh); | 285 | gfs2_trans_add_bh(dip->i_gl, bh, 1); |
286 | 286 | ||
287 | if (dent->de_inum.no_addr) { | 287 | if (dent->de_inum.no_addr) { |
288 | new = (struct gfs2_dirent *)((char *)dent + | 288 | new = (struct gfs2_dirent *)((char *)dent + |
@@ -552,7 +552,7 @@ static int dir_make_exhash(struct gfs2_inode *dip) | |||
552 | /* Turn over a new leaf */ | 552 | /* Turn over a new leaf */ |
553 | 553 | ||
554 | bh = gfs2_meta_new(dip->i_gl, bn); | 554 | bh = gfs2_meta_new(dip->i_gl, bn); |
555 | gfs2_trans_add_bh(dip->i_gl, bh); | 555 | gfs2_trans_add_bh(dip->i_gl, bh, 1); |
556 | gfs2_metatype_set(bh, GFS2_METATYPE_LF, GFS2_FORMAT_LF); | 556 | gfs2_metatype_set(bh, GFS2_METATYPE_LF, GFS2_FORMAT_LF); |
557 | gfs2_buffer_clear_tail(bh, sizeof(struct gfs2_meta_header)); | 557 | gfs2_buffer_clear_tail(bh, sizeof(struct gfs2_meta_header)); |
558 | 558 | ||
@@ -596,7 +596,7 @@ static int dir_make_exhash(struct gfs2_inode *dip) | |||
596 | /* We're done with the new leaf block, now setup the new | 596 | /* We're done with the new leaf block, now setup the new |
597 | hash table. */ | 597 | hash table. */ |
598 | 598 | ||
599 | gfs2_trans_add_bh(dip->i_gl, dibh); | 599 | gfs2_trans_add_bh(dip->i_gl, dibh, 1); |
600 | gfs2_buffer_clear_tail(dibh, sizeof(struct gfs2_dinode)); | 600 | gfs2_buffer_clear_tail(dibh, sizeof(struct gfs2_dinode)); |
601 | 601 | ||
602 | lp = (uint64_t *)(dibh->b_data + sizeof(struct gfs2_dinode)); | 602 | lp = (uint64_t *)(dibh->b_data + sizeof(struct gfs2_dinode)); |
@@ -647,7 +647,7 @@ static int dir_split_leaf(struct gfs2_inode *dip, uint32_t index, | |||
647 | /* Get the new leaf block */ | 647 | /* Get the new leaf block */ |
648 | 648 | ||
649 | nbh = gfs2_meta_new(dip->i_gl, bn); | 649 | nbh = gfs2_meta_new(dip->i_gl, bn); |
650 | gfs2_trans_add_bh(dip->i_gl, nbh); | 650 | gfs2_trans_add_bh(dip->i_gl, nbh, 1); |
651 | gfs2_metatype_set(nbh, GFS2_METATYPE_LF, GFS2_FORMAT_LF); | 651 | gfs2_metatype_set(nbh, GFS2_METATYPE_LF, GFS2_FORMAT_LF); |
652 | gfs2_buffer_clear_tail(nbh, sizeof(struct gfs2_meta_header)); | 652 | gfs2_buffer_clear_tail(nbh, sizeof(struct gfs2_meta_header)); |
653 | 653 | ||
@@ -661,7 +661,7 @@ static int dir_split_leaf(struct gfs2_inode *dip, uint32_t index, | |||
661 | if (error) | 661 | if (error) |
662 | goto fail; | 662 | goto fail; |
663 | 663 | ||
664 | gfs2_trans_add_bh(dip->i_gl, obh); | 664 | gfs2_trans_add_bh(dip->i_gl, obh, 1); |
665 | 665 | ||
666 | oleaf = (struct gfs2_leaf *)obh->b_data; | 666 | oleaf = (struct gfs2_leaf *)obh->b_data; |
667 | 667 | ||
@@ -1285,14 +1285,14 @@ static int dir_e_add(struct gfs2_inode *dip, struct qstr *filename, | |||
1285 | bn = gfs2_alloc_meta(dip); | 1285 | bn = gfs2_alloc_meta(dip); |
1286 | 1286 | ||
1287 | nbh = gfs2_meta_new(dip->i_gl, bn); | 1287 | nbh = gfs2_meta_new(dip->i_gl, bn); |
1288 | gfs2_trans_add_bh(dip->i_gl, nbh); | 1288 | gfs2_trans_add_bh(dip->i_gl, nbh, 1); |
1289 | gfs2_metatype_set(nbh, | 1289 | gfs2_metatype_set(nbh, |
1290 | GFS2_METATYPE_LF, | 1290 | GFS2_METATYPE_LF, |
1291 | GFS2_FORMAT_LF); | 1291 | GFS2_FORMAT_LF); |
1292 | gfs2_buffer_clear_tail(nbh, | 1292 | gfs2_buffer_clear_tail(nbh, |
1293 | sizeof(struct gfs2_meta_header)); | 1293 | sizeof(struct gfs2_meta_header)); |
1294 | 1294 | ||
1295 | gfs2_trans_add_bh(dip->i_gl, bh); | 1295 | gfs2_trans_add_bh(dip->i_gl, bh, 1); |
1296 | leaf->lf_next = cpu_to_be64(bn); | 1296 | leaf->lf_next = cpu_to_be64(bn); |
1297 | 1297 | ||
1298 | nleaf = (struct gfs2_leaf *)nbh->b_data; | 1298 | nleaf = (struct gfs2_leaf *)nbh->b_data; |
@@ -1330,7 +1330,7 @@ static int dir_e_add(struct gfs2_inode *dip, struct qstr *filename, | |||
1330 | dip->i_di.di_entries++; | 1330 | dip->i_di.di_entries++; |
1331 | dip->i_di.di_mtime = dip->i_di.di_ctime = get_seconds(); | 1331 | dip->i_di.di_mtime = dip->i_di.di_ctime = get_seconds(); |
1332 | 1332 | ||
1333 | gfs2_trans_add_bh(dip->i_gl, dibh); | 1333 | gfs2_trans_add_bh(dip->i_gl, dibh, 1); |
1334 | gfs2_dinode_out(&dip->i_di, dibh->b_data); | 1334 | gfs2_dinode_out(&dip->i_di, dibh->b_data); |
1335 | brelse(dibh); | 1335 | brelse(dibh); |
1336 | 1336 | ||
@@ -1376,7 +1376,7 @@ static int dir_e_del(struct gfs2_inode *dip, struct qstr *filename) | |||
1376 | dip->i_di.di_entries--; | 1376 | dip->i_di.di_entries--; |
1377 | dip->i_di.di_mtime = dip->i_di.di_ctime = get_seconds(); | 1377 | dip->i_di.di_mtime = dip->i_di.di_ctime = get_seconds(); |
1378 | 1378 | ||
1379 | gfs2_trans_add_bh(dip->i_gl, dibh); | 1379 | gfs2_trans_add_bh(dip->i_gl, dibh, 1); |
1380 | gfs2_dinode_out(&dip->i_di, dibh->b_data); | 1380 | gfs2_dinode_out(&dip->i_di, dibh->b_data); |
1381 | brelse(dibh); | 1381 | brelse(dibh); |
1382 | 1382 | ||
@@ -1481,7 +1481,7 @@ static int dir_e_mvino(struct gfs2_inode *dip, struct qstr *filename, | |||
1481 | if (error) | 1481 | if (error) |
1482 | return error; | 1482 | return error; |
1483 | 1483 | ||
1484 | gfs2_trans_add_bh(dip->i_gl, bh); | 1484 | gfs2_trans_add_bh(dip->i_gl, bh, 1); |
1485 | 1485 | ||
1486 | gfs2_inum_out(inum, (char *)&dent->de_inum); | 1486 | gfs2_inum_out(inum, (char *)&dent->de_inum); |
1487 | dent->de_type = new_type; | 1487 | dent->de_type = new_type; |
@@ -1494,7 +1494,7 @@ static int dir_e_mvino(struct gfs2_inode *dip, struct qstr *filename, | |||
1494 | 1494 | ||
1495 | dip->i_di.di_mtime = dip->i_di.di_ctime = get_seconds(); | 1495 | dip->i_di.di_mtime = dip->i_di.di_ctime = get_seconds(); |
1496 | 1496 | ||
1497 | gfs2_trans_add_bh(dip->i_gl, dibh); | 1497 | gfs2_trans_add_bh(dip->i_gl, dibh, 1); |
1498 | gfs2_dinode_out(&dip->i_di, dibh->b_data); | 1498 | gfs2_dinode_out(&dip->i_di, dibh->b_data); |
1499 | brelse(dibh); | 1499 | brelse(dibh); |
1500 | 1500 | ||
@@ -1681,7 +1681,7 @@ static int dir_l_mvino(struct gfs2_inode *dip, struct qstr *filename, | |||
1681 | if (error) | 1681 | if (error) |
1682 | goto out; | 1682 | goto out; |
1683 | 1683 | ||
1684 | gfs2_trans_add_bh(dip->i_gl, dibh); | 1684 | gfs2_trans_add_bh(dip->i_gl, dibh, 1); |
1685 | 1685 | ||
1686 | gfs2_inum_out(inum, (char *)&dent->de_inum); | 1686 | gfs2_inum_out(inum, (char *)&dent->de_inum); |
1687 | dent->de_type = new_type; | 1687 | dent->de_type = new_type; |
@@ -1976,7 +1976,7 @@ static int leaf_dealloc(struct gfs2_inode *dip, uint32_t index, uint32_t len, | |||
1976 | if (error) | 1976 | if (error) |
1977 | goto out_end_trans; | 1977 | goto out_end_trans; |
1978 | 1978 | ||
1979 | gfs2_trans_add_bh(dip->i_gl, dibh); | 1979 | gfs2_trans_add_bh(dip->i_gl, dibh, 1); |
1980 | gfs2_dinode_out(&dip->i_di, dibh->b_data); | 1980 | gfs2_dinode_out(&dip->i_di, dibh->b_data); |
1981 | brelse(dibh); | 1981 | brelse(dibh); |
1982 | 1982 | ||
@@ -2030,7 +2030,7 @@ int gfs2_dir_exhash_dealloc(struct gfs2_inode *dip) | |||
2030 | 2030 | ||
2031 | error = gfs2_meta_inode_buffer(dip, &bh); | 2031 | error = gfs2_meta_inode_buffer(dip, &bh); |
2032 | if (!error) { | 2032 | if (!error) { |
2033 | gfs2_trans_add_bh(dip->i_gl, bh); | 2033 | gfs2_trans_add_bh(dip->i_gl, bh, 1); |
2034 | ((struct gfs2_dinode *)bh->b_data)->di_mode = cpu_to_be32(S_IFREG); | 2034 | ((struct gfs2_dinode *)bh->b_data)->di_mode = cpu_to_be32(S_IFREG); |
2035 | brelse(bh); | 2035 | brelse(bh); |
2036 | } | 2036 | } |