Skip to content

Commit

Permalink
xfs: remove prev argument to xfs_bmapi_reserve_delalloc
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christoph Hellwig authored and Dave Chinner committed Nov 24, 2016
1 parent 7efc794 commit 65c5f41
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
8 changes: 6 additions & 2 deletions fs/xfs/libxfs/xfs_bmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -4235,7 +4235,6 @@ xfs_bmapi_reserve_delalloc(
xfs_fileoff_t aoff,
xfs_filblks_t len,
struct xfs_bmbt_irec *got,
struct xfs_bmbt_irec *prev,
xfs_extnum_t *lastx,
int eof)
{
Expand All @@ -4257,7 +4256,12 @@ xfs_bmapi_reserve_delalloc(
else
extsz = xfs_get_extsz_hint(ip);
if (extsz) {
error = xfs_bmap_extsize_align(mp, got, prev, extsz, rt, eof,
struct xfs_bmbt_irec prev;

if (!xfs_iext_get_extent(ifp, *lastx - 1, &prev))
prev.br_startoff = NULLFILEOFF;

error = xfs_bmap_extsize_align(mp, got, &prev, extsz, rt, eof,
1, 0, &aoff, &alen);
ASSERT(!error);
}
Expand Down
3 changes: 1 addition & 2 deletions fs/xfs/libxfs/xfs_bmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,7 @@ struct xfs_bmbt_rec_host *
struct xfs_bmbt_irec *gotp, struct xfs_bmbt_irec *prevp);
int xfs_bmapi_reserve_delalloc(struct xfs_inode *ip, int whichfork,
xfs_fileoff_t aoff, xfs_filblks_t len,
struct xfs_bmbt_irec *got, struct xfs_bmbt_irec *prev,
xfs_extnum_t *lastx, int eof);
struct xfs_bmbt_irec *got, xfs_extnum_t *lastx, int eof);

enum xfs_bmap_intent_type {
XFS_BMAP_MAP = 1,
Expand Down
3 changes: 1 addition & 2 deletions fs/xfs/xfs_iomap.c
Original file line number Diff line number Diff line change
Expand Up @@ -622,8 +622,7 @@ xfs_file_iomap_begin_delay(

retry:
error = xfs_bmapi_reserve_delalloc(ip, XFS_DATA_FORK, offset_fsb,
end_fsb - offset_fsb, &got,
&prev, &idx, eof);
end_fsb - offset_fsb, &got, &idx, eof);
switch (error) {
case 0:
break;
Expand Down
2 changes: 1 addition & 1 deletion fs/xfs/xfs_reflink.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ xfs_reflink_reserve_cow(

retry:
error = xfs_bmapi_reserve_delalloc(ip, XFS_COW_FORK, imap->br_startoff,
end_fsb - imap->br_startoff, &got, &prev, &idx, eof);
end_fsb - imap->br_startoff, &got, &idx, eof);
switch (error) {
case 0:
break;
Expand Down

0 comments on commit 65c5f41

Please sign in to comment.