|
@@ -2760,6 +2760,7 @@ done:
|
|
STATIC void
|
|
STATIC void
|
|
xfs_bmap_add_extent_hole_delay(
|
|
xfs_bmap_add_extent_hole_delay(
|
|
xfs_inode_t *ip, /* incore inode pointer */
|
|
xfs_inode_t *ip, /* incore inode pointer */
|
|
|
|
+ int whichfork,
|
|
xfs_extnum_t *idx, /* extent number to update/insert */
|
|
xfs_extnum_t *idx, /* extent number to update/insert */
|
|
xfs_bmbt_irec_t *new) /* new data to add to file extents */
|
|
xfs_bmbt_irec_t *new) /* new data to add to file extents */
|
|
{
|
|
{
|
|
@@ -2771,8 +2772,10 @@ xfs_bmap_add_extent_hole_delay(
|
|
int state; /* state bits, accessed thru macros */
|
|
int state; /* state bits, accessed thru macros */
|
|
xfs_filblks_t temp=0; /* temp for indirect calculations */
|
|
xfs_filblks_t temp=0; /* temp for indirect calculations */
|
|
|
|
|
|
- ifp = XFS_IFORK_PTR(ip, XFS_DATA_FORK);
|
|
|
|
|
|
+ ifp = XFS_IFORK_PTR(ip, whichfork);
|
|
state = 0;
|
|
state = 0;
|
|
|
|
+ if (whichfork == XFS_COW_FORK)
|
|
|
|
+ state |= BMAP_COWFORK;
|
|
ASSERT(isnullstartblock(new->br_startblock));
|
|
ASSERT(isnullstartblock(new->br_startblock));
|
|
|
|
|
|
/*
|
|
/*
|
|
@@ -2790,7 +2793,7 @@ xfs_bmap_add_extent_hole_delay(
|
|
* Check and set flags if the current (right) segment exists.
|
|
* Check and set flags if the current (right) segment exists.
|
|
* If it doesn't exist, we're converting the hole at end-of-file.
|
|
* If it doesn't exist, we're converting the hole at end-of-file.
|
|
*/
|
|
*/
|
|
- if (*idx < ip->i_df.if_bytes / (uint)sizeof(xfs_bmbt_rec_t)) {
|
|
|
|
|
|
+ if (*idx < ifp->if_bytes / (uint)sizeof(xfs_bmbt_rec_t)) {
|
|
state |= BMAP_RIGHT_VALID;
|
|
state |= BMAP_RIGHT_VALID;
|
|
xfs_bmbt_get_all(xfs_iext_get_ext(ifp, *idx), &right);
|
|
xfs_bmbt_get_all(xfs_iext_get_ext(ifp, *idx), &right);
|
|
|
|
|
|
@@ -4154,6 +4157,7 @@ xfs_bmapi_read(
|
|
int
|
|
int
|
|
xfs_bmapi_reserve_delalloc(
|
|
xfs_bmapi_reserve_delalloc(
|
|
struct xfs_inode *ip,
|
|
struct xfs_inode *ip,
|
|
|
|
+ int whichfork,
|
|
xfs_fileoff_t aoff,
|
|
xfs_fileoff_t aoff,
|
|
xfs_filblks_t len,
|
|
xfs_filblks_t len,
|
|
struct xfs_bmbt_irec *got,
|
|
struct xfs_bmbt_irec *got,
|
|
@@ -4162,7 +4166,7 @@ xfs_bmapi_reserve_delalloc(
|
|
int eof)
|
|
int eof)
|
|
{
|
|
{
|
|
struct xfs_mount *mp = ip->i_mount;
|
|
struct xfs_mount *mp = ip->i_mount;
|
|
- struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, XFS_DATA_FORK);
|
|
|
|
|
|
+ struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, whichfork);
|
|
xfs_extlen_t alen;
|
|
xfs_extlen_t alen;
|
|
xfs_extlen_t indlen;
|
|
xfs_extlen_t indlen;
|
|
char rt = XFS_IS_REALTIME_INODE(ip);
|
|
char rt = XFS_IS_REALTIME_INODE(ip);
|
|
@@ -4221,7 +4225,7 @@ xfs_bmapi_reserve_delalloc(
|
|
got->br_startblock = nullstartblock(indlen);
|
|
got->br_startblock = nullstartblock(indlen);
|
|
got->br_blockcount = alen;
|
|
got->br_blockcount = alen;
|
|
got->br_state = XFS_EXT_NORM;
|
|
got->br_state = XFS_EXT_NORM;
|
|
- xfs_bmap_add_extent_hole_delay(ip, lastx, got);
|
|
|
|
|
|
+ xfs_bmap_add_extent_hole_delay(ip, whichfork, lastx, got);
|
|
|
|
|
|
/*
|
|
/*
|
|
* Update our extent pointer, given that xfs_bmap_add_extent_hole_delay
|
|
* Update our extent pointer, given that xfs_bmap_add_extent_hole_delay
|