Commit 0af1998d authored by Stephen Lord's avatar Stephen Lord Committed by Stephen Lord

[XFS] Some tweaks to the additional inode flags, suggested by Ethan Benson

SGI Modid: 2.5.x-xfs:slinx:158493a
parent cd0033bc
......@@ -61,6 +61,7 @@ xfs_param_t xfs_params = {
.stats_clear = { 0, 0, 1 },
.inherit_sync = { 0, 1, 1 },
.inherit_nodump = { 0, 1, 1 },
.inherit_noatim = { 0, 1, 1 },
};
/*
......
......@@ -98,6 +98,7 @@ static inline void set_buffer_unwritten_io(struct buffer_head *bh)
#define xfs_stats_clear xfs_params.stats_clear.val
#define xfs_inherit_sync xfs_params.inherit_sync.val
#define xfs_inherit_nodump xfs_params.inherit_nodump.val
#define xfs_inherit_noatime xfs_params.inherit_noatim.val
#define NBPP PAGE_SIZE
#define DPPSHFT (PAGE_SHIFT - 9)
......
......@@ -80,6 +80,7 @@ xfs_read_xfsstats(
xfsstats.xs_xstrat_bytes,
xfsstats.xs_write_bytes,
xfsstats.xs_read_bytes);
len += sprintf(buffer + len, "debug %u\n", defined(XFSDEBUG));
if (offset >= len) {
*start = buffer;
......
......@@ -107,6 +107,11 @@ STATIC ctl_table xfs_table[] = {
&sysctl_intvec, NULL,
&xfs_params.inherit_nodump.min, &xfs_params.inherit_nodump.max},
{XFS_INHERIT_NOATIME, "inherit_noatime", &xfs_params.inherit_noatim.val,
sizeof(ulong), 0644, NULL, &proc_doulongvec_minmax,
&sysctl_intvec, NULL,
&xfs_params.inherit_noatim.min, &xfs_params.inherit_noatim.max},
/* please keep this the last entry */
#ifdef CONFIG_PROC_FS
{XFS_STATS_CLEAR, "stats_clear", &xfs_params.stats_clear.val,
......
......@@ -57,6 +57,7 @@ typedef struct xfs_param {
xfs_sysctl_val_t stats_clear; /* Reset all XFS statistics to zero. */
xfs_sysctl_val_t inherit_sync; /* Inherit the "sync" inode flag. */
xfs_sysctl_val_t inherit_nodump;/* Inherit the "nodump" inode flag. */
xfs_sysctl_val_t inherit_noatim;/* Inherit the "noatime" inode flag. */
} xfs_param_t;
/*
......@@ -84,6 +85,7 @@ enum {
XFS_STATS_CLEAR = 12,
XFS_INHERIT_SYNC = 13,
XFS_INHERIT_NODUMP = 14,
XFS_INHERIT_NOATIME = 15,
};
extern xfs_param_t xfs_params;
......
......@@ -1197,8 +1197,6 @@ xfs_ialloc(
ip->i_d.di_dmevmask = 0;
ip->i_d.di_dmstate = 0;
ip->i_d.di_flags = 0;
if ((pip->i_d.di_flags & XFS_DIFLAG_NODUMP) && xfs_inherit_nodump)
ip->i_d.di_flags |= XFS_DIFLAG_NODUMP;
flags = XFS_ILOG_CORE;
switch (mode & IFMT) {
case IFIFO:
......@@ -1212,8 +1210,18 @@ xfs_ialloc(
break;
case IFREG:
case IFDIR:
if ((pip->i_d.di_flags & XFS_DIFLAG_SYNC) && xfs_inherit_sync)
ip->i_d.di_flags |= XFS_DIFLAG_SYNC;
if (pip->i_d.di_flags &
(XFS_DIFLAG_NOATIME|XFS_DIFLAG_NODUMP|XFS_DIFLAG_SYNC)) {
if ((pip->i_d.di_flags & XFS_DIFLAG_NOATIME) &&
xfs_inherit_noatime)
ip->i_d.di_flags |= XFS_DIFLAG_NOATIME;
if ((pip->i_d.di_flags & XFS_DIFLAG_NODUMP) &&
xfs_inherit_nodump)
ip->i_d.di_flags |= XFS_DIFLAG_NODUMP;
if ((pip->i_d.di_flags & XFS_DIFLAG_SYNC) &&
xfs_inherit_sync)
ip->i_d.di_flags |= XFS_DIFLAG_SYNC;
}
case IFLNK:
ip->i_d.di_format = XFS_DINODE_FMT_EXTENTS;
ip->i_df.if_flags = XFS_IFEXTENTS;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment