From: Dave Chinner Date: Wed, 4 Sep 2013 22:05:39 +0000 (+0000) Subject: xfs: move swap extent code to xfs_extent_ops X-Git-Tag: v3.2.0-alpha1~22 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e334fb793b1f4aedf04926f17ee0179f48e55315;p=thirdparty%2Fxfsprogs-dev.git xfs: move swap extent code to xfs_extent_ops Swapping extents is clearly an extent operaiton, and it is not shared with userspace. Move the code to xfs_extent_ops.[ch], and the userspace ioctl structure definition to xfs_fs.h where most of the other ioctl structure definitions are. The means xfs_dfrag.h is no longer needed in userspace. Signed-off-by: Dave Chinner Reviewed-by: Mark Tinguely Signed-off-by: Rich Johnston --- diff --git a/fsr/xfs_fsr.c b/fsr/xfs_fsr.c index 7e518c12b..7596834ae 100644 --- a/fsr/xfs_fsr.c +++ b/fsr/xfs_fsr.c @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include diff --git a/include/Makefile b/include/Makefile index 45b853399..628a0875c 100644 --- a/include/Makefile +++ b/include/Makefile @@ -40,8 +40,7 @@ QAHFILES = libxfs.h libxlog.h \ xfs_sb.h \ xfs_trace.h \ xfs_trans_resv.h \ - xfs_trans_space.h \ - xfs_dfrag.h + xfs_trans_space.h HFILES = handle.h jdm.h xqm.h xfs.h xfs_fs.h xfs_types.h HFILES += $(PKG_PLATFORM).h diff --git a/include/xfs_dfrag.h b/include/xfs_dfrag.h deleted file mode 100644 index 20bdd935c..000000000 --- a/include/xfs_dfrag.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2000,2005 Silicon Graphics, Inc. - * All Rights Reserved. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it would be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ -#ifndef __XFS_DFRAG_H__ -#define __XFS_DFRAG_H__ - -/* - * Structure passed to xfs_swapext - */ - -typedef struct xfs_swapext -{ - __int64_t sx_version; /* version */ - __int64_t sx_fdtarget; /* fd of target file */ - __int64_t sx_fdtmp; /* fd of tmp file */ - xfs_off_t sx_offset; /* offset into file */ - xfs_off_t sx_length; /* leng from offset */ - char sx_pad[16]; /* pad space, unused */ - xfs_bstat_t sx_stat; /* stat of target b4 copy */ -} xfs_swapext_t; - -/* - * Version flag - */ -#define XFS_SX_VERSION 0 - -#ifdef __KERNEL__ -/* - * Prototypes for visible xfs_dfrag.c routines. - */ - -/* - * Syscall interface for xfs_swapext - */ -int xfs_swapext(struct xfs_swapext *sx); - -#endif /* __KERNEL__ */ - -#endif /* __XFS_DFRAG_H__ */ diff --git a/include/xfs_fs.h b/include/xfs_fs.h index 68c2e18f7..74b24b2ec 100644 --- a/include/xfs_fs.h +++ b/include/xfs_fs.h @@ -460,6 +460,21 @@ typedef struct xfs_handle { - (char *) &(handle)) \ + (handle).ha_fid.fid_len) +/* + * Structure passed to XFS_IOC_SWAPEXT + */ +typedef struct xfs_swapext +{ + __int64_t sx_version; /* version */ +#define XFS_SX_VERSION 0 + __int64_t sx_fdtarget; /* fd of target file */ + __int64_t sx_fdtmp; /* fd of tmp file */ + xfs_off_t sx_offset; /* offset into file */ + xfs_off_t sx_length; /* leng from offset */ + char sx_pad[16]; /* pad space, unused */ + xfs_bstat_t sx_stat; /* stat of target b4 copy */ +} xfs_swapext_t; + /* * Flags for going down operation */