Skip to content

Commit d50a64e

Browse files
author
Andreas Gruenbacher
committed
gfs2: Move gfs2_trans_add_databufs
Move gfs2_trans_add_databufs() to trans.c. Pass in a glock instead of a gfs2_inode. Signed-off-by: Andreas Gruenbacher <[email protected]>
1 parent 2f02273 commit d50a64e

File tree

5 files changed

+26
-25
lines changed

5 files changed

+26
-25
lines changed

fs/gfs2/aops.c

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -37,27 +37,6 @@
3737
#include "aops.h"
3838

3939

40-
void gfs2_trans_add_databufs(struct gfs2_inode *ip, struct folio *folio,
41-
size_t from, size_t len)
42-
{
43-
struct buffer_head *head = folio_buffers(folio);
44-
unsigned int bsize = head->b_size;
45-
struct buffer_head *bh;
46-
size_t to = from + len;
47-
size_t start, end;
48-
49-
for (bh = head, start = 0; bh != head || !start;
50-
bh = bh->b_this_page, start = end) {
51-
end = start + bsize;
52-
if (end <= from)
53-
continue;
54-
if (start >= to)
55-
break;
56-
set_buffer_uptodate(bh);
57-
gfs2_trans_add_data(ip->i_gl, bh);
58-
}
59-
}
60-
6140
/**
6241
* gfs2_get_block_noalloc - Fills in a buffer head with details about a block
6342
* @inode: The inode
@@ -133,7 +112,7 @@ static int __gfs2_jdata_write_folio(struct folio *folio,
133112
inode->i_sb->s_blocksize,
134113
BIT(BH_Dirty)|BIT(BH_Uptodate));
135114
}
136-
gfs2_trans_add_databufs(ip, folio, 0, folio_size(folio));
115+
gfs2_trans_add_databufs(ip->i_gl, folio, 0, folio_size(folio));
137116
}
138117
return gfs2_write_jdata_folio(folio, wbc);
139118
}

fs/gfs2/aops.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,5 @@
99
#include "incore.h"
1010

1111
void adjust_fs_space(struct inode *inode);
12-
void gfs2_trans_add_databufs(struct gfs2_inode *ip, struct folio *folio,
13-
size_t from, size_t len);
1412

1513
#endif /* __AOPS_DOT_H__ */

fs/gfs2/bmap.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -988,7 +988,8 @@ static void gfs2_iomap_put_folio(struct inode *inode, loff_t pos,
988988
struct gfs2_sbd *sdp = GFS2_SB(inode);
989989

990990
if (!gfs2_is_stuffed(ip))
991-
gfs2_trans_add_databufs(ip, folio, offset_in_folio(folio, pos),
991+
gfs2_trans_add_databufs(ip->i_gl, folio,
992+
offset_in_folio(folio, pos),
992993
copied);
993994

994995
folio_unlock(folio);

fs/gfs2/trans.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,27 @@ void gfs2_trans_add_data(struct gfs2_glock *gl, struct buffer_head *bh)
226226
unlock_buffer(bh);
227227
}
228228

229+
void gfs2_trans_add_databufs(struct gfs2_glock *gl, struct folio *folio,
230+
size_t from, size_t len)
231+
{
232+
struct buffer_head *head = folio_buffers(folio);
233+
unsigned int bsize = head->b_size;
234+
struct buffer_head *bh;
235+
size_t to = from + len;
236+
size_t start, end;
237+
238+
for (bh = head, start = 0; bh != head || !start;
239+
bh = bh->b_this_page, start = end) {
240+
end = start + bsize;
241+
if (end <= from)
242+
continue;
243+
if (start >= to)
244+
break;
245+
set_buffer_uptodate(bh);
246+
gfs2_trans_add_data(gl, bh);
247+
}
248+
}
249+
229250
void gfs2_trans_add_meta(struct gfs2_glock *gl, struct buffer_head *bh)
230251
{
231252

fs/gfs2/trans.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ int gfs2_trans_begin(struct gfs2_sbd *sdp, unsigned int blocks,
4242

4343
void gfs2_trans_end(struct gfs2_sbd *sdp);
4444
void gfs2_trans_add_data(struct gfs2_glock *gl, struct buffer_head *bh);
45+
void gfs2_trans_add_databufs(struct gfs2_glock *gl, struct folio *folio,
46+
size_t from, size_t len);
4547
void gfs2_trans_add_meta(struct gfs2_glock *gl, struct buffer_head *bh);
4648
void gfs2_trans_add_revoke(struct gfs2_sbd *sdp, struct gfs2_bufdata *bd);
4749
void gfs2_trans_remove_revoke(struct gfs2_sbd *sdp, u64 blkno, unsigned int len);

0 commit comments

Comments
 (0)