diff -ruN linux-2.6.9/fs/xfs/xfs_clnt.h linux-2.6.9-pkeep/fs/xfs/xfs_clnt.h --- linux-2.6.9/fs/xfs/xfs_clnt.h 2004-10-18 23:54:38.000000000 +0200 +++ linux-2.6.9-pkeep/fs/xfs/xfs_clnt.h 2004-11-26 14:07:52.000000000 +0100 @@ -102,5 +102,7 @@ #define XFSMNT_IDELETE 0x08000000 /* inode cluster delete */ #define XFSMNT_SWALLOC 0x10000000 /* turn on stripe width * allocation */ +#define XFSMNT_PKEEP 0x20000000 /* keep preallocated blocks + after close() */ #endif /* __XFS_CLNT_H__ */ diff -ruN linux-2.6.9/fs/xfs/xfs_mount.h linux-2.6.9-pkeep/fs/xfs/xfs_mount.h --- linux-2.6.9/fs/xfs/xfs_mount.h 2004-10-18 23:53:05.000000000 +0200 +++ linux-2.6.9-pkeep/fs/xfs/xfs_mount.h 2004-11-26 14:13:47.000000000 +0100 @@ -418,6 +418,8 @@ #define XFS_MOUNT_IDELETE 0x00040000 /* delete empty inode clusters*/ #define XFS_MOUNT_SWALLOC 0x00080000 /* turn on stripe width * allocation */ +#define XFS_MOUNT_PKEEP 0x00080000 /* keep preallocated blocks + * after close() */ /* * Default minimum read and write sizes. @@ -429,7 +431,7 @@ * Max and min values for UIO and mount-option defined I/O sizes; * min value can't be less than a page. Currently unused. */ -#define XFS_MAX_IO_LOG 16 /* 64K */ +#define XFS_MAX_IO_LOG 26 /* 64M */ #define XFS_MIN_IO_LOG PAGE_SHIFT /* diff -ruN linux-2.6.9/fs/xfs/xfs_vfsops.c linux-2.6.9-pkeep/fs/xfs/xfs_vfsops.c --- linux-2.6.9/fs/xfs/xfs_vfsops.c 2004-10-18 23:53:43.000000000 +0200 +++ linux-2.6.9-pkeep/fs/xfs/xfs_vfsops.c 2004-11-26 14:10:13.000000000 +0100 @@ -320,6 +320,8 @@ mp->m_flags |= XFS_MOUNT_NOUUID; if (ap->flags & XFSMNT_NOLOGFLUSH) mp->m_flags |= XFS_MOUNT_NOLOGFLUSH; + if (ap->flags & XFSMNT_PKEEP) + mp->m_flags |= XFS_MOUNT_PKEEP; return 0; } @@ -1652,6 +1654,7 @@ #define MNTOPT_64BITINODE "inode64" /* inodes can be allocated anywhere */ #define MNTOPT_IKEEP "ikeep" /* do not free empty inode clusters */ #define MNTOPT_NOIKEEP "noikeep" /* free empty inode clusters */ +#define MNTOPT_PKEEP "pkeep" /* do not free preallocs on close */ int @@ -1776,6 +1779,8 @@ args->flags |= XFSMNT_NOUUID; } else if (!strcmp(this_char, MNTOPT_NOLOGFLUSH)) { args->flags |= XFSMNT_NOLOGFLUSH; + } else if (!strcmp(this_char, MNTOPT_PKEEP)) { + args->flags |= XFSMNT_PKEEP; } else if (!strcmp(this_char, MNTOPT_IKEEP)) { args->flags &= ~XFSMNT_IDELETE; } else if (!strcmp(this_char, MNTOPT_NOIKEEP)) { @@ -1851,6 +1856,7 @@ { XFS_MOUNT_OSYNCISOSYNC, "," MNTOPT_OSYNCISOSYNC }, { XFS_MOUNT_NOLOGFLUSH, "," MNTOPT_NOLOGFLUSH }, { XFS_MOUNT_IDELETE, "," MNTOPT_NOIKEEP }, + { XFS_MOUNT_PKEEP, "," MNTOPT_PKEEP }, { 0, NULL } }; struct proc_xfs_info *xfs_infop; diff -ruN linux-2.6.9/fs/xfs/xfs_vnodeops.c linux-2.6.9-pkeep/fs/xfs/xfs_vnodeops.c --- linux-2.6.9/fs/xfs/xfs_vnodeops.c 2004-10-18 23:55:36.000000000 +0200 +++ linux-2.6.9-pkeep/fs/xfs/xfs_vnodeops.c 2004-11-26 14:12:53.000000000 +0100 @@ -1214,6 +1214,13 @@ xfs_bmbt_irec_t imap; /* + * If mounted with the "pkeep" option, do not remove any + * preallocated blocks at the end of the file at close(). + */ + if (mp->m_flags & XFS_MOUNT_PKEEP) + return (0); + + /* * Figure out if there are any blocks beyond the end * of the file. If not, then there is nothing to do. */