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

xfs: merge xfs_rud_init into xfs_trans_get_rud

There is no good reason to keep these two functions separate.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

authored by

Christoph Hellwig and committed by
Darrick J. Wong
60883447 ebeb8e06

+6 -22
+6 -8
fs/xfs/xfs_rmap_item.c
··· 238 238 .iop_release = xfs_rud_item_release, 239 239 }; 240 240 241 - /* 242 - * Allocate and initialize an rud item with the given number of extents. 243 - */ 244 241 struct xfs_rud_log_item * 245 - xfs_rud_init( 246 - struct xfs_mount *mp, 242 + xfs_trans_get_rud( 243 + struct xfs_trans *tp, 247 244 struct xfs_rui_log_item *ruip) 248 - 249 245 { 250 - struct xfs_rud_log_item *rudp; 246 + struct xfs_rud_log_item *rudp; 251 247 252 248 rudp = kmem_zone_zalloc(xfs_rud_zone, KM_SLEEP); 253 - xfs_log_item_init(mp, &rudp->rud_item, XFS_LI_RUD, &xfs_rud_item_ops); 249 + xfs_log_item_init(tp->t_mountp, &rudp->rud_item, XFS_LI_RUD, 250 + &xfs_rud_item_ops); 254 251 rudp->rud_ruip = ruip; 255 252 rudp->rud_format.rud_rui_id = ruip->rui_format.rui_id; 256 253 254 + xfs_trans_add_item(tp, &rudp->rud_item); 257 255 return rudp; 258 256 } 259 257
-2
fs/xfs/xfs_rmap_item.h
··· 78 78 extern struct kmem_zone *xfs_rud_zone; 79 79 80 80 struct xfs_rui_log_item *xfs_rui_init(struct xfs_mount *, uint); 81 - struct xfs_rud_log_item *xfs_rud_init(struct xfs_mount *, 82 - struct xfs_rui_log_item *); 83 81 int xfs_rui_copy_format(struct xfs_log_iovec *buf, 84 82 struct xfs_rui_log_format *dst_rui_fmt); 85 83 void xfs_rui_item_free(struct xfs_rui_log_item *);
-12
fs/xfs/xfs_trans_rmap.c
··· 60 60 } 61 61 } 62 62 63 - struct xfs_rud_log_item * 64 - xfs_trans_get_rud( 65 - struct xfs_trans *tp, 66 - struct xfs_rui_log_item *ruip) 67 - { 68 - struct xfs_rud_log_item *rudp; 69 - 70 - rudp = xfs_rud_init(tp->t_mountp, ruip); 71 - xfs_trans_add_item(tp, &rudp->rud_item); 72 - return rudp; 73 - } 74 - 75 63 /* 76 64 * Finish an rmap update and log it to the RUD. Note that the transaction is 77 65 * marked dirty regardless of whether the rmap update succeeds or fails to