• M
    [XFS] There are a few problems with the new · 8867bc9b
    Mandy Kirkconnell 提交于
    xfs_bmap_search_multi_extents() wrapper function that I introduced in mod
    xfs-linux:xfs-kern:207393a. The function was added as a wrapper around
    xfs_bmap_do_search_extents() to avoid breaking the top-of-tree CXFS
    interface.  The idea of the function was basically to extract the target
    extent buffer (if muli- level extent allocation mode), then call
    xfs_bmap_do_search_extents() with either a pointer to the first extent in
    the target buffer or a pointer to the first extent in the file, depending
    on which extent mode was being used.  However, in addition to locating the
    target extent record for block bno, xfs_bmap_do_search_extents() also sets
    four parameters needed by the caller: *lastx, *eofp, *gotp, *prevp. 
    Passing only the target extent buffer to xfs_bmap_do_search_extents()
    causes *eofp to be set incorrectly if the extent is at the end of the
    target list but there are actually more extents in the next er_extbuf.
    Likewise, if the extent is the first one in the buffer but NOT the first
    in the file, *prevp is incorrectly set to NULL.  Adding the needed
    functionality to xfs_bmap_search_multi_extents() to re-set any incorrectly
    set fields is redundant and makes the call to xfs_bmap_do_search_extents()
    not make much sense when multi-level extent allocation mode is being used.
     This mod basically extracts the two functional components from
    xfs_bmap_do_search_extents(), with the intent of obsoleting/removing
    xfs_bmap_do_search_extents() after the CXFS mult-level in-core extent
    changes are checked in.  The two components are:  1) The binary search to
    locate the target extent record, and 2) Setting the four parameters needed
    by the caller (*lastx, *eofp, *gotp, *prevp).  Component 1: I created a
    new function in xfs_inode.c called xfs_iext_bno_to_ext(), which executes
    the binary search to find the target extent record.
    xfs_bmap_search_multi_extents() has been modified to call
    xfs_iext_bno_to_ext() rather than xfs_bmap_do_search_extents().  Component
    2: The parameter setting functionality has been added to
    xfs_bmap_search_multi_extents(), eliminating the need for
    xfs_bmap_do_search_extents().  These changes make the removal of
    xfs_bmap_do_search_extents() trival once the CXFS changes are in place. 
    They also allow us to maintain the current XFS interface, using the new
    search function introduced in mod xfs-linux:xfs-kern:207393a.
    
    SGI-PV: 928864
    SGI-Modid: xfs-linux-melb:xfs-kern:207866a
    Signed-off-by: NMandy Kirkconnell <alkirkco@sgi.com>
    Signed-off-by: NNathan Scott <nathans@sgi.com>
    8867bc9b
xfs_inode.c 135.0 KB