xfsprogs: xfs_reno(8)
PATCH 1/1 xfsprogs: xfs_reno(8)
Hello,
This is a revised version of xfs_reno(8), originally from Barry. Currently, it works for regular files but failed for swapping directories. I post it here since I tried to test the inode swap ioctl(2) via this program, but it does not means that I took over this task.
I'll only continue to improve it if nobody is working on this tools.
Thanks,
-Jeff
Signed-off-by Barry Naujok <[email protected]>
Signed-off-by Jie Liu <[email protected]>
--- Makefile | 2 +- include/xfs_dfrag.h | 20 + include/xfs_fs.h | 8 + reno/Makefile | 34 ++ reno/xfs_reno.c | 1647 +++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 1710 insertions(+), 1 deletion(-) create mode 100644 reno/Makefile create mode 100644 reno/xfs_reno.c
Makefile +1 -1
@@ -41,7 +41,7 @@ endif LIB_SUBDIRS = libxfs libxlog libxcmd libhandle libdisk TOOL_SUBDIRS = copy db estimate fsck fsr growfs io logprint mkfs quota \ - mdrestore repair rtcp m4 man doc po debian + mdrestore repair rtcp reno m4 man doc po debian SUBDIRS = include $(LIB_SUBDIRS) $(TOOL_SUBDIRS)
include/xfs_dfrag.h +20 -0
@@ -38,6 +38,21 @@ typedef struct xfs_swapext*/ #define XFS_SX_VERSION 0 +/* +* Structure passed to xfs_swapino. +*/ +typedef struct xfs_swapino { +__int64_t si_version;/* version */ +__int64_t si_fdtarget;/* fd of target file */ +__int64_t si_fdtmp;/* fd of temp file */ +char si_pad[16 ];/* pad space, unused */ +}xfs_swapino_t ; + +/* +* Version flag. +*/ +#define XFS_SI_VERSION 0 +#ifdef __KERNEL__/* * Prototypes for visible xfs_dfrag.c routines.
@@ -48,6 +63,11 @@ typedef struct xfs_swapext*/ int xfs_swapext (struct xfs_swapext *sx); +/* +* Syscall interface for xfs_swapino +*/ +int xfs_swapino (struct xfs_swapino *si); +#endif /* __KERNEL__ */ #endif /* __XFS_DFRAG_H__ */
include/xfs_fs.h +8 -0
@@ -267,6 +267,10 @@ typedef struct xfs_growfs_rt {__u32 extsize;/* new realtime extent size, fsblocks */ } xfs_growfs_rt_t; +typedef struct xfs_shrinkfs_data { +__u64 newblocks; +__u32 imaxpct; +}xfs_shrinkfs_data_t ;/* * Structures returned from ioctl XFS_IOC_FSBULKSTAT & XFS_IOC_FSBULKSTAT_SINGLE
@@ -483,6 +487,10 @@ typedef struct xfs_handle {#define XFS_IOC_ATTRMULTI_BY_HANDLE _IOW ('X', 123, struct xfs_fsop_attrmulti_handlereq)#define XFS_IOC_FSGEOMETRY _IOR ('X', 124, struct xfs_fsop_geom)#define XFS_IOC_GOINGDOWN _IOR ('X', 125, __uint32_t) +#define XFS_IOC_SET_AGSTATE _IOW ('X', 126, struct xfs_ioc_agstate) +#define XFS_IOC_GET_AGSTATE _IOR ('X', 127, struct xfs_ioc_agstate) +#define XFS_IOC_SWAPINO _IOWR ('X', 128, struct xfs_swapino) +#define XFS_IOC_FSSHRINKFS_DATA _IOW ('X', 129, struct xfs_shrinkfs_data)/* XFS_IOC_GETFSUUID ---------- deprecated 140 */
reno/Makefile new file +34 -0
@@ -0,0 +1,34 @@ +# +# Copyright (c) 2000-2001,2004-2005 Silicon Graphics, Inc. All Rights Reserved. +# + +TOPDIR = .. +include $(TOPDIR)/include/builddefs + +LTCOMMAND = xfs_reno + +CFILES = xfs_reno.c + +LLDLIBS = $(LIBXFS) $(LIBXCMD) $(LIBUUID) $(LIBRT) $(LIBPTHREAD) +ifeq ($(ENABLE_READLINE),yes) +LLDLIBS += $(LIBREADLINE) $(LIBTERMCAP) +endif + +ifeq ($(ENABLE_EDITLINE),yes) +LLDLIBS += $(LIBEDITLINE) $(LIBTERMCAP) +endif + +LTDEPENDENCIES = $(LIBXFS) $(LIBXCMD) +LLDFLAGS = -static + +default: depend $(LTCOMMAND) + +include $(BUILDRULES) + +install: default + $(INSTALL) -m 755 -d $(PKG_SBIN_DIR) + $(LTINSTALL) -m 755 $(LTCOMMAND) $(PKG_SBIN_DIR) + $(INSTALL) -m 755 xfs_reno $(PKG_SBIN_DIR)/xfs_reno +install-dev: + +-include .dep
reno/xfs_reno.c new file +1647 -0
1,647 lines not on this page · raw message
Signature · 6 lines
1.7.9.5 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs