From 6898811459ff523ed256c07d1d5c54ba915d51ac Mon Sep 17 00:00:00 2001 From: Dave Chinner Date: Mon, 12 Aug 2013 20:49:42 +1000 Subject: xfs: create xfs_bmap_util.[ch] There is a bunch of code in xfs_bmap.c that is kernel specific and not shared with userspace. To minimise the difference between the kernel and userspace code, shift this unshared code to xfs_bmap_util.c, and the declarations to xfs_bmap_util.h. The biggest issue here is xfs_bmap_finish() - userspace has it's own definition of this function, and so we need to move it out of xfs_bmap.[ch]. This means several other files need to include xfs_bmap_util.h as well. It also introduces and interesting dance for the stack switching code in xfs_bmapi_allocate(). The stack switching/workqueue code is actually moved to xfs_bmap_util.c, so that userspace can simply use a #define in a header file to connect the dots without needing to know about the stack switch code at all. Signed-off-by: Dave Chinner Reviewed-by: Mark Tinguely Signed-off-by: Ben Myers --- fs/xfs/xfs_filestream.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'fs/xfs/xfs_filestream.c') diff --git a/fs/xfs/xfs_filestream.c b/fs/xfs/xfs_filestream.c index 9eae097ca223..d0e8890dac86 100644 --- a/fs/xfs/xfs_filestream.c +++ b/fs/xfs/xfs_filestream.c @@ -26,6 +26,7 @@ #include "xfs_sb.h" #include "xfs_mount.h" #include "xfs_bmap.h" +#include "xfs_bmap_util.h" #include "xfs_alloc.h" #include "xfs_utils.h" #include "xfs_mru_cache.h" @@ -668,8 +669,8 @@ exit: */ int xfs_filestream_new_ag( - xfs_bmalloca_t *ap, - xfs_agnumber_t *agp) + struct xfs_bmalloca *ap, + xfs_agnumber_t *agp) { int flags, err; xfs_inode_t *ip, *pip = NULL; -- cgit v1.2.3