Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <agruenba@redhat.com>

+26 -25
+1 -22
fs/gfs2/aops.c
··· 37 37 #include "aops.h" 38 38 39 39 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 - 61 40 /** 62 41 * gfs2_get_block_noalloc - Fills in a buffer head with details about a block 63 42 * @inode: The inode ··· 112 133 inode->i_sb->s_blocksize, 113 134 BIT(BH_Dirty)|BIT(BH_Uptodate)); 114 135 } 115 - gfs2_trans_add_databufs(ip, folio, 0, folio_size(folio)); 136 + gfs2_trans_add_databufs(ip->i_gl, folio, 0, folio_size(folio)); 116 137 } 117 138 return gfs2_write_jdata_folio(folio, wbc); 118 139 }
-2
fs/gfs2/aops.h
··· 9 9 #include "incore.h" 10 10 11 11 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); 14 12 15 13 #endif /* __AOPS_DOT_H__ */
+2 -1
fs/gfs2/bmap.c
··· 988 988 struct gfs2_sbd *sdp = GFS2_SB(inode); 989 989 990 990 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), 992 993 copied); 993 994 994 995 folio_unlock(folio);
+21
fs/gfs2/trans.c
··· 226 226 unlock_buffer(bh); 227 227 } 228 228 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 + 229 250 void gfs2_trans_add_meta(struct gfs2_glock *gl, struct buffer_head *bh) 230 251 { 231 252
+2
fs/gfs2/trans.h
··· 42 42 43 43 void gfs2_trans_end(struct gfs2_sbd *sdp); 44 44 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); 45 47 void gfs2_trans_add_meta(struct gfs2_glock *gl, struct buffer_head *bh); 46 48 void gfs2_trans_add_revoke(struct gfs2_sbd *sdp, struct gfs2_bufdata *bd); 47 49 void gfs2_trans_remove_revoke(struct gfs2_sbd *sdp, u64 blkno, unsigned int len);