]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
Add degframentation exclusion support
authorBarry Naujok <bnaujok@sgi.com>
Fri, 19 May 2006 06:08:50 +0000 (06:08 +0000)
committerBarry Naujok <bnaujok@sgi.com>
Fri, 19 May 2006 06:08:50 +0000 (06:08 +0000)
Merge of master-melb:xfs-cmds:25987a by kenmcd.

  Add no-defrag flag support to xfs_db

db/inode.c
include/xfs_dinode.h
include/xfs_fs.h
io/attr.c
man/man3/xfsctl.3

index 7a76e178f56bc82065b7f5c2b48a896cbd91fdeb..597464aedcb2becb3436f81122eed0469c588511 100644 (file)
@@ -138,6 +138,9 @@ const field_t       inode_core_flds[] = {
        { "extszinherit", FLDT_UINT1,
          OI(COFF(flags) + bitsz(__uint16_t) - XFS_DIFLAG_EXTSZINHERIT_BIT-1),C1,
          0, TYP_NONE },
+       { "nodefrag", FLDT_UINT1,
+         OI(COFF(flags) + bitsz(__uint16_t) - XFS_DIFLAG_NODEFRAG_BIT-1),C1,
+         0, TYP_NONE },
        { "gen", FLDT_UINT32D, OI(COFF(gen)), C1, 0, TYP_NONE },
        { NULL }
 };
index 79d0d9e1fbabc8d4f38061c1191dd978fc447791..77d537782586242a10d4525542af5dfd2efa0ab0 100644 (file)
@@ -257,6 +257,7 @@ typedef enum xfs_dinode_fmt
 #define XFS_DIFLAG_NOSYMLINKS_BIT   10 /* disallow symlink creation */
 #define XFS_DIFLAG_EXTSIZE_BIT      11 /* inode extent size allocator hint */
 #define XFS_DIFLAG_EXTSZINHERIT_BIT 12 /* inherit inode extent size */
+#define XFS_DIFLAG_NODEFRAG_BIT     13 /* do not reorganize/defragment */
 #define XFS_DIFLAG_REALTIME      (1 << XFS_DIFLAG_REALTIME_BIT)
 #define XFS_DIFLAG_PREALLOC      (1 << XFS_DIFLAG_PREALLOC_BIT)
 #define XFS_DIFLAG_NEWRTBM       (1 << XFS_DIFLAG_NEWRTBM_BIT)
@@ -270,12 +271,13 @@ typedef enum xfs_dinode_fmt
 #define XFS_DIFLAG_NOSYMLINKS    (1 << XFS_DIFLAG_NOSYMLINKS_BIT)
 #define XFS_DIFLAG_EXTSIZE       (1 << XFS_DIFLAG_EXTSIZE_BIT)
 #define XFS_DIFLAG_EXTSZINHERIT  (1 << XFS_DIFLAG_EXTSZINHERIT_BIT)
+#define XFS_DIFLAG_NODEFRAG      (1 << XFS_DIFLAG_NODEFRAG_BIT)
 
 #define XFS_DIFLAG_ANY \
        (XFS_DIFLAG_REALTIME | XFS_DIFLAG_PREALLOC | XFS_DIFLAG_NEWRTBM | \
         XFS_DIFLAG_IMMUTABLE | XFS_DIFLAG_APPEND | XFS_DIFLAG_SYNC | \
         XFS_DIFLAG_NOATIME | XFS_DIFLAG_NODUMP | XFS_DIFLAG_RTINHERIT | \
         XFS_DIFLAG_PROJINHERIT | XFS_DIFLAG_NOSYMLINKS | XFS_DIFLAG_EXTSIZE | \
-        XFS_DIFLAG_EXTSZINHERIT)
+        XFS_DIFLAG_EXTSZINHERIT | XFS_DIFLAG_NODEFRAG)
 
 #endif /* __XFS_DINODE_H__ */
index 14010f1fa82ffe9c2f85f84290bac1236c21fd2e..a5591447182796bebcbe3fd2d3a5a02218141b9b 100644 (file)
@@ -67,6 +67,7 @@ struct fsxattr {
 #define XFS_XFLAG_NOSYMLINKS   0x00000400      /* disallow symlink creation */
 #define XFS_XFLAG_EXTSIZE      0x00000800      /* extent size allocator hint */
 #define XFS_XFLAG_EXTSZINHERIT 0x00001000      /* inherit inode extent size */
+#define XFS_XFLAG_NODEFRAG     0x00002000      /* do not defragment */
 #define XFS_XFLAG_HASATTR      0x80000000      /* no DIFLAG for this   */
 
 /*
index c59b3d928a6ad30522bcfcc2e18d9d54387f8df8..a2c6d55ecfea3543009e77c008726b6e86d9b8c4 100644 (file)
--- a/io/attr.c
+++ b/io/attr.c
@@ -46,9 +46,10 @@ static struct xflags {
        { XFS_XFLAG_NOSYMLINKS,         "n", "nosymlinks"       },
        { XFS_XFLAG_EXTSIZE,            "e", "extsize"          },
        { XFS_XFLAG_EXTSZINHERIT,       "E", "extsz-inherit"    },
+       { XFS_XFLAG_NODEFRAG,           "f", "no-defrag"        },
        { 0, NULL, NULL }
 };
-#define CHATTR_XFLAG_LIST      "r"/*p*/"iasAdtPneE"
+#define CHATTR_XFLAG_LIST      "r"/*p*/"iasAdtPneEf"
 
 static void
 lsattr_help(void)
@@ -70,6 +71,7 @@ lsattr_help(void)
 " n -- symbolic links cannot be created in this directory\n"
 " e -- for non-realtime files, observe the inode extent size value\n"
 " E -- children created in this directory inherit the extent size value\n"
+" f -- do not include this file when defragmenting the filesystem\n"
 "\n"
 " Options:\n"
 " -R -- recursively descend (useful when current file is a directory)\n"
@@ -103,6 +105,7 @@ chattr_help(void)
 " +/-n -- set/clear the no-symbolic-links flag\n"
 " +/-e -- set/clear the extent-size flag\n"
 " +/-E -- set/clear the extent-size inheritance flag\n"
+" +/-f -- set/clear the no-defrag flag\n"
 " Note1: user must have certain capabilities to modify immutable/append-only.\n"
 " Note2: immutable/append-only files cannot be deleted; removing these files\n"
 "        requires the immutable/append-only flag to be cleared first.\n"
index 78cf7af1367b2b1179b6f6f9c20c7f6f98f3cf6f..e88339978ce42e7d6be49e5637c34d344df976c5 100644 (file)
@@ -221,6 +221,11 @@ the directory will inherit the parents basic extent size value (see
 below).
 Can only be set on a directory.
 .TP
+.SM "Bit 13 (0x2000) \- XFS_XFLAG_NODEFRAG"
+The file should be skipped during a defragment operation. When
+applied to a directory, new files and directories created will
+inherit the no\-defrag bit.
+.TP
 .SM "Bit 31 (0x80000000) \- XFS_XFLAG_HASATTR"
 The file has extended attributes associated with it.
 .RE