You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
[XFS] Add parameters to xfs_bmapi() and xfs_bunmapi() to have them report
the range spanned by modifications to the in-core extent map. Add XFS_BUNMAPI() and XFS_SWAP_EXTENTS() macros that call xfs_bunmapi() and xfs_swap_extents() via the ioops vector. Change all calls that may modify the in-core extent map for the data fork to go through the ioops vector. This allows a cache of extent map data to be kept in sync. SGI-PV: 947615 SGI-Modid: xfs-linux-melb:xfs-kern:209226a Signed-off-by: Olaf Weber <olaf@sgi.com> Signed-off-by: Nathan Scott <nathans@sgi.com>
This commit is contained in:
@@ -458,7 +458,7 @@ xfs_zero_last_block(
|
|||||||
last_fsb = XFS_B_TO_FSBT(mp, isize);
|
last_fsb = XFS_B_TO_FSBT(mp, isize);
|
||||||
nimaps = 1;
|
nimaps = 1;
|
||||||
error = XFS_BMAPI(mp, NULL, io, last_fsb, 1, 0, NULL, 0, &imap,
|
error = XFS_BMAPI(mp, NULL, io, last_fsb, 1, 0, NULL, 0, &imap,
|
||||||
&nimaps, NULL);
|
&nimaps, NULL, NULL);
|
||||||
if (error) {
|
if (error) {
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
@@ -556,7 +556,7 @@ xfs_zero_eof(
|
|||||||
nimaps = 1;
|
nimaps = 1;
|
||||||
zero_count_fsb = end_zero_fsb - start_zero_fsb + 1;
|
zero_count_fsb = end_zero_fsb - start_zero_fsb + 1;
|
||||||
error = XFS_BMAPI(mp, NULL, io, start_zero_fsb, zero_count_fsb,
|
error = XFS_BMAPI(mp, NULL, io, start_zero_fsb, zero_count_fsb,
|
||||||
0, NULL, 0, &imap, &nimaps, NULL);
|
0, NULL, 0, &imap, &nimaps, NULL, NULL);
|
||||||
if (error) {
|
if (error) {
|
||||||
ASSERT(ismrlocked(io->io_lock, MR_UPDATE));
|
ASSERT(ismrlocked(io->io_lock, MR_UPDATE));
|
||||||
ASSERT(ismrlocked(io->io_iolock, MR_UPDATE));
|
ASSERT(ismrlocked(io->io_iolock, MR_UPDATE));
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ struct xfs_iomap;
|
|||||||
#define XFS_CTRUNC4 14
|
#define XFS_CTRUNC4 14
|
||||||
#define XFS_CTRUNC5 15
|
#define XFS_CTRUNC5 15
|
||||||
#define XFS_CTRUNC6 16
|
#define XFS_CTRUNC6 16
|
||||||
#define XFS_BUNMAPI 17
|
#define XFS_BUNMAP 17
|
||||||
#define XFS_INVAL_CACHED 18
|
#define XFS_INVAL_CACHED 18
|
||||||
#define XFS_DIORD_ENTER 19
|
#define XFS_DIORD_ENTER 19
|
||||||
#define XFS_DIOWR_ENTER 20
|
#define XFS_DIOWR_ENTER 20
|
||||||
|
|||||||
@@ -444,7 +444,7 @@ xfs_qm_dqalloc(
|
|||||||
XFS_BMAPI_METADATA | XFS_BMAPI_WRITE,
|
XFS_BMAPI_METADATA | XFS_BMAPI_WRITE,
|
||||||
&firstblock,
|
&firstblock,
|
||||||
XFS_QM_DQALLOC_SPACE_RES(mp),
|
XFS_QM_DQALLOC_SPACE_RES(mp),
|
||||||
&map, &nmaps, &flist))) {
|
&map, &nmaps, &flist, NULL))) {
|
||||||
goto error0;
|
goto error0;
|
||||||
}
|
}
|
||||||
ASSERT(map.br_blockcount == XFS_DQUOT_CLUSTER_SIZE_FSB);
|
ASSERT(map.br_blockcount == XFS_DQUOT_CLUSTER_SIZE_FSB);
|
||||||
@@ -559,7 +559,7 @@ xfs_qm_dqtobp(
|
|||||||
error = xfs_bmapi(NULL, quotip, dqp->q_fileoffset,
|
error = xfs_bmapi(NULL, quotip, dqp->q_fileoffset,
|
||||||
XFS_DQUOT_CLUSTER_SIZE_FSB,
|
XFS_DQUOT_CLUSTER_SIZE_FSB,
|
||||||
XFS_BMAPI_METADATA,
|
XFS_BMAPI_METADATA,
|
||||||
NULL, 0, &map, &nmaps, NULL);
|
NULL, 0, &map, &nmaps, NULL, NULL);
|
||||||
|
|
||||||
xfs_iunlock(quotip, XFS_ILOCK_SHARED);
|
xfs_iunlock(quotip, XFS_ILOCK_SHARED);
|
||||||
if (error)
|
if (error)
|
||||||
|
|||||||
@@ -1603,7 +1603,7 @@ xfs_qm_dqiterate(
|
|||||||
maxlblkcnt - lblkno,
|
maxlblkcnt - lblkno,
|
||||||
XFS_BMAPI_METADATA,
|
XFS_BMAPI_METADATA,
|
||||||
NULL,
|
NULL,
|
||||||
0, map, &nmaps, NULL);
|
0, map, &nmaps, NULL, NULL);
|
||||||
xfs_iunlock(qip, XFS_ILOCK_SHARED);
|
xfs_iunlock(qip, XFS_ILOCK_SHARED);
|
||||||
if (error)
|
if (error)
|
||||||
break;
|
break;
|
||||||
|
|||||||
+7
-5
@@ -1910,7 +1910,7 @@ xfs_attr_rmtval_get(xfs_da_args_t *args)
|
|||||||
error = xfs_bmapi(args->trans, args->dp, (xfs_fileoff_t)lblkno,
|
error = xfs_bmapi(args->trans, args->dp, (xfs_fileoff_t)lblkno,
|
||||||
args->rmtblkcnt,
|
args->rmtblkcnt,
|
||||||
XFS_BMAPI_ATTRFORK | XFS_BMAPI_METADATA,
|
XFS_BMAPI_ATTRFORK | XFS_BMAPI_METADATA,
|
||||||
NULL, 0, map, &nmap, NULL);
|
NULL, 0, map, &nmap, NULL, NULL);
|
||||||
if (error)
|
if (error)
|
||||||
return(error);
|
return(error);
|
||||||
ASSERT(nmap >= 1);
|
ASSERT(nmap >= 1);
|
||||||
@@ -1988,7 +1988,7 @@ xfs_attr_rmtval_set(xfs_da_args_t *args)
|
|||||||
XFS_BMAPI_ATTRFORK | XFS_BMAPI_METADATA |
|
XFS_BMAPI_ATTRFORK | XFS_BMAPI_METADATA |
|
||||||
XFS_BMAPI_WRITE,
|
XFS_BMAPI_WRITE,
|
||||||
args->firstblock, args->total, &map, &nmap,
|
args->firstblock, args->total, &map, &nmap,
|
||||||
args->flist);
|
args->flist, NULL);
|
||||||
if (!error) {
|
if (!error) {
|
||||||
error = xfs_bmap_finish(&args->trans, args->flist,
|
error = xfs_bmap_finish(&args->trans, args->flist,
|
||||||
*args->firstblock, &committed);
|
*args->firstblock, &committed);
|
||||||
@@ -2039,7 +2039,8 @@ xfs_attr_rmtval_set(xfs_da_args_t *args)
|
|||||||
error = xfs_bmapi(NULL, dp, (xfs_fileoff_t)lblkno,
|
error = xfs_bmapi(NULL, dp, (xfs_fileoff_t)lblkno,
|
||||||
args->rmtblkcnt,
|
args->rmtblkcnt,
|
||||||
XFS_BMAPI_ATTRFORK | XFS_BMAPI_METADATA,
|
XFS_BMAPI_ATTRFORK | XFS_BMAPI_METADATA,
|
||||||
args->firstblock, 0, &map, &nmap, NULL);
|
args->firstblock, 0, &map, &nmap,
|
||||||
|
NULL, NULL);
|
||||||
if (error) {
|
if (error) {
|
||||||
return(error);
|
return(error);
|
||||||
}
|
}
|
||||||
@@ -2104,7 +2105,7 @@ xfs_attr_rmtval_remove(xfs_da_args_t *args)
|
|||||||
args->rmtblkcnt,
|
args->rmtblkcnt,
|
||||||
XFS_BMAPI_ATTRFORK | XFS_BMAPI_METADATA,
|
XFS_BMAPI_ATTRFORK | XFS_BMAPI_METADATA,
|
||||||
args->firstblock, 0, &map, &nmap,
|
args->firstblock, 0, &map, &nmap,
|
||||||
args->flist);
|
args->flist, NULL);
|
||||||
if (error) {
|
if (error) {
|
||||||
return(error);
|
return(error);
|
||||||
}
|
}
|
||||||
@@ -2142,7 +2143,8 @@ xfs_attr_rmtval_remove(xfs_da_args_t *args)
|
|||||||
XFS_BMAP_INIT(args->flist, args->firstblock);
|
XFS_BMAP_INIT(args->flist, args->firstblock);
|
||||||
error = xfs_bunmapi(args->trans, args->dp, lblkno, blkcnt,
|
error = xfs_bunmapi(args->trans, args->dp, lblkno, blkcnt,
|
||||||
XFS_BMAPI_ATTRFORK | XFS_BMAPI_METADATA,
|
XFS_BMAPI_ATTRFORK | XFS_BMAPI_METADATA,
|
||||||
1, args->firstblock, args->flist, &done);
|
1, args->firstblock, args->flist,
|
||||||
|
NULL, &done);
|
||||||
if (!error) {
|
if (!error) {
|
||||||
error = xfs_bmap_finish(&args->trans, args->flist,
|
error = xfs_bmap_finish(&args->trans, args->flist,
|
||||||
*args->firstblock, &committed);
|
*args->firstblock, &committed);
|
||||||
|
|||||||
@@ -2990,7 +2990,7 @@ xfs_attr_leaf_freextent(xfs_trans_t **trans, xfs_inode_t *dp,
|
|||||||
nmap = 1;
|
nmap = 1;
|
||||||
error = xfs_bmapi(*trans, dp, (xfs_fileoff_t)tblkno, tblkcnt,
|
error = xfs_bmapi(*trans, dp, (xfs_fileoff_t)tblkno, tblkcnt,
|
||||||
XFS_BMAPI_ATTRFORK | XFS_BMAPI_METADATA,
|
XFS_BMAPI_ATTRFORK | XFS_BMAPI_METADATA,
|
||||||
NULL, 0, &map, &nmap, NULL);
|
NULL, 0, &map, &nmap, NULL, NULL);
|
||||||
if (error) {
|
if (error) {
|
||||||
return(error);
|
return(error);
|
||||||
}
|
}
|
||||||
|
|||||||
+282
-81
File diff suppressed because it is too large
Load Diff
+20
-2
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2000-2003,2005 Silicon Graphics, Inc.
|
* Copyright (c) 2000-2006 Silicon Graphics, Inc.
|
||||||
* All Rights Reserved.
|
* All Rights Reserved.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
@@ -25,6 +25,20 @@ struct xfs_inode;
|
|||||||
struct xfs_mount;
|
struct xfs_mount;
|
||||||
struct xfs_trans;
|
struct xfs_trans;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* DELTA: describe a change to the in-core extent list.
|
||||||
|
*
|
||||||
|
* Internally the use of xed_blockount is somewhat funky.
|
||||||
|
* xed_blockcount contains an offset much of the time because this
|
||||||
|
* makes merging changes easier. (xfs_fileoff_t and xfs_filblks_t are
|
||||||
|
* the same underlying type).
|
||||||
|
*/
|
||||||
|
typedef struct xfs_extdelta
|
||||||
|
{
|
||||||
|
xfs_fileoff_t xed_startoff; /* offset of range */
|
||||||
|
xfs_filblks_t xed_blockcount; /* blocks in range */
|
||||||
|
} xfs_extdelta_t;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* List of extents to be free "later".
|
* List of extents to be free "later".
|
||||||
* The list is kept sorted on xbf_startblock.
|
* The list is kept sorted on xbf_startblock.
|
||||||
@@ -275,7 +289,9 @@ xfs_bmapi(
|
|||||||
xfs_extlen_t total, /* total blocks needed */
|
xfs_extlen_t total, /* total blocks needed */
|
||||||
struct xfs_bmbt_irec *mval, /* output: map values */
|
struct xfs_bmbt_irec *mval, /* output: map values */
|
||||||
int *nmap, /* i/o: mval size/count */
|
int *nmap, /* i/o: mval size/count */
|
||||||
xfs_bmap_free_t *flist); /* i/o: list extents to free */
|
xfs_bmap_free_t *flist, /* i/o: list extents to free */
|
||||||
|
xfs_extdelta_t *delta); /* o: change made to incore
|
||||||
|
extents */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Map file blocks to filesystem blocks, simple version.
|
* Map file blocks to filesystem blocks, simple version.
|
||||||
@@ -309,6 +325,8 @@ xfs_bunmapi(
|
|||||||
xfs_fsblock_t *firstblock, /* first allocated block
|
xfs_fsblock_t *firstblock, /* first allocated block
|
||||||
controls a.g. for allocs */
|
controls a.g. for allocs */
|
||||||
xfs_bmap_free_t *flist, /* i/o: list extents to free */
|
xfs_bmap_free_t *flist, /* i/o: list extents to free */
|
||||||
|
xfs_extdelta_t *delta, /* o: change made to incore
|
||||||
|
extents */
|
||||||
int *done); /* set if not done yet */
|
int *done); /* set if not done yet */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -1655,7 +1655,7 @@ xfs_da_grow_inode(xfs_da_args_t *args, xfs_dablk_t *new_blkno)
|
|||||||
XFS_BMAPI_AFLAG(w)|XFS_BMAPI_WRITE|XFS_BMAPI_METADATA|
|
XFS_BMAPI_AFLAG(w)|XFS_BMAPI_WRITE|XFS_BMAPI_METADATA|
|
||||||
XFS_BMAPI_CONTIG,
|
XFS_BMAPI_CONTIG,
|
||||||
args->firstblock, args->total, &map, &nmap,
|
args->firstblock, args->total, &map, &nmap,
|
||||||
args->flist))) {
|
args->flist, NULL))) {
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
ASSERT(nmap <= 1);
|
ASSERT(nmap <= 1);
|
||||||
@@ -1676,7 +1676,8 @@ xfs_da_grow_inode(xfs_da_args_t *args, xfs_dablk_t *new_blkno)
|
|||||||
XFS_BMAPI_AFLAG(w)|XFS_BMAPI_WRITE|
|
XFS_BMAPI_AFLAG(w)|XFS_BMAPI_WRITE|
|
||||||
XFS_BMAPI_METADATA,
|
XFS_BMAPI_METADATA,
|
||||||
args->firstblock, args->total,
|
args->firstblock, args->total,
|
||||||
&mapp[mapi], &nmap, args->flist))) {
|
&mapp[mapi], &nmap, args->flist,
|
||||||
|
NULL))) {
|
||||||
kmem_free(mapp, sizeof(*mapp) * count);
|
kmem_free(mapp, sizeof(*mapp) * count);
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
@@ -1961,7 +1962,7 @@ xfs_da_shrink_inode(xfs_da_args_t *args, xfs_dablk_t dead_blkno,
|
|||||||
*/
|
*/
|
||||||
if ((error = xfs_bunmapi(tp, dp, dead_blkno, count,
|
if ((error = xfs_bunmapi(tp, dp, dead_blkno, count,
|
||||||
XFS_BMAPI_AFLAG(w)|XFS_BMAPI_METADATA,
|
XFS_BMAPI_AFLAG(w)|XFS_BMAPI_METADATA,
|
||||||
0, args->firstblock, args->flist,
|
0, args->firstblock, args->flist, NULL,
|
||||||
&done)) == ENOSPC) {
|
&done)) == ENOSPC) {
|
||||||
if (w != XFS_DATA_FORK)
|
if (w != XFS_DATA_FORK)
|
||||||
goto done;
|
goto done;
|
||||||
@@ -2086,7 +2087,7 @@ xfs_da_do_buf(
|
|||||||
nfsb,
|
nfsb,
|
||||||
XFS_BMAPI_METADATA |
|
XFS_BMAPI_METADATA |
|
||||||
XFS_BMAPI_AFLAG(whichfork),
|
XFS_BMAPI_AFLAG(whichfork),
|
||||||
NULL, 0, mapp, &nmap, NULL)))
|
NULL, 0, mapp, &nmap, NULL, NULL)))
|
||||||
goto exit0;
|
goto exit0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
+49
-25
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2000-2002,2005 Silicon Graphics, Inc.
|
* Copyright (c) 2000-2006 Silicon Graphics, Inc.
|
||||||
* All Rights Reserved.
|
* All Rights Reserved.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
@@ -54,24 +54,14 @@ xfs_swapext(
|
|||||||
xfs_swapext_t __user *sxu)
|
xfs_swapext_t __user *sxu)
|
||||||
{
|
{
|
||||||
xfs_swapext_t *sxp;
|
xfs_swapext_t *sxp;
|
||||||
xfs_inode_t *ip=NULL, *tip=NULL, *ips[2];
|
xfs_inode_t *ip=NULL, *tip=NULL;
|
||||||
xfs_trans_t *tp;
|
|
||||||
xfs_mount_t *mp;
|
xfs_mount_t *mp;
|
||||||
xfs_bstat_t *sbp;
|
|
||||||
struct file *fp = NULL, *tfp = NULL;
|
struct file *fp = NULL, *tfp = NULL;
|
||||||
vnode_t *vp, *tvp;
|
vnode_t *vp, *tvp;
|
||||||
static uint lock_flags = XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL;
|
|
||||||
int ilf_fields, tilf_fields;
|
|
||||||
int error = 0;
|
int error = 0;
|
||||||
xfs_ifork_t *tempifp, *ifp, *tifp;
|
|
||||||
__uint64_t tmp;
|
|
||||||
int aforkblks = 0;
|
|
||||||
int taforkblks = 0;
|
|
||||||
char locked = 0;
|
|
||||||
|
|
||||||
sxp = kmem_alloc(sizeof(xfs_swapext_t), KM_MAYFAIL);
|
sxp = kmem_alloc(sizeof(xfs_swapext_t), KM_MAYFAIL);
|
||||||
tempifp = kmem_alloc(sizeof(xfs_ifork_t), KM_MAYFAIL);
|
if (!sxp) {
|
||||||
if (!sxp || !tempifp) {
|
|
||||||
error = XFS_ERROR(ENOMEM);
|
error = XFS_ERROR(ENOMEM);
|
||||||
goto error0;
|
goto error0;
|
||||||
}
|
}
|
||||||
@@ -118,14 +108,56 @@ xfs_swapext(
|
|||||||
|
|
||||||
mp = ip->i_mount;
|
mp = ip->i_mount;
|
||||||
|
|
||||||
sbp = &sxp->sx_stat;
|
|
||||||
|
|
||||||
if (XFS_FORCED_SHUTDOWN(mp)) {
|
if (XFS_FORCED_SHUTDOWN(mp)) {
|
||||||
error = XFS_ERROR(EIO);
|
error = XFS_ERROR(EIO);
|
||||||
goto error0;
|
goto error0;
|
||||||
}
|
}
|
||||||
|
|
||||||
locked = 1;
|
error = XFS_SWAP_EXTENTS(mp, &ip->i_iocore, &tip->i_iocore, sxp);
|
||||||
|
|
||||||
|
error0:
|
||||||
|
if (fp != NULL)
|
||||||
|
fput(fp);
|
||||||
|
if (tfp != NULL)
|
||||||
|
fput(tfp);
|
||||||
|
|
||||||
|
if (sxp != NULL)
|
||||||
|
kmem_free(sxp, sizeof(xfs_swapext_t));
|
||||||
|
|
||||||
|
return error;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
xfs_swap_extents(
|
||||||
|
xfs_inode_t *ip,
|
||||||
|
xfs_inode_t *tip,
|
||||||
|
xfs_swapext_t *sxp)
|
||||||
|
{
|
||||||
|
xfs_mount_t *mp;
|
||||||
|
xfs_inode_t *ips[2];
|
||||||
|
xfs_trans_t *tp;
|
||||||
|
xfs_bstat_t *sbp = &sxp->sx_stat;
|
||||||
|
vnode_t *vp, *tvp;
|
||||||
|
xfs_ifork_t *tempifp, *ifp, *tifp;
|
||||||
|
int ilf_fields, tilf_fields;
|
||||||
|
static uint lock_flags = XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL;
|
||||||
|
int error = 0;
|
||||||
|
int aforkblks = 0;
|
||||||
|
int taforkblks = 0;
|
||||||
|
__uint64_t tmp;
|
||||||
|
char locked = 0;
|
||||||
|
|
||||||
|
mp = ip->i_mount;
|
||||||
|
|
||||||
|
tempifp = kmem_alloc(sizeof(xfs_ifork_t), KM_MAYFAIL);
|
||||||
|
if (!tempifp) {
|
||||||
|
error = XFS_ERROR(ENOMEM);
|
||||||
|
goto error0;
|
||||||
|
}
|
||||||
|
|
||||||
|
sbp = &sxp->sx_stat;
|
||||||
|
vp = XFS_ITOV(ip);
|
||||||
|
tvp = XFS_ITOV(tip);
|
||||||
|
|
||||||
/* Lock in i_ino order */
|
/* Lock in i_ino order */
|
||||||
if (ip->i_ino < tip->i_ino) {
|
if (ip->i_ino < tip->i_ino) {
|
||||||
@@ -137,6 +169,7 @@ xfs_swapext(
|
|||||||
}
|
}
|
||||||
|
|
||||||
xfs_lock_inodes(ips, 2, 0, lock_flags);
|
xfs_lock_inodes(ips, 2, 0, lock_flags);
|
||||||
|
locked = 1;
|
||||||
|
|
||||||
/* Check permissions */
|
/* Check permissions */
|
||||||
error = xfs_iaccess(ip, S_IWUSR, NULL);
|
error = xfs_iaccess(ip, S_IWUSR, NULL);
|
||||||
@@ -360,16 +393,7 @@ xfs_swapext(
|
|||||||
xfs_iunlock(ip, lock_flags);
|
xfs_iunlock(ip, lock_flags);
|
||||||
xfs_iunlock(tip, lock_flags);
|
xfs_iunlock(tip, lock_flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fp != NULL)
|
|
||||||
fput(fp);
|
|
||||||
if (tfp != NULL)
|
|
||||||
fput(tfp);
|
|
||||||
|
|
||||||
if (sxp != NULL)
|
|
||||||
kmem_free(sxp, sizeof(xfs_swapext_t));
|
|
||||||
if (tempifp != NULL)
|
if (tempifp != NULL)
|
||||||
kmem_free(tempifp, sizeof(xfs_ifork_t));
|
kmem_free(tempifp, sizeof(xfs_ifork_t));
|
||||||
|
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,6 +48,9 @@ typedef struct xfs_swapext
|
|||||||
*/
|
*/
|
||||||
int xfs_swapext(struct xfs_swapext __user *sx);
|
int xfs_swapext(struct xfs_swapext __user *sx);
|
||||||
|
|
||||||
|
int xfs_swap_extents(struct xfs_inode *ip, struct xfs_inode *tip,
|
||||||
|
struct xfs_swapext *sxp);
|
||||||
|
|
||||||
#endif /* __KERNEL__ */
|
#endif /* __KERNEL__ */
|
||||||
|
|
||||||
#endif /* __XFS_DFRAG_H__ */
|
#endif /* __XFS_DFRAG_H__ */
|
||||||
|
|||||||
+4
-3
@@ -549,7 +549,7 @@ xfs_dir2_grow_inode(
|
|||||||
if ((error = xfs_bmapi(tp, dp, bno, count,
|
if ((error = xfs_bmapi(tp, dp, bno, count,
|
||||||
XFS_BMAPI_WRITE|XFS_BMAPI_METADATA|XFS_BMAPI_CONTIG,
|
XFS_BMAPI_WRITE|XFS_BMAPI_METADATA|XFS_BMAPI_CONTIG,
|
||||||
args->firstblock, args->total, &map, &nmap,
|
args->firstblock, args->total, &map, &nmap,
|
||||||
args->flist))) {
|
args->flist, NULL))) {
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
ASSERT(nmap <= 1);
|
ASSERT(nmap <= 1);
|
||||||
@@ -585,7 +585,8 @@ xfs_dir2_grow_inode(
|
|||||||
if ((error = xfs_bmapi(tp, dp, b, c,
|
if ((error = xfs_bmapi(tp, dp, b, c,
|
||||||
XFS_BMAPI_WRITE|XFS_BMAPI_METADATA,
|
XFS_BMAPI_WRITE|XFS_BMAPI_METADATA,
|
||||||
args->firstblock, args->total,
|
args->firstblock, args->total,
|
||||||
&mapp[mapi], &nmap, args->flist))) {
|
&mapp[mapi], &nmap, args->flist,
|
||||||
|
NULL))) {
|
||||||
kmem_free(mapp, sizeof(*mapp) * count);
|
kmem_free(mapp, sizeof(*mapp) * count);
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
@@ -786,7 +787,7 @@ xfs_dir2_shrink_inode(
|
|||||||
*/
|
*/
|
||||||
if ((error = xfs_bunmapi(tp, dp, da, mp->m_dirblkfsbs,
|
if ((error = xfs_bunmapi(tp, dp, da, mp->m_dirblkfsbs,
|
||||||
XFS_BMAPI_METADATA, 0, args->firstblock, args->flist,
|
XFS_BMAPI_METADATA, 0, args->firstblock, args->flist,
|
||||||
&done))) {
|
NULL, &done))) {
|
||||||
/*
|
/*
|
||||||
* ENOSPC actually can happen if we're in a removename with
|
* ENOSPC actually can happen if we're in a removename with
|
||||||
* no space reservation, and the resulting block removal
|
* no space reservation, and the resulting block removal
|
||||||
|
|||||||
@@ -884,7 +884,7 @@ xfs_dir2_leaf_getdents(
|
|||||||
XFS_DIR2_BYTE_TO_DA(mp,
|
XFS_DIR2_BYTE_TO_DA(mp,
|
||||||
XFS_DIR2_LEAF_OFFSET) - map_off,
|
XFS_DIR2_LEAF_OFFSET) - map_off,
|
||||||
XFS_BMAPI_METADATA, NULL, 0,
|
XFS_BMAPI_METADATA, NULL, 0,
|
||||||
&map[map_valid], &nmap, NULL);
|
&map[map_valid], &nmap, NULL, NULL);
|
||||||
/*
|
/*
|
||||||
* Don't know if we should ignore this or
|
* Don't know if we should ignore this or
|
||||||
* try to return an error.
|
* try to return an error.
|
||||||
|
|||||||
+6
-5
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2000-2003,2005 Silicon Graphics, Inc.
|
* Copyright (c) 2000-2006 Silicon Graphics, Inc.
|
||||||
* All Rights Reserved.
|
* All Rights Reserved.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
@@ -1285,7 +1285,7 @@ xfs_isize_check(
|
|||||||
(xfs_ufsize_t)XFS_MAXIOFFSET(mp)) -
|
(xfs_ufsize_t)XFS_MAXIOFFSET(mp)) -
|
||||||
map_first),
|
map_first),
|
||||||
XFS_BMAPI_ENTIRE, NULL, 0, imaps, &nimaps,
|
XFS_BMAPI_ENTIRE, NULL, 0, imaps, &nimaps,
|
||||||
NULL))
|
NULL, NULL))
|
||||||
return;
|
return;
|
||||||
ASSERT(nimaps == 1);
|
ASSERT(nimaps == 1);
|
||||||
ASSERT(imaps[0].br_startblock == HOLESTARTBLOCK);
|
ASSERT(imaps[0].br_startblock == HOLESTARTBLOCK);
|
||||||
@@ -1666,12 +1666,13 @@ xfs_itruncate_finish(
|
|||||||
* runs.
|
* runs.
|
||||||
*/
|
*/
|
||||||
XFS_BMAP_INIT(&free_list, &first_block);
|
XFS_BMAP_INIT(&free_list, &first_block);
|
||||||
error = xfs_bunmapi(ntp, ip, first_unmap_block,
|
error = XFS_BUNMAPI(mp, ntp, &ip->i_iocore,
|
||||||
unmap_len,
|
first_unmap_block, unmap_len,
|
||||||
XFS_BMAPI_AFLAG(fork) |
|
XFS_BMAPI_AFLAG(fork) |
|
||||||
(sync ? 0 : XFS_BMAPI_ASYNC),
|
(sync ? 0 : XFS_BMAPI_ASYNC),
|
||||||
XFS_ITRUNC_MAX_EXTENTS,
|
XFS_ITRUNC_MAX_EXTENTS,
|
||||||
&first_block, &free_list, &done);
|
&first_block, &free_list,
|
||||||
|
NULL, &done);
|
||||||
if (error) {
|
if (error) {
|
||||||
/*
|
/*
|
||||||
* If the bunmapi call encounters an error,
|
* If the bunmapi call encounters an error,
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
#include "xfs_ag.h"
|
#include "xfs_ag.h"
|
||||||
#include "xfs_dir.h"
|
#include "xfs_dir.h"
|
||||||
#include "xfs_dir2.h"
|
#include "xfs_dir2.h"
|
||||||
|
#include "xfs_dfrag.h"
|
||||||
#include "xfs_dmapi.h"
|
#include "xfs_dmapi.h"
|
||||||
#include "xfs_mount.h"
|
#include "xfs_mount.h"
|
||||||
#include "xfs_bmap_btree.h"
|
#include "xfs_bmap_btree.h"
|
||||||
@@ -68,6 +69,7 @@ xfs_ioinit(
|
|||||||
xfs_ioops_t xfs_iocore_xfs = {
|
xfs_ioops_t xfs_iocore_xfs = {
|
||||||
.xfs_ioinit = (xfs_ioinit_t) xfs_ioinit,
|
.xfs_ioinit = (xfs_ioinit_t) xfs_ioinit,
|
||||||
.xfs_bmapi_func = (xfs_bmapi_t) xfs_bmapi,
|
.xfs_bmapi_func = (xfs_bmapi_t) xfs_bmapi,
|
||||||
|
.xfs_bunmapi_func = (xfs_bunmapi_t) xfs_bunmapi,
|
||||||
.xfs_bmap_eof_func = (xfs_bmap_eof_t) xfs_bmap_eof,
|
.xfs_bmap_eof_func = (xfs_bmap_eof_t) xfs_bmap_eof,
|
||||||
.xfs_iomap_write_direct =
|
.xfs_iomap_write_direct =
|
||||||
(xfs_iomap_write_direct_t) xfs_iomap_write_direct,
|
(xfs_iomap_write_direct_t) xfs_iomap_write_direct,
|
||||||
@@ -84,6 +86,7 @@ xfs_ioops_t xfs_iocore_xfs = {
|
|||||||
.xfs_unlock = (xfs_unlk_t) xfs_iunlock,
|
.xfs_unlock = (xfs_unlk_t) xfs_iunlock,
|
||||||
.xfs_size_func = (xfs_size_t) xfs_size_fn,
|
.xfs_size_func = (xfs_size_t) xfs_size_fn,
|
||||||
.xfs_iodone = (xfs_iodone_t) fs_noerr,
|
.xfs_iodone = (xfs_iodone_t) fs_noerr,
|
||||||
|
.xfs_swap_extents_func = (xfs_swap_extents_t) xfs_swap_extents,
|
||||||
};
|
};
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
+12
-12
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2000-2005 Silicon Graphics, Inc.
|
* Copyright (c) 2000-2006 Silicon Graphics, Inc.
|
||||||
* All Rights Reserved.
|
* All Rights Reserved.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
@@ -252,7 +252,7 @@ xfs_iomap(
|
|||||||
error = XFS_BMAPI(mp, NULL, io, offset_fsb,
|
error = XFS_BMAPI(mp, NULL, io, offset_fsb,
|
||||||
(xfs_filblks_t)(end_fsb - offset_fsb),
|
(xfs_filblks_t)(end_fsb - offset_fsb),
|
||||||
bmapi_flags, NULL, 0, &imap,
|
bmapi_flags, NULL, 0, &imap,
|
||||||
&nimaps, NULL);
|
&nimaps, NULL, NULL);
|
||||||
|
|
||||||
if (error)
|
if (error)
|
||||||
goto out;
|
goto out;
|
||||||
@@ -519,8 +519,8 @@ xfs_iomap_write_direct(
|
|||||||
*/
|
*/
|
||||||
XFS_BMAP_INIT(&free_list, &firstfsb);
|
XFS_BMAP_INIT(&free_list, &firstfsb);
|
||||||
nimaps = 1;
|
nimaps = 1;
|
||||||
error = xfs_bmapi(tp, ip, offset_fsb, count_fsb,
|
error = XFS_BMAPI(mp, tp, io, offset_fsb, count_fsb, bmapi_flag,
|
||||||
bmapi_flag, &firstfsb, 0, &imap, &nimaps, &free_list);
|
&firstfsb, 0, &imap, &nimaps, &free_list, NULL);
|
||||||
if (error)
|
if (error)
|
||||||
goto error0;
|
goto error0;
|
||||||
|
|
||||||
@@ -610,8 +610,8 @@ xfs_iomap_eof_want_preallocate(
|
|||||||
while (count_fsb > 0) {
|
while (count_fsb > 0) {
|
||||||
imaps = nimaps;
|
imaps = nimaps;
|
||||||
firstblock = NULLFSBLOCK;
|
firstblock = NULLFSBLOCK;
|
||||||
error = XFS_BMAPI(mp, NULL, io, start_fsb, count_fsb,
|
error = XFS_BMAPI(mp, NULL, io, start_fsb, count_fsb, 0,
|
||||||
0, &firstblock, 0, imap, &imaps, NULL);
|
&firstblock, 0, imap, &imaps, NULL, NULL);
|
||||||
if (error)
|
if (error)
|
||||||
return error;
|
return error;
|
||||||
for (n = 0; n < imaps; n++) {
|
for (n = 0; n < imaps; n++) {
|
||||||
@@ -695,11 +695,11 @@ retry:
|
|||||||
|
|
||||||
nimaps = XFS_WRITE_IMAPS;
|
nimaps = XFS_WRITE_IMAPS;
|
||||||
firstblock = NULLFSBLOCK;
|
firstblock = NULLFSBLOCK;
|
||||||
error = xfs_bmapi(NULL, ip, offset_fsb,
|
error = XFS_BMAPI(mp, NULL, io, offset_fsb,
|
||||||
(xfs_filblks_t)(last_fsb - offset_fsb),
|
(xfs_filblks_t)(last_fsb - offset_fsb),
|
||||||
XFS_BMAPI_DELAY | XFS_BMAPI_WRITE |
|
XFS_BMAPI_DELAY | XFS_BMAPI_WRITE |
|
||||||
XFS_BMAPI_ENTIRE, &firstblock, 1, imap,
|
XFS_BMAPI_ENTIRE, &firstblock, 1, imap,
|
||||||
&nimaps, NULL);
|
&nimaps, NULL, NULL);
|
||||||
if (error && (error != ENOSPC))
|
if (error && (error != ENOSPC))
|
||||||
return XFS_ERROR(error);
|
return XFS_ERROR(error);
|
||||||
|
|
||||||
@@ -832,9 +832,9 @@ xfs_iomap_write_allocate(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Go get the actual blocks */
|
/* Go get the actual blocks */
|
||||||
error = xfs_bmapi(tp, ip, map_start_fsb, count_fsb,
|
error = XFS_BMAPI(mp, tp, io, map_start_fsb, count_fsb,
|
||||||
XFS_BMAPI_WRITE, &first_block, 1,
|
XFS_BMAPI_WRITE, &first_block, 1,
|
||||||
imap, &nimaps, &free_list);
|
imap, &nimaps, &free_list, NULL);
|
||||||
if (error)
|
if (error)
|
||||||
goto trans_cancel;
|
goto trans_cancel;
|
||||||
|
|
||||||
@@ -955,9 +955,9 @@ xfs_iomap_write_unwritten(
|
|||||||
*/
|
*/
|
||||||
XFS_BMAP_INIT(&free_list, &firstfsb);
|
XFS_BMAP_INIT(&free_list, &firstfsb);
|
||||||
nimaps = 1;
|
nimaps = 1;
|
||||||
error = xfs_bmapi(tp, ip, offset_fsb, count_fsb,
|
error = XFS_BMAPI(mp, tp, io, offset_fsb, count_fsb,
|
||||||
XFS_BMAPI_WRITE|XFS_BMAPI_CONVERT, &firstfsb,
|
XFS_BMAPI_WRITE|XFS_BMAPI_CONVERT, &firstfsb,
|
||||||
1, &imap, &nimaps, &free_list);
|
1, &imap, &nimaps, &free_list, NULL);
|
||||||
if (error)
|
if (error)
|
||||||
goto error_on_bmapi_transaction;
|
goto error_on_bmapi_transaction;
|
||||||
|
|
||||||
|
|||||||
+20
-3
@@ -63,6 +63,8 @@ struct xfs_perag;
|
|||||||
struct xfs_iocore;
|
struct xfs_iocore;
|
||||||
struct xfs_bmbt_irec;
|
struct xfs_bmbt_irec;
|
||||||
struct xfs_bmap_free;
|
struct xfs_bmap_free;
|
||||||
|
struct xfs_extdelta;
|
||||||
|
struct xfs_swapext;
|
||||||
|
|
||||||
extern struct vfsops xfs_vfsops;
|
extern struct vfsops xfs_vfsops;
|
||||||
extern struct vnodeops xfs_vnodeops;
|
extern struct vnodeops xfs_vnodeops;
|
||||||
@@ -194,7 +196,12 @@ typedef int (*xfs_bmapi_t)(struct xfs_trans *, void *,
|
|||||||
xfs_fileoff_t, xfs_filblks_t, int,
|
xfs_fileoff_t, xfs_filblks_t, int,
|
||||||
xfs_fsblock_t *, xfs_extlen_t,
|
xfs_fsblock_t *, xfs_extlen_t,
|
||||||
struct xfs_bmbt_irec *, int *,
|
struct xfs_bmbt_irec *, int *,
|
||||||
struct xfs_bmap_free *);
|
struct xfs_bmap_free *, struct xfs_extdelta *);
|
||||||
|
typedef int (*xfs_bunmapi_t)(struct xfs_trans *,
|
||||||
|
void *, xfs_fileoff_t,
|
||||||
|
xfs_filblks_t, int, xfs_extnum_t,
|
||||||
|
xfs_fsblock_t *, struct xfs_bmap_free *,
|
||||||
|
struct xfs_extdelta *, int *);
|
||||||
typedef int (*xfs_bmap_eof_t)(void *, xfs_fileoff_t, int, int *);
|
typedef int (*xfs_bmap_eof_t)(void *, xfs_fileoff_t, int, int *);
|
||||||
typedef int (*xfs_iomap_write_direct_t)(
|
typedef int (*xfs_iomap_write_direct_t)(
|
||||||
void *, xfs_off_t, size_t, int,
|
void *, xfs_off_t, size_t, int,
|
||||||
@@ -214,10 +221,13 @@ typedef int (*xfs_lock_nowait_t)(void *, uint);
|
|||||||
typedef void (*xfs_unlk_t)(void *, unsigned int);
|
typedef void (*xfs_unlk_t)(void *, unsigned int);
|
||||||
typedef xfs_fsize_t (*xfs_size_t)(void *);
|
typedef xfs_fsize_t (*xfs_size_t)(void *);
|
||||||
typedef xfs_fsize_t (*xfs_iodone_t)(struct vfs *);
|
typedef xfs_fsize_t (*xfs_iodone_t)(struct vfs *);
|
||||||
|
typedef int (*xfs_swap_extents_t)(void *, void *,
|
||||||
|
struct xfs_swapext*);
|
||||||
|
|
||||||
typedef struct xfs_ioops {
|
typedef struct xfs_ioops {
|
||||||
xfs_ioinit_t xfs_ioinit;
|
xfs_ioinit_t xfs_ioinit;
|
||||||
xfs_bmapi_t xfs_bmapi_func;
|
xfs_bmapi_t xfs_bmapi_func;
|
||||||
|
xfs_bunmapi_t xfs_bunmapi_func;
|
||||||
xfs_bmap_eof_t xfs_bmap_eof_func;
|
xfs_bmap_eof_t xfs_bmap_eof_func;
|
||||||
xfs_iomap_write_direct_t xfs_iomap_write_direct;
|
xfs_iomap_write_direct_t xfs_iomap_write_direct;
|
||||||
xfs_iomap_write_delay_t xfs_iomap_write_delay;
|
xfs_iomap_write_delay_t xfs_iomap_write_delay;
|
||||||
@@ -230,13 +240,17 @@ typedef struct xfs_ioops {
|
|||||||
xfs_unlk_t xfs_unlock;
|
xfs_unlk_t xfs_unlock;
|
||||||
xfs_size_t xfs_size_func;
|
xfs_size_t xfs_size_func;
|
||||||
xfs_iodone_t xfs_iodone;
|
xfs_iodone_t xfs_iodone;
|
||||||
|
xfs_swap_extents_t xfs_swap_extents_func;
|
||||||
} xfs_ioops_t;
|
} xfs_ioops_t;
|
||||||
|
|
||||||
#define XFS_IOINIT(vfsp, args, flags) \
|
#define XFS_IOINIT(vfsp, args, flags) \
|
||||||
(*(mp)->m_io_ops.xfs_ioinit)(vfsp, args, flags)
|
(*(mp)->m_io_ops.xfs_ioinit)(vfsp, args, flags)
|
||||||
#define XFS_BMAPI(mp, trans,io,bno,len,f,first,tot,mval,nmap,flist) \
|
#define XFS_BMAPI(mp, trans,io,bno,len,f,first,tot,mval,nmap,flist,delta) \
|
||||||
(*(mp)->m_io_ops.xfs_bmapi_func) \
|
(*(mp)->m_io_ops.xfs_bmapi_func) \
|
||||||
(trans,(io)->io_obj,bno,len,f,first,tot,mval,nmap,flist)
|
(trans,(io)->io_obj,bno,len,f,first,tot,mval,nmap,flist,delta)
|
||||||
|
#define XFS_BUNMAPI(mp, trans,io,bno,len,f,nexts,first,flist,delta,done) \
|
||||||
|
(*(mp)->m_io_ops.xfs_bunmapi_func) \
|
||||||
|
(trans,(io)->io_obj,bno,len,f,nexts,first,flist,delta,done)
|
||||||
#define XFS_BMAP_EOF(mp, io, endoff, whichfork, eof) \
|
#define XFS_BMAP_EOF(mp, io, endoff, whichfork, eof) \
|
||||||
(*(mp)->m_io_ops.xfs_bmap_eof_func) \
|
(*(mp)->m_io_ops.xfs_bmap_eof_func) \
|
||||||
((io)->io_obj, endoff, whichfork, eof)
|
((io)->io_obj, endoff, whichfork, eof)
|
||||||
@@ -266,6 +280,9 @@ typedef struct xfs_ioops {
|
|||||||
(*(mp)->m_io_ops.xfs_size_func)((io)->io_obj)
|
(*(mp)->m_io_ops.xfs_size_func)((io)->io_obj)
|
||||||
#define XFS_IODONE(vfsp) \
|
#define XFS_IODONE(vfsp) \
|
||||||
(*(mp)->m_io_ops.xfs_iodone)(vfsp)
|
(*(mp)->m_io_ops.xfs_iodone)(vfsp)
|
||||||
|
#define XFS_SWAP_EXTENTS(mp, io, tio, sxp) \
|
||||||
|
(*(mp)->m_io_ops.xfs_swap_extents_func) \
|
||||||
|
((io)->io_obj, (tio)->io_obj, sxp)
|
||||||
|
|
||||||
#ifdef HAVE_PERCPU_SB
|
#ifdef HAVE_PERCPU_SB
|
||||||
|
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ xfs_growfs_rt_alloc(
|
|||||||
cancelflags |= XFS_TRANS_ABORT;
|
cancelflags |= XFS_TRANS_ABORT;
|
||||||
error = xfs_bmapi(tp, ip, oblocks, nblocks - oblocks,
|
error = xfs_bmapi(tp, ip, oblocks, nblocks - oblocks,
|
||||||
XFS_BMAPI_WRITE | XFS_BMAPI_METADATA, &firstblock,
|
XFS_BMAPI_WRITE | XFS_BMAPI_METADATA, &firstblock,
|
||||||
resblks, &map, &nmap, &flist);
|
resblks, &map, &nmap, &flist, NULL);
|
||||||
if (!error && nmap < 1)
|
if (!error && nmap < 1)
|
||||||
error = XFS_ERROR(ENOSPC);
|
error = XFS_ERROR(ENOSPC);
|
||||||
if (error)
|
if (error)
|
||||||
|
|||||||
+17
-17
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2000-2005 Silicon Graphics, Inc.
|
* Copyright (c) 2000-2006 Silicon Graphics, Inc.
|
||||||
* All Rights Reserved.
|
* All Rights Reserved.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
@@ -1000,7 +1000,7 @@ xfs_readlink(
|
|||||||
nmaps = SYMLINK_MAPS;
|
nmaps = SYMLINK_MAPS;
|
||||||
|
|
||||||
error = xfs_bmapi(NULL, ip, 0, XFS_B_TO_FSB(mp, pathlen),
|
error = xfs_bmapi(NULL, ip, 0, XFS_B_TO_FSB(mp, pathlen),
|
||||||
0, NULL, 0, mval, &nmaps, NULL);
|
0, NULL, 0, mval, &nmaps, NULL, NULL);
|
||||||
|
|
||||||
if (error) {
|
if (error) {
|
||||||
goto error_return;
|
goto error_return;
|
||||||
@@ -1208,8 +1208,8 @@ xfs_inactive_free_eofblocks(
|
|||||||
|
|
||||||
nimaps = 1;
|
nimaps = 1;
|
||||||
xfs_ilock(ip, XFS_ILOCK_SHARED);
|
xfs_ilock(ip, XFS_ILOCK_SHARED);
|
||||||
error = xfs_bmapi(NULL, ip, end_fsb, map_len, 0,
|
error = XFS_BMAPI(mp, NULL, &ip->i_iocore, end_fsb, map_len, 0,
|
||||||
NULL, 0, &imap, &nimaps, NULL);
|
NULL, 0, &imap, &nimaps, NULL, NULL);
|
||||||
xfs_iunlock(ip, XFS_ILOCK_SHARED);
|
xfs_iunlock(ip, XFS_ILOCK_SHARED);
|
||||||
|
|
||||||
if (!error && (nimaps != 0) &&
|
if (!error && (nimaps != 0) &&
|
||||||
@@ -1338,7 +1338,7 @@ xfs_inactive_symlink_rmt(
|
|||||||
nmaps = ARRAY_SIZE(mval);
|
nmaps = ARRAY_SIZE(mval);
|
||||||
if ((error = xfs_bmapi(tp, ip, 0, XFS_B_TO_FSB(mp, size),
|
if ((error = xfs_bmapi(tp, ip, 0, XFS_B_TO_FSB(mp, size),
|
||||||
XFS_BMAPI_METADATA, &first_block, 0, mval, &nmaps,
|
XFS_BMAPI_METADATA, &first_block, 0, mval, &nmaps,
|
||||||
&free_list)))
|
&free_list, NULL)))
|
||||||
goto error0;
|
goto error0;
|
||||||
/*
|
/*
|
||||||
* Invalidate the block(s).
|
* Invalidate the block(s).
|
||||||
@@ -1353,7 +1353,7 @@ xfs_inactive_symlink_rmt(
|
|||||||
* Unmap the dead block(s) to the free_list.
|
* Unmap the dead block(s) to the free_list.
|
||||||
*/
|
*/
|
||||||
if ((error = xfs_bunmapi(tp, ip, 0, size, XFS_BMAPI_METADATA, nmaps,
|
if ((error = xfs_bunmapi(tp, ip, 0, size, XFS_BMAPI_METADATA, nmaps,
|
||||||
&first_block, &free_list, &done)))
|
&first_block, &free_list, NULL, &done)))
|
||||||
goto error1;
|
goto error1;
|
||||||
ASSERT(done);
|
ASSERT(done);
|
||||||
/*
|
/*
|
||||||
@@ -3457,7 +3457,7 @@ xfs_symlink(
|
|||||||
error = xfs_bmapi(tp, ip, first_fsb, fs_blocks,
|
error = xfs_bmapi(tp, ip, first_fsb, fs_blocks,
|
||||||
XFS_BMAPI_WRITE | XFS_BMAPI_METADATA,
|
XFS_BMAPI_WRITE | XFS_BMAPI_METADATA,
|
||||||
&first_block, resblks, mval, &nmaps,
|
&first_block, resblks, mval, &nmaps,
|
||||||
&free_list);
|
&free_list, NULL);
|
||||||
if (error) {
|
if (error) {
|
||||||
goto error1;
|
goto error1;
|
||||||
}
|
}
|
||||||
@@ -4116,10 +4116,10 @@ retry:
|
|||||||
* Issue the xfs_bmapi() call to allocate the blocks
|
* Issue the xfs_bmapi() call to allocate the blocks
|
||||||
*/
|
*/
|
||||||
XFS_BMAP_INIT(&free_list, &firstfsb);
|
XFS_BMAP_INIT(&free_list, &firstfsb);
|
||||||
error = xfs_bmapi(tp, ip, startoffset_fsb,
|
error = XFS_BMAPI(mp, tp, &ip->i_iocore, startoffset_fsb,
|
||||||
allocatesize_fsb, bmapi_flag,
|
allocatesize_fsb, bmapi_flag,
|
||||||
&firstfsb, 0, imapp, &nimaps,
|
&firstfsb, 0, imapp, &nimaps,
|
||||||
&free_list);
|
&free_list, NULL);
|
||||||
if (error) {
|
if (error) {
|
||||||
goto error0;
|
goto error0;
|
||||||
}
|
}
|
||||||
@@ -4199,8 +4199,8 @@ xfs_zero_remaining_bytes(
|
|||||||
for (offset = startoff; offset <= endoff; offset = lastoffset + 1) {
|
for (offset = startoff; offset <= endoff; offset = lastoffset + 1) {
|
||||||
offset_fsb = XFS_B_TO_FSBT(mp, offset);
|
offset_fsb = XFS_B_TO_FSBT(mp, offset);
|
||||||
nimap = 1;
|
nimap = 1;
|
||||||
error = xfs_bmapi(NULL, ip, offset_fsb, 1, 0, NULL, 0, &imap,
|
error = XFS_BMAPI(mp, NULL, &ip->i_iocore, offset_fsb, 1, 0,
|
||||||
&nimap, NULL);
|
NULL, 0, &imap, &nimap, NULL, NULL);
|
||||||
if (error || nimap < 1)
|
if (error || nimap < 1)
|
||||||
break;
|
break;
|
||||||
ASSERT(imap.br_blockcount >= 1);
|
ASSERT(imap.br_blockcount >= 1);
|
||||||
@@ -4338,8 +4338,8 @@ xfs_free_file_space(
|
|||||||
*/
|
*/
|
||||||
if (rt && !XFS_SB_VERSION_HASEXTFLGBIT(&mp->m_sb)) {
|
if (rt && !XFS_SB_VERSION_HASEXTFLGBIT(&mp->m_sb)) {
|
||||||
nimap = 1;
|
nimap = 1;
|
||||||
error = xfs_bmapi(NULL, ip, startoffset_fsb, 1, 0, NULL, 0,
|
error = XFS_BMAPI(mp, NULL, &ip->i_iocore, startoffset_fsb,
|
||||||
&imap, &nimap, NULL);
|
1, 0, NULL, 0, &imap, &nimap, NULL, NULL);
|
||||||
if (error)
|
if (error)
|
||||||
goto out_unlock_iolock;
|
goto out_unlock_iolock;
|
||||||
ASSERT(nimap == 0 || nimap == 1);
|
ASSERT(nimap == 0 || nimap == 1);
|
||||||
@@ -4353,8 +4353,8 @@ xfs_free_file_space(
|
|||||||
startoffset_fsb += mp->m_sb.sb_rextsize - mod;
|
startoffset_fsb += mp->m_sb.sb_rextsize - mod;
|
||||||
}
|
}
|
||||||
nimap = 1;
|
nimap = 1;
|
||||||
error = xfs_bmapi(NULL, ip, endoffset_fsb - 1, 1, 0, NULL, 0,
|
error = XFS_BMAPI(mp, NULL, &ip->i_iocore, endoffset_fsb - 1,
|
||||||
&imap, &nimap, NULL);
|
1, 0, NULL, 0, &imap, &nimap, NULL, NULL);
|
||||||
if (error)
|
if (error)
|
||||||
goto out_unlock_iolock;
|
goto out_unlock_iolock;
|
||||||
ASSERT(nimap == 0 || nimap == 1);
|
ASSERT(nimap == 0 || nimap == 1);
|
||||||
@@ -4426,9 +4426,9 @@ xfs_free_file_space(
|
|||||||
* issue the bunmapi() call to free the blocks
|
* issue the bunmapi() call to free the blocks
|
||||||
*/
|
*/
|
||||||
XFS_BMAP_INIT(&free_list, &firstfsb);
|
XFS_BMAP_INIT(&free_list, &firstfsb);
|
||||||
error = xfs_bunmapi(tp, ip, startoffset_fsb,
|
error = XFS_BUNMAPI(mp, tp, &ip->i_iocore, startoffset_fsb,
|
||||||
endoffset_fsb - startoffset_fsb,
|
endoffset_fsb - startoffset_fsb,
|
||||||
0, 2, &firstfsb, &free_list, &done);
|
0, 2, &firstfsb, &free_list, NULL, &done);
|
||||||
if (error) {
|
if (error) {
|
||||||
goto error0;
|
goto error0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user