aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/fs/xfs/xfs_inode.h
diff options
context:
space:
mode:
authorBrian Foster <bfoster@redhat.com>2018-05-10 09:35:42 -0700
committerDarrick J. Wong <darrick.wong@oracle.com>2018-05-15 17:57:05 -0700
commit4e529339af15226a30e0ca044aa2d78ba3518494 (patch)
tree39c57177919a3f48ec4d934401951ab625ca75f0 /fs/xfs/xfs_inode.h
parentiomap: add a swapfile activation function (diff)
downloadwireguard-linux-4e529339af15226a30e0ca044aa2d78ba3518494.tar.xz
wireguard-linux-4e529339af15226a30e0ca044aa2d78ba3518494.zip
xfs: factor out nodiscard helpers
The changes to skip discards of speculative preallocation and unwritten extents introduced several new wrapper functions through the bunmapi -> extent free codepath to reduce churn in all of the associated callers. In several cases, these wrappers simply toggle a single flag to skip or not skip discards for the resulting blocks. The explicit _nodiscard() wrappers for such an isolated set of callers is a bit overkill. Kill off these wrappers and replace with the calls to the underlying functions in the contexts that need to control discard behavior. Retain the wrappers that preserve the original calling conventions to serve the original purpose of reducing code churn. This is a refactoring patch and does not change behavior. Signed-off-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs/xfs_inode.h')
-rw-r--r--fs/xfs/xfs_inode.h16
1 files changed, 3 insertions, 13 deletions
diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h
index 3dd3201f4409..00fee6824745 100644
--- a/fs/xfs/xfs_inode.h
+++ b/fs/xfs/xfs_inode.h
@@ -415,8 +415,8 @@ uint xfs_ilock_attr_map_shared(struct xfs_inode *);
uint xfs_ip2xflags(struct xfs_inode *);
int xfs_ifree(struct xfs_trans *, xfs_inode_t *,
struct xfs_defer_ops *);
-int __xfs_itruncate_extents(struct xfs_trans **, struct xfs_inode *,
- int, xfs_fsize_t, bool);
+int xfs_itruncate_extents_flags(struct xfs_trans **,
+ struct xfs_inode *, int, xfs_fsize_t, int);
void xfs_iext_realloc(xfs_inode_t *, int, int);
void xfs_iunpin_wait(xfs_inode_t *);
@@ -440,17 +440,7 @@ xfs_itruncate_extents(
int whichfork,
xfs_fsize_t new_size)
{
- return __xfs_itruncate_extents(tpp, ip, whichfork, new_size, false);
-}
-
-static inline int
-xfs_itruncate_extents_nodiscard(
- struct xfs_trans **tpp,
- struct xfs_inode *ip,
- int whichfork,
- xfs_fsize_t new_size)
-{
- return __xfs_itruncate_extents(tpp, ip, whichfork, new_size, true);
+ return xfs_itruncate_extents_flags(tpp, ip, whichfork, new_size, 0);
}
/* from xfs_file.c */