diff options
author | Barry Naujok <bnaujok@sgi.com> | 2006-06-09 00:54:19 -0400 |
---|---|---|
committer | Nathan Scott <nathans@sgi.com> | 2006-06-09 00:54:19 -0400 |
commit | d3446eac3f50dade2f09ed212b112609ee78fb33 (patch) | |
tree | c3cf3fd0349975ef72e78a1ebbd06725c5b34d2a /fs | |
parent | fbc1462bcb421620a04eb390fc79a2615c9d01d0 (diff) |
[XFS] Add degframentation exclusion support
SGI-PV: 953061
SGI-Modid: xfs-linux-melb:xfs-kern:25986a
Signed-off-by: Barry Naujok <bnaujok@sgi.com>
Signed-off-by: Nathan Scott <nathans@sgi.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_globals.c | 1 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_linux.h | 1 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_sysctl.c | 5 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_sysctl.h | 2 | ||||
-rw-r--r-- | fs/xfs/xfs_dinode.h | 4 | ||||
-rw-r--r-- | fs/xfs/xfs_fs.h | 1 | ||||
-rw-r--r-- | fs/xfs/xfs_inode.c | 5 | ||||
-rw-r--r-- | fs/xfs/xfs_vnodeops.c | 2 |
8 files changed, 20 insertions, 1 deletions
diff --git a/fs/xfs/linux-2.6/xfs_globals.c b/fs/xfs/linux-2.6/xfs_globals.c index 6e8085f34635..6c162c3dde7e 100644 --- a/fs/xfs/linux-2.6/xfs_globals.c +++ b/fs/xfs/linux-2.6/xfs_globals.c | |||
@@ -45,6 +45,7 @@ xfs_param_t xfs_params = { | |||
45 | .xfs_buf_age = { 1*100, 15*100, 7200*100}, | 45 | .xfs_buf_age = { 1*100, 15*100, 7200*100}, |
46 | .inherit_nosym = { 0, 0, 1 }, | 46 | .inherit_nosym = { 0, 0, 1 }, |
47 | .rotorstep = { 1, 1, 255 }, | 47 | .rotorstep = { 1, 1, 255 }, |
48 | .inherit_nodfrg = { 0, 1, 1 }, | ||
48 | }; | 49 | }; |
49 | 50 | ||
50 | /* | 51 | /* |
diff --git a/fs/xfs/linux-2.6/xfs_linux.h b/fs/xfs/linux-2.6/xfs_linux.h index e9fe43d74768..7d15cb910275 100644 --- a/fs/xfs/linux-2.6/xfs_linux.h +++ b/fs/xfs/linux-2.6/xfs_linux.h | |||
@@ -134,6 +134,7 @@ BUFFER_FNS(PrivateStart, unwritten); | |||
134 | #define xfs_buf_age_centisecs xfs_params.xfs_buf_age.val | 134 | #define xfs_buf_age_centisecs xfs_params.xfs_buf_age.val |
135 | #define xfs_inherit_nosymlinks xfs_params.inherit_nosym.val | 135 | #define xfs_inherit_nosymlinks xfs_params.inherit_nosym.val |
136 | #define xfs_rotorstep xfs_params.rotorstep.val | 136 | #define xfs_rotorstep xfs_params.rotorstep.val |
137 | #define xfs_inherit_nodefrag xfs_params.inherit_nodfrg.val | ||
137 | 138 | ||
138 | #ifndef raw_smp_processor_id | 139 | #ifndef raw_smp_processor_id |
139 | #define raw_smp_processor_id() smp_processor_id() | 140 | #define raw_smp_processor_id() smp_processor_id() |
diff --git a/fs/xfs/linux-2.6/xfs_sysctl.c b/fs/xfs/linux-2.6/xfs_sysctl.c index 7079cc837210..4af97682bec8 100644 --- a/fs/xfs/linux-2.6/xfs_sysctl.c +++ b/fs/xfs/linux-2.6/xfs_sysctl.c | |||
@@ -120,6 +120,11 @@ STATIC ctl_table xfs_table[] = { | |||
120 | &sysctl_intvec, NULL, | 120 | &sysctl_intvec, NULL, |
121 | &xfs_params.rotorstep.min, &xfs_params.rotorstep.max}, | 121 | &xfs_params.rotorstep.min, &xfs_params.rotorstep.max}, |
122 | 122 | ||
123 | {XFS_INHERIT_NODFRG, "inherit_nodefrag", &xfs_params.inherit_nodfrg.val, | ||
124 | sizeof(int), 0644, NULL, &proc_dointvec_minmax, | ||
125 | &sysctl_intvec, NULL, | ||
126 | &xfs_params.inherit_nodfrg.min, &xfs_params.inherit_nodfrg.max}, | ||
127 | |||
123 | /* please keep this the last entry */ | 128 | /* please keep this the last entry */ |
124 | #ifdef CONFIG_PROC_FS | 129 | #ifdef CONFIG_PROC_FS |
125 | {XFS_STATS_CLEAR, "stats_clear", &xfs_params.stats_clear.val, | 130 | {XFS_STATS_CLEAR, "stats_clear", &xfs_params.stats_clear.val, |
diff --git a/fs/xfs/linux-2.6/xfs_sysctl.h b/fs/xfs/linux-2.6/xfs_sysctl.h index bc8c11f13722..a631fb8cc5ac 100644 --- a/fs/xfs/linux-2.6/xfs_sysctl.h +++ b/fs/xfs/linux-2.6/xfs_sysctl.h | |||
@@ -46,6 +46,7 @@ typedef struct xfs_param { | |||
46 | xfs_sysctl_val_t xfs_buf_age; /* Metadata buffer age before flush. */ | 46 | xfs_sysctl_val_t xfs_buf_age; /* Metadata buffer age before flush. */ |
47 | xfs_sysctl_val_t inherit_nosym; /* Inherit the "nosymlinks" flag. */ | 47 | xfs_sysctl_val_t inherit_nosym; /* Inherit the "nosymlinks" flag. */ |
48 | xfs_sysctl_val_t rotorstep; /* inode32 AG rotoring control knob */ | 48 | xfs_sysctl_val_t rotorstep; /* inode32 AG rotoring control knob */ |
49 | xfs_sysctl_val_t inherit_nodfrg;/* Inherit the "nodefrag" inode flag. */ | ||
49 | } xfs_param_t; | 50 | } xfs_param_t; |
50 | 51 | ||
51 | /* | 52 | /* |
@@ -84,6 +85,7 @@ enum { | |||
84 | /* XFS_IO_BYPASS = 18 */ | 85 | /* XFS_IO_BYPASS = 18 */ |
85 | XFS_INHERIT_NOSYM = 19, | 86 | XFS_INHERIT_NOSYM = 19, |
86 | XFS_ROTORSTEP = 20, | 87 | XFS_ROTORSTEP = 20, |
88 | XFS_INHERIT_NODFRG = 21, | ||
87 | }; | 89 | }; |
88 | 90 | ||
89 | extern xfs_param_t xfs_params; | 91 | extern xfs_param_t xfs_params; |
diff --git a/fs/xfs/xfs_dinode.h b/fs/xfs/xfs_dinode.h index 79d0d9e1fbab..77d537782586 100644 --- a/fs/xfs/xfs_dinode.h +++ b/fs/xfs/xfs_dinode.h | |||
@@ -257,6 +257,7 @@ typedef enum xfs_dinode_fmt | |||
257 | #define XFS_DIFLAG_NOSYMLINKS_BIT 10 /* disallow symlink creation */ | 257 | #define XFS_DIFLAG_NOSYMLINKS_BIT 10 /* disallow symlink creation */ |
258 | #define XFS_DIFLAG_EXTSIZE_BIT 11 /* inode extent size allocator hint */ | 258 | #define XFS_DIFLAG_EXTSIZE_BIT 11 /* inode extent size allocator hint */ |
259 | #define XFS_DIFLAG_EXTSZINHERIT_BIT 12 /* inherit inode extent size */ | 259 | #define XFS_DIFLAG_EXTSZINHERIT_BIT 12 /* inherit inode extent size */ |
260 | #define XFS_DIFLAG_NODEFRAG_BIT 13 /* do not reorganize/defragment */ | ||
260 | #define XFS_DIFLAG_REALTIME (1 << XFS_DIFLAG_REALTIME_BIT) | 261 | #define XFS_DIFLAG_REALTIME (1 << XFS_DIFLAG_REALTIME_BIT) |
261 | #define XFS_DIFLAG_PREALLOC (1 << XFS_DIFLAG_PREALLOC_BIT) | 262 | #define XFS_DIFLAG_PREALLOC (1 << XFS_DIFLAG_PREALLOC_BIT) |
262 | #define XFS_DIFLAG_NEWRTBM (1 << XFS_DIFLAG_NEWRTBM_BIT) | 263 | #define XFS_DIFLAG_NEWRTBM (1 << XFS_DIFLAG_NEWRTBM_BIT) |
@@ -270,12 +271,13 @@ typedef enum xfs_dinode_fmt | |||
270 | #define XFS_DIFLAG_NOSYMLINKS (1 << XFS_DIFLAG_NOSYMLINKS_BIT) | 271 | #define XFS_DIFLAG_NOSYMLINKS (1 << XFS_DIFLAG_NOSYMLINKS_BIT) |
271 | #define XFS_DIFLAG_EXTSIZE (1 << XFS_DIFLAG_EXTSIZE_BIT) | 272 | #define XFS_DIFLAG_EXTSIZE (1 << XFS_DIFLAG_EXTSIZE_BIT) |
272 | #define XFS_DIFLAG_EXTSZINHERIT (1 << XFS_DIFLAG_EXTSZINHERIT_BIT) | 273 | #define XFS_DIFLAG_EXTSZINHERIT (1 << XFS_DIFLAG_EXTSZINHERIT_BIT) |
274 | #define XFS_DIFLAG_NODEFRAG (1 << XFS_DIFLAG_NODEFRAG_BIT) | ||
273 | 275 | ||
274 | #define XFS_DIFLAG_ANY \ | 276 | #define XFS_DIFLAG_ANY \ |
275 | (XFS_DIFLAG_REALTIME | XFS_DIFLAG_PREALLOC | XFS_DIFLAG_NEWRTBM | \ | 277 | (XFS_DIFLAG_REALTIME | XFS_DIFLAG_PREALLOC | XFS_DIFLAG_NEWRTBM | \ |
276 | XFS_DIFLAG_IMMUTABLE | XFS_DIFLAG_APPEND | XFS_DIFLAG_SYNC | \ | 278 | XFS_DIFLAG_IMMUTABLE | XFS_DIFLAG_APPEND | XFS_DIFLAG_SYNC | \ |
277 | XFS_DIFLAG_NOATIME | XFS_DIFLAG_NODUMP | XFS_DIFLAG_RTINHERIT | \ | 279 | XFS_DIFLAG_NOATIME | XFS_DIFLAG_NODUMP | XFS_DIFLAG_RTINHERIT | \ |
278 | XFS_DIFLAG_PROJINHERIT | XFS_DIFLAG_NOSYMLINKS | XFS_DIFLAG_EXTSIZE | \ | 280 | XFS_DIFLAG_PROJINHERIT | XFS_DIFLAG_NOSYMLINKS | XFS_DIFLAG_EXTSIZE | \ |
279 | XFS_DIFLAG_EXTSZINHERIT) | 281 | XFS_DIFLAG_EXTSZINHERIT | XFS_DIFLAG_NODEFRAG) |
280 | 282 | ||
281 | #endif /* __XFS_DINODE_H__ */ | 283 | #endif /* __XFS_DINODE_H__ */ |
diff --git a/fs/xfs/xfs_fs.h b/fs/xfs/xfs_fs.h index df66f3a59fac..0f0ad1535951 100644 --- a/fs/xfs/xfs_fs.h +++ b/fs/xfs/xfs_fs.h | |||
@@ -67,6 +67,7 @@ struct fsxattr { | |||
67 | #define XFS_XFLAG_NOSYMLINKS 0x00000400 /* disallow symlink creation */ | 67 | #define XFS_XFLAG_NOSYMLINKS 0x00000400 /* disallow symlink creation */ |
68 | #define XFS_XFLAG_EXTSIZE 0x00000800 /* extent size allocator hint */ | 68 | #define XFS_XFLAG_EXTSIZE 0x00000800 /* extent size allocator hint */ |
69 | #define XFS_XFLAG_EXTSZINHERIT 0x00001000 /* inherit inode extent size */ | 69 | #define XFS_XFLAG_EXTSZINHERIT 0x00001000 /* inherit inode extent size */ |
70 | #define XFS_XFLAG_NODEFRAG 0x00002000 /* do not defragment */ | ||
70 | #define XFS_XFLAG_HASATTR 0x80000000 /* no DIFLAG for this */ | 71 | #define XFS_XFLAG_HASATTR 0x80000000 /* no DIFLAG for this */ |
71 | 72 | ||
72 | /* | 73 | /* |
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index f5284453441b..083fc0479e69 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c | |||
@@ -812,6 +812,8 @@ _xfs_dic2xflags( | |||
812 | flags |= XFS_XFLAG_EXTSIZE; | 812 | flags |= XFS_XFLAG_EXTSIZE; |
813 | if (di_flags & XFS_DIFLAG_EXTSZINHERIT) | 813 | if (di_flags & XFS_DIFLAG_EXTSZINHERIT) |
814 | flags |= XFS_XFLAG_EXTSZINHERIT; | 814 | flags |= XFS_XFLAG_EXTSZINHERIT; |
815 | if (di_flags & XFS_DIFLAG_NODEFRAG) | ||
816 | flags |= XFS_XFLAG_NODEFRAG; | ||
815 | } | 817 | } |
816 | 818 | ||
817 | return flags; | 819 | return flags; |
@@ -1221,6 +1223,9 @@ xfs_ialloc( | |||
1221 | di_flags |= XFS_DIFLAG_NOSYMLINKS; | 1223 | di_flags |= XFS_DIFLAG_NOSYMLINKS; |
1222 | if (pip->i_d.di_flags & XFS_DIFLAG_PROJINHERIT) | 1224 | if (pip->i_d.di_flags & XFS_DIFLAG_PROJINHERIT) |
1223 | di_flags |= XFS_DIFLAG_PROJINHERIT; | 1225 | di_flags |= XFS_DIFLAG_PROJINHERIT; |
1226 | if ((pip->i_d.di_flags & XFS_DIFLAG_NODEFRAG) && | ||
1227 | xfs_inherit_nodefrag) | ||
1228 | di_flags |= XFS_DIFLAG_NODEFRAG; | ||
1224 | ip->i_d.di_flags |= di_flags; | 1229 | ip->i_d.di_flags |= di_flags; |
1225 | } | 1230 | } |
1226 | /* FALLTHROUGH */ | 1231 | /* FALLTHROUGH */ |
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c index 2b814f04176d..d1c6349e4018 100644 --- a/fs/xfs/xfs_vnodeops.c +++ b/fs/xfs/xfs_vnodeops.c | |||
@@ -799,6 +799,8 @@ xfs_setattr( | |||
799 | di_flags |= XFS_DIFLAG_NODUMP; | 799 | di_flags |= XFS_DIFLAG_NODUMP; |
800 | if (vap->va_xflags & XFS_XFLAG_PROJINHERIT) | 800 | if (vap->va_xflags & XFS_XFLAG_PROJINHERIT) |
801 | di_flags |= XFS_DIFLAG_PROJINHERIT; | 801 | di_flags |= XFS_DIFLAG_PROJINHERIT; |
802 | if (vap->va_xflags & XFS_XFLAG_NODEFRAG) | ||
803 | di_flags |= XFS_DIFLAG_NODEFRAG; | ||
802 | if ((ip->i_d.di_mode & S_IFMT) == S_IFDIR) { | 804 | if ((ip->i_d.di_mode & S_IFMT) == S_IFDIR) { |
803 | if (vap->va_xflags & XFS_XFLAG_RTINHERIT) | 805 | if (vap->va_xflags & XFS_XFLAG_RTINHERIT) |
804 | di_flags |= XFS_DIFLAG_RTINHERIT; | 806 | di_flags |= XFS_DIFLAG_RTINHERIT; |