aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2017-01-09 10:38:42 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-01-12 05:39:41 -0500
commitcf4fb510473b4529a0969b1d0af898b7a844bc36 (patch)
tree985501dd9d9d76d7bafa561cd64537dd24139c58 /fs
parent3903257660338c41c22a2464407c8ff93c42e00b (diff)
xfs: remove prev argument to xfs_bmapi_reserve_delalloc
commit 65c5f419788d623a0410eca1866134f5e4628594 upstream. We can easily lookup the previous extent for the cases where we need it, which saves the callers from looking it up for us later in the series. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Brian Foster <bfoster@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com> Cc: Christoph Hellwig <hch@lst.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/xfs/libxfs/xfs_bmap.c8
-rw-r--r--fs/xfs/libxfs/xfs_bmap.h3
-rw-r--r--fs/xfs/xfs_iomap.c3
-rw-r--r--fs/xfs/xfs_reflink.c2
4 files changed, 9 insertions, 7 deletions
diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
index 00188f559c8d..09b5d4f07636 100644
--- a/fs/xfs/libxfs/xfs_bmap.c
+++ b/fs/xfs/libxfs/xfs_bmap.c
@@ -4250,7 +4250,6 @@ xfs_bmapi_reserve_delalloc(
4250 xfs_fileoff_t aoff, 4250 xfs_fileoff_t aoff,
4251 xfs_filblks_t len, 4251 xfs_filblks_t len,
4252 struct xfs_bmbt_irec *got, 4252 struct xfs_bmbt_irec *got,
4253 struct xfs_bmbt_irec *prev,
4254 xfs_extnum_t *lastx, 4253 xfs_extnum_t *lastx,
4255 int eof) 4254 int eof)
4256{ 4255{
@@ -4272,7 +4271,12 @@ xfs_bmapi_reserve_delalloc(
4272 else 4271 else
4273 extsz = xfs_get_extsz_hint(ip); 4272 extsz = xfs_get_extsz_hint(ip);
4274 if (extsz) { 4273 if (extsz) {
4275 error = xfs_bmap_extsize_align(mp, got, prev, extsz, rt, eof, 4274 struct xfs_bmbt_irec prev;
4275
4276 if (!xfs_iext_get_extent(ifp, *lastx - 1, &prev))
4277 prev.br_startoff = NULLFILEOFF;
4278
4279 error = xfs_bmap_extsize_align(mp, got, &prev, extsz, rt, eof,
4276 1, 0, &aoff, &alen); 4280 1, 0, &aoff, &alen);
4277 ASSERT(!error); 4281 ASSERT(!error);
4278 } 4282 }
diff --git a/fs/xfs/libxfs/xfs_bmap.h b/fs/xfs/libxfs/xfs_bmap.h
index 7cae6ec27fa6..e3c2b5adf505 100644
--- a/fs/xfs/libxfs/xfs_bmap.h
+++ b/fs/xfs/libxfs/xfs_bmap.h
@@ -243,8 +243,7 @@ struct xfs_bmbt_rec_host *
243 struct xfs_bmbt_irec *gotp, struct xfs_bmbt_irec *prevp); 243 struct xfs_bmbt_irec *gotp, struct xfs_bmbt_irec *prevp);
244int xfs_bmapi_reserve_delalloc(struct xfs_inode *ip, int whichfork, 244int xfs_bmapi_reserve_delalloc(struct xfs_inode *ip, int whichfork,
245 xfs_fileoff_t aoff, xfs_filblks_t len, 245 xfs_fileoff_t aoff, xfs_filblks_t len,
246 struct xfs_bmbt_irec *got, struct xfs_bmbt_irec *prev, 246 struct xfs_bmbt_irec *got, xfs_extnum_t *lastx, int eof);
247 xfs_extnum_t *lastx, int eof);
248 247
249enum xfs_bmap_intent_type { 248enum xfs_bmap_intent_type {
250 XFS_BMAP_MAP = 1, 249 XFS_BMAP_MAP = 1,
diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c
index 436e109bb01e..59ffcac8a47d 100644
--- a/fs/xfs/xfs_iomap.c
+++ b/fs/xfs/xfs_iomap.c
@@ -622,8 +622,7 @@ xfs_file_iomap_begin_delay(
622 622
623retry: 623retry:
624 error = xfs_bmapi_reserve_delalloc(ip, XFS_DATA_FORK, offset_fsb, 624 error = xfs_bmapi_reserve_delalloc(ip, XFS_DATA_FORK, offset_fsb,
625 end_fsb - offset_fsb, &got, 625 end_fsb - offset_fsb, &got, &idx, eof);
626 &prev, &idx, eof);
627 switch (error) { 626 switch (error) {
628 case 0: 627 case 0:
629 break; 628 break;
diff --git a/fs/xfs/xfs_reflink.c b/fs/xfs/xfs_reflink.c
index 4d99100a4bbf..ae17b81e7053 100644
--- a/fs/xfs/xfs_reflink.c
+++ b/fs/xfs/xfs_reflink.c
@@ -293,7 +293,7 @@ xfs_reflink_reserve_cow(
293 293
294retry: 294retry:
295 error = xfs_bmapi_reserve_delalloc(ip, XFS_COW_FORK, imap->br_startoff, 295 error = xfs_bmapi_reserve_delalloc(ip, XFS_COW_FORK, imap->br_startoff,
296 end_fsb - imap->br_startoff, &got, &prev, &idx, eof); 296 end_fsb - imap->br_startoff, &got, &idx, eof);
297 switch (error) { 297 switch (error) {
298 case 0: 298 case 0:
299 break; 299 break;