* [PATCH] XFS: remove i_gen from incore inode
@ 2008-07-20 12:46 Dave Chinner
2008-07-21 7:54 ` Christoph Hellwig
0 siblings, 1 reply; 13+ messages in thread
From: Dave Chinner @ 2008-07-20 12:46 UTC (permalink / raw)
To: xfs; +Cc: Dave Chinner
i_gen is incremented in directory operations when the
directory is changed. It is never read or otherwise used
so it should be removed to help reduce the size of the
struct xfs_inode.
Signed-off-by: Dave Chinner <david@fromorbit.com>
---
fs/xfs/xfs_inode.h | 1 -
fs/xfs/xfs_rename.c | 12 ++----------
fs/xfs/xfs_vnodeops.c | 29 ++---------------------------
3 files changed, 4 insertions(+), 38 deletions(-)
diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h
index 440b443..316c374 100644
--- a/fs/xfs/xfs_inode.h
+++ b/fs/xfs/xfs_inode.h
@@ -223,7 +223,6 @@ typedef struct xfs_inode {
unsigned short i_flags; /* see defined flags below */
unsigned char i_update_core; /* timestamps/size is dirty */
unsigned char i_update_size; /* di_size field is dirty */
- unsigned int i_gen; /* generation count */
unsigned int i_delayed_blks; /* count of delay alloc blks */
xfs_icdinode_t i_d; /* most of ondisk inode */
diff --git a/fs/xfs/xfs_rename.c b/fs/xfs/xfs_rename.c
index d700dac..02f0e8f 100644
--- a/fs/xfs/xfs_rename.c
+++ b/fs/xfs/xfs_rename.c
@@ -367,19 +367,11 @@ xfs_rename(
&first_block, &free_list, spaceres);
if (error)
goto abort_return;
- xfs_ichgtime(src_dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
- /*
- * Update the generation counts on all the directory inodes
- * that we're modifying.
- */
- src_dp->i_gen++;
+ xfs_ichgtime(src_dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
xfs_trans_log_inode(tp, src_dp, XFS_ILOG_CORE);
-
- if (new_parent) {
- target_dp->i_gen++;
+ if (new_parent)
xfs_trans_log_inode(tp, target_dp, XFS_ILOG_CORE);
- }
/*
* If this is a synchronous mount, make sure that the
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
index cca2871..36bf85c 100644
--- a/fs/xfs/xfs_vnodeops.c
+++ b/fs/xfs/xfs_vnodeops.c
@@ -1619,8 +1619,6 @@ xfs_create(
xfs_trans_set_sync(tp);
}
- dp->i_gen++;
-
/*
* Attach the dquot(s) to the inodes and modify them incore.
* These ids of the inode couldn't have changed since the new
@@ -2050,13 +2048,6 @@ xfs_remove(
}
xfs_ichgtime(dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
- /*
- * Bump the in memory generation count on the parent
- * directory so that other can know that it has changed.
- */
- dp->i_gen++;
- xfs_trans_log_inode(tp, dp, XFS_ILOG_CORE);
-
if (is_dir) {
/*
* Drop the link from ip's "..".
@@ -2074,8 +2065,8 @@ xfs_remove(
} else {
/*
* When removing a non-directory we need to log the parent
- * inode here for the i_gen update. For a directory this is
- * done implicitly by the xfs_droplink call for the ".." entry.
+ * inode here. For a directory this is done implicitly
+ * by the xfs_droplink call for the ".." entry.
*/
xfs_trans_log_inode(tp, dp, XFS_ILOG_CORE);
}
@@ -2244,7 +2235,6 @@ xfs_link(
if (error)
goto abort_return;
xfs_ichgtime(tdp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
- tdp->i_gen++;
xfs_trans_log_inode(tp, tdp, XFS_ILOG_CORE);
error = xfs_bumplink(tp, sip);
@@ -2421,18 +2411,10 @@ xfs_mkdir(
}
xfs_ichgtime(dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
- /*
- * Bump the in memory version number of the parent directory
- * so that other processes accessing it will recognize that
- * the directory has changed.
- */
- dp->i_gen++;
-
error = xfs_dir_init(tp, cdp, dp);
if (error)
goto error2;
- cdp->i_gen = 1;
error = xfs_bumplink(tp, dp);
if (error)
goto error2;
@@ -2719,13 +2701,6 @@ xfs_symlink(
xfs_trans_log_inode(tp, dp, XFS_ILOG_CORE);
/*
- * Bump the in memory version number of the parent directory
- * so that other processes accessing it will recognize that
- * the directory has changed.
- */
- dp->i_gen++;
-
- /*
* If this is a synchronous mount, make sure that the
* symlink transaction goes to disk before returning to
* the user.
--
1.5.6
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH] XFS: remove i_gen from incore inode
2008-07-20 12:46 Dave Chinner
@ 2008-07-21 7:54 ` Christoph Hellwig
2008-07-21 11:08 ` Dave Chinner
0 siblings, 1 reply; 13+ messages in thread
From: Christoph Hellwig @ 2008-07-21 7:54 UTC (permalink / raw)
To: Dave Chinner; +Cc: xfs
On Sun, Jul 20, 2008 at 10:46:42PM +1000, Dave Chinner wrote:
> i_gen is incremented in directory operations when the
> directory is changed. It is never read or otherwise used
> so it should be removed to help reduce the size of the
> struct xfs_inode.
It also removes a xfs_trans_log_inode in xfs_remove, which looks
fine to me from a quick glance, but this should be verified and
documented.
Otherwise looks good.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] XFS: remove i_gen from incore inode
2008-07-21 7:54 ` Christoph Hellwig
@ 2008-07-21 11:08 ` Dave Chinner
2008-07-21 11:52 ` Christoph Hellwig
0 siblings, 1 reply; 13+ messages in thread
From: Dave Chinner @ 2008-07-21 11:08 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: xfs
On Mon, Jul 21, 2008 at 03:54:49AM -0400, Christoph Hellwig wrote:
> On Sun, Jul 20, 2008 at 10:46:42PM +1000, Dave Chinner wrote:
> > i_gen is incremented in directory operations when the
> > directory is changed. It is never read or otherwise used
> > so it should be removed to help reduce the size of the
> > struct xfs_inode.
>
> It also removes a xfs_trans_log_inode in xfs_remove, which looks
> fine to me from a quick glance, but this should be verified and
> documented.
If you note in the very next if/else statement the directory inode
gets logged - either by dropping the link or directly. IOWs, we
were logging the directory inode twice with the same value
(XFS_ILOG_CORE). So I don't think thereśs any problem here.
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] XFS: remove i_gen from incore inode
2008-07-21 11:08 ` Dave Chinner
@ 2008-07-21 11:52 ` Christoph Hellwig
2008-07-21 12:04 ` Dave Chinner
0 siblings, 1 reply; 13+ messages in thread
From: Christoph Hellwig @ 2008-07-21 11:52 UTC (permalink / raw)
To: Christoph Hellwig, xfs
On Mon, Jul 21, 2008 at 09:08:14PM +1000, Dave Chinner wrote:
> On Mon, Jul 21, 2008 at 03:54:49AM -0400, Christoph Hellwig wrote:
> > On Sun, Jul 20, 2008 at 10:46:42PM +1000, Dave Chinner wrote:
> > > i_gen is incremented in directory operations when the
> > > directory is changed. It is never read or otherwise used
> > > so it should be removed to help reduce the size of the
> > > struct xfs_inode.
> >
> > It also removes a xfs_trans_log_inode in xfs_remove, which looks
> > fine to me from a quick glance, but this should be verified and
> > documented.
>
> If you note in the very next if/else statement the directory inode
> gets logged - either by dropping the link or directly. IOWs, we
> were logging the directory inode twice with the same value
> (XFS_ILOG_CORE). So I don't think there??s any problem here.
Indeed. The patch looks good but a little description like the one above
in the commit message would be nice.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] XFS: remove i_gen from incore inode
2008-07-21 11:52 ` Christoph Hellwig
@ 2008-07-21 12:04 ` Dave Chinner
2008-07-21 12:05 ` Christoph Hellwig
` (2 more replies)
0 siblings, 3 replies; 13+ messages in thread
From: Dave Chinner @ 2008-07-21 12:04 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: xfs
On Mon, Jul 21, 2008 at 07:52:28AM -0400, Christoph Hellwig wrote:
> On Mon, Jul 21, 2008 at 09:08:14PM +1000, Dave Chinner wrote:
> > On Mon, Jul 21, 2008 at 03:54:49AM -0400, Christoph Hellwig wrote:
> > > On Sun, Jul 20, 2008 at 10:46:42PM +1000, Dave Chinner wrote:
> > > > i_gen is incremented in directory operations when the
> > > > directory is changed. It is never read or otherwise used
> > > > so it should be removed to help reduce the size of the
> > > > struct xfs_inode.
> > >
> > > It also removes a xfs_trans_log_inode in xfs_remove, which looks
> > > fine to me from a quick glance, but this should be verified and
> > > documented.
> >
> > If you note in the very next if/else statement the directory inode
> > gets logged - either by dropping the link or directly. IOWs, we
> > were logging the directory inode twice with the same value
> > (XFS_ILOG_CORE). So I don't think there??s any problem here.
>
> Indeed. The patch looks good but a little description like the one above
> in the commit message would be nice.
Updated patch below.
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
XFS: remove i_gen from incore inode
i_gen is incremented in directory operations when the
directory is changed. It is never read or otherwise used
so it should be removed to help reduce the size of the
struct xfs_inode.
The patch also removes a duplicate logging of the directory
inode core. We only need to do this once per transaction
so kill the one associated with the i_gen increment.
Signed-off-by: Dave Chinner <david@fromorbit.com>
---
fs/xfs/xfs_inode.h | 1 -
fs/xfs/xfs_rename.c | 12 ++----------
fs/xfs/xfs_vnodeops.c | 29 ++---------------------------
3 files changed, 4 insertions(+), 38 deletions(-)
diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h
index 440b443..316c374 100644
--- a/fs/xfs/xfs_inode.h
+++ b/fs/xfs/xfs_inode.h
@@ -223,7 +223,6 @@ typedef struct xfs_inode {
unsigned short i_flags; /* see defined flags below */
unsigned char i_update_core; /* timestamps/size is dirty */
unsigned char i_update_size; /* di_size field is dirty */
- unsigned int i_gen; /* generation count */
unsigned int i_delayed_blks; /* count of delay alloc blks */
xfs_icdinode_t i_d; /* most of ondisk inode */
diff --git a/fs/xfs/xfs_rename.c b/fs/xfs/xfs_rename.c
index d700dac..02f0e8f 100644
--- a/fs/xfs/xfs_rename.c
+++ b/fs/xfs/xfs_rename.c
@@ -367,19 +367,11 @@ xfs_rename(
&first_block, &free_list, spaceres);
if (error)
goto abort_return;
- xfs_ichgtime(src_dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
- /*
- * Update the generation counts on all the directory inodes
- * that we're modifying.
- */
- src_dp->i_gen++;
+ xfs_ichgtime(src_dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
xfs_trans_log_inode(tp, src_dp, XFS_ILOG_CORE);
-
- if (new_parent) {
- target_dp->i_gen++;
+ if (new_parent)
xfs_trans_log_inode(tp, target_dp, XFS_ILOG_CORE);
- }
/*
* If this is a synchronous mount, make sure that the
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
index 94ec74b..426c574 100644
--- a/fs/xfs/xfs_vnodeops.c
+++ b/fs/xfs/xfs_vnodeops.c
@@ -1798,8 +1798,6 @@ xfs_create(
xfs_trans_set_sync(tp);
}
- dp->i_gen++;
-
/*
* Attach the dquot(s) to the inodes and modify them incore.
* These ids of the inode couldn't have changed since the new
@@ -2229,13 +2227,6 @@ xfs_remove(
}
xfs_ichgtime(dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
- /*
- * Bump the in memory generation count on the parent
- * directory so that other can know that it has changed.
- */
- dp->i_gen++;
- xfs_trans_log_inode(tp, dp, XFS_ILOG_CORE);
-
if (is_dir) {
/*
* Drop the link from ip's "..".
@@ -2253,8 +2244,8 @@ xfs_remove(
} else {
/*
* When removing a non-directory we need to log the parent
- * inode here for the i_gen update. For a directory this is
- * done implicitly by the xfs_droplink call for the ".." entry.
+ * inode here. For a directory this is done implicitly
+ * by the xfs_droplink call for the ".." entry.
*/
xfs_trans_log_inode(tp, dp, XFS_ILOG_CORE);
}
@@ -2423,7 +2414,6 @@ xfs_link(
if (error)
goto abort_return;
xfs_ichgtime(tdp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
- tdp->i_gen++;
xfs_trans_log_inode(tp, tdp, XFS_ILOG_CORE);
error = xfs_bumplink(tp, sip);
@@ -2600,18 +2590,10 @@ xfs_mkdir(
}
xfs_ichgtime(dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
- /*
- * Bump the in memory version number of the parent directory
- * so that other processes accessing it will recognize that
- * the directory has changed.
- */
- dp->i_gen++;
-
error = xfs_dir_init(tp, cdp, dp);
if (error)
goto error2;
- cdp->i_gen = 1;
error = xfs_bumplink(tp, dp);
if (error)
goto error2;
@@ -2898,13 +2880,6 @@ xfs_symlink(
xfs_trans_log_inode(tp, dp, XFS_ILOG_CORE);
/*
- * Bump the in memory version number of the parent directory
- * so that other processes accessing it will recognize that
- * the directory has changed.
- */
- dp->i_gen++;
-
- /*
* If this is a synchronous mount, make sure that the
* symlink transaction goes to disk before returning to
* the user.
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH] XFS: remove i_gen from incore inode
2008-07-21 12:04 ` Dave Chinner
@ 2008-07-21 12:05 ` Christoph Hellwig
2008-08-11 16:39 ` Christoph Hellwig
2008-11-21 18:01 ` Christoph Hellwig
2 siblings, 0 replies; 13+ messages in thread
From: Christoph Hellwig @ 2008-07-21 12:05 UTC (permalink / raw)
To: Christoph Hellwig, xfs
Looks good.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] XFS: remove i_gen from incore inode
2008-07-21 12:04 ` Dave Chinner
2008-07-21 12:05 ` Christoph Hellwig
@ 2008-08-11 16:39 ` Christoph Hellwig
2008-11-21 18:01 ` Christoph Hellwig
2 siblings, 0 replies; 13+ messages in thread
From: Christoph Hellwig @ 2008-08-11 16:39 UTC (permalink / raw)
To: Christoph Hellwig, xfs
On Mon, Jul 21, 2008 at 10:04:40PM +1000, Dave Chinner wrote:
> > Indeed. The patch looks good but a little description like the one above
> > in the commit message would be nice.
>
> Updated patch below.
Missing the needed xfsidbg changes. Updated version below:
Index: linux-2.6-xfs/fs/xfs/xfs_inode.h
===================================================================
--- linux-2.6-xfs.orig/fs/xfs/xfs_inode.h 2008-08-11 13:02:32.000000000 -0300
+++ linux-2.6-xfs/fs/xfs/xfs_inode.h 2008-08-11 13:36:50.000000000 -0300
@@ -230,7 +230,6 @@ typedef struct xfs_inode {
unsigned short i_flags; /* see defined flags below */
unsigned char i_update_core; /* timestamps/size is dirty */
unsigned char i_update_size; /* di_size field is dirty */
- unsigned int i_gen; /* generation count */
unsigned int i_delayed_blks; /* count of delay alloc blks */
xfs_icdinode_t i_d; /* most of ondisk inode */
Index: linux-2.6-xfs/fs/xfs/xfs_rename.c
===================================================================
--- linux-2.6-xfs.orig/fs/xfs/xfs_rename.c 2008-08-11 13:02:32.000000000 -0300
+++ linux-2.6-xfs/fs/xfs/xfs_rename.c 2008-08-11 13:36:50.000000000 -0300
@@ -367,19 +367,11 @@ xfs_rename(
&first_block, &free_list, spaceres);
if (error)
goto abort_return;
- xfs_ichgtime(src_dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
- /*
- * Update the generation counts on all the directory inodes
- * that we're modifying.
- */
- src_dp->i_gen++;
+ xfs_ichgtime(src_dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
xfs_trans_log_inode(tp, src_dp, XFS_ILOG_CORE);
-
- if (new_parent) {
- target_dp->i_gen++;
+ if (new_parent)
xfs_trans_log_inode(tp, target_dp, XFS_ILOG_CORE);
- }
/*
* If this is a synchronous mount, make sure that the
Index: linux-2.6-xfs/fs/xfs/xfs_vnodeops.c
===================================================================
--- linux-2.6-xfs.orig/fs/xfs/xfs_vnodeops.c 2008-08-11 13:02:32.000000000 -0300
+++ linux-2.6-xfs/fs/xfs/xfs_vnodeops.c 2008-08-11 13:36:50.000000000 -0300
@@ -1625,8 +1625,6 @@ xfs_create(
xfs_trans_set_sync(tp);
}
- dp->i_gen++;
-
/*
* Attach the dquot(s) to the inodes and modify them incore.
* These ids of the inode couldn't have changed since the new
@@ -1985,13 +1983,6 @@ xfs_remove(
}
xfs_ichgtime(dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
- /*
- * Bump the in memory generation count on the parent
- * directory so that other can know that it has changed.
- */
- dp->i_gen++;
- xfs_trans_log_inode(tp, dp, XFS_ILOG_CORE);
-
if (is_dir) {
/*
* Drop the link from ip's "..".
@@ -2009,8 +2000,8 @@ xfs_remove(
} else {
/*
* When removing a non-directory we need to log the parent
- * inode here for the i_gen update. For a directory this is
- * done implicitly by the xfs_droplink call for the ".." entry.
+ * inode here. For a directory this is done implicitly
+ * by the xfs_droplink call for the ".." entry.
*/
xfs_trans_log_inode(tp, dp, XFS_ILOG_CORE);
}
@@ -2170,7 +2161,6 @@ xfs_link(
if (error)
goto abort_return;
xfs_ichgtime(tdp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
- tdp->i_gen++;
xfs_trans_log_inode(tp, tdp, XFS_ILOG_CORE);
error = xfs_bumplink(tp, sip);
@@ -2347,18 +2337,10 @@ xfs_mkdir(
}
xfs_ichgtime(dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
- /*
- * Bump the in memory version number of the parent directory
- * so that other processes accessing it will recognize that
- * the directory has changed.
- */
- dp->i_gen++;
-
error = xfs_dir_init(tp, cdp, dp);
if (error)
goto error2;
- cdp->i_gen = 1;
error = xfs_bumplink(tp, dp);
if (error)
goto error2;
@@ -2645,13 +2627,6 @@ xfs_symlink(
xfs_trans_log_inode(tp, dp, XFS_ILOG_CORE);
/*
- * Bump the in memory version number of the parent directory
- * so that other processes accessing it will recognize that
- * the directory has changed.
- */
- dp->i_gen++;
-
- /*
* If this is a synchronous mount, make sure that the
* symlink transaction goes to disk before returning to
* the user.
Index: linux-2.6-xfs/fs/xfs/xfsidbg.c
===================================================================
--- linux-2.6-xfs.orig/fs/xfs/xfsidbg.c 2008-08-11 13:02:32.000000000 -0300
+++ linux-2.6-xfs/fs/xfs/xfsidbg.c 2008-08-11 13:36:50.000000000 -0300
@@ -3633,7 +3633,6 @@ xfs_prdinode_incore(xfs_icdinode_t *dip)
xfs_fmtformat((xfs_dinode_fmt_t)dip->di_aformat),
dip->di_dmevmask, dip->di_dmstate);
printflags(dip->di_flags, diflags, "flags");
- kdb_printf("gen 0x%x\n", dip->di_gen);
}
#ifdef XFS_RW_TRACE
@@ -6385,11 +6384,8 @@ xfsidbg_xnode(xfs_inode_t *ip)
kdb_printf("\n");
kdb_printf("update_core %d update size %d\n",
(int)(ip->i_update_core), (int) ip->i_update_size);
- kdb_printf("gen 0x%x delayed blks %d",
- ip->i_gen,
- ip->i_delayed_blks);
- kdb_printf("size %lld\n",
- ip->i_size);
+ kdb_printf("delayed blks %d size %lld\n",
+ ip->i_delayed_blks, ip->i_size);
#ifdef XFS_INODE_TRACE
qprintf(" trace 0x%p\n", ip->i_trace);
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH] XFS: remove i_gen from incore inode
@ 2008-09-13 13:47 Dave Chinner
2008-09-14 13:16 ` Christoph Hellwig
0 siblings, 1 reply; 13+ messages in thread
From: Dave Chinner @ 2008-09-13 13:47 UTC (permalink / raw)
To: xfs
i_gen is incremented in directory operations when the
directory is changed. It is never read or otherwise used
so it should be removed to help reduce the size of the
struct xfs_inode.
The patch also removes a duplicate logging of the directory
inode core. We only need to do this once per transaction
so kill the one associated with the i_gen increment.
Signed-off-by: Dave Chinner <david@fromorbit.com>
---
fs/xfs/xfs_inode.h | 1 -
fs/xfs/xfs_rename.c | 12 ++----------
fs/xfs/xfs_vnodeops.c | 29 ++---------------------------
3 files changed, 4 insertions(+), 38 deletions(-)
diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h
index 1420c49..9559e0b 100644
--- a/fs/xfs/xfs_inode.h
+++ b/fs/xfs/xfs_inode.h
@@ -230,7 +230,6 @@ typedef struct xfs_inode {
unsigned short i_flags; /* see defined flags below */
unsigned char i_update_core; /* timestamps/size is dirty */
unsigned char i_update_size; /* di_size field is dirty */
- unsigned int i_gen; /* generation count */
unsigned int i_delayed_blks; /* count of delay alloc blks */
xfs_icdinode_t i_d; /* most of ondisk inode */
diff --git a/fs/xfs/xfs_rename.c b/fs/xfs/xfs_rename.c
index d700dac..02f0e8f 100644
--- a/fs/xfs/xfs_rename.c
+++ b/fs/xfs/xfs_rename.c
@@ -367,19 +367,11 @@ xfs_rename(
&first_block, &free_list, spaceres);
if (error)
goto abort_return;
- xfs_ichgtime(src_dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
- /*
- * Update the generation counts on all the directory inodes
- * that we're modifying.
- */
- src_dp->i_gen++;
+ xfs_ichgtime(src_dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
xfs_trans_log_inode(tp, src_dp, XFS_ILOG_CORE);
-
- if (new_parent) {
- target_dp->i_gen++;
+ if (new_parent)
xfs_trans_log_inode(tp, target_dp, XFS_ILOG_CORE);
- }
/*
* If this is a synchronous mount, make sure that the
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
index aa238c8..bb8b560 100644
--- a/fs/xfs/xfs_vnodeops.c
+++ b/fs/xfs/xfs_vnodeops.c
@@ -1625,8 +1625,6 @@ xfs_create(
xfs_trans_set_sync(tp);
}
- dp->i_gen++;
-
/*
* Attach the dquot(s) to the inodes and modify them incore.
* These ids of the inode couldn't have changed since the new
@@ -1985,13 +1983,6 @@ xfs_remove(
}
xfs_ichgtime(dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
- /*
- * Bump the in memory generation count on the parent
- * directory so that other can know that it has changed.
- */
- dp->i_gen++;
- xfs_trans_log_inode(tp, dp, XFS_ILOG_CORE);
-
if (is_dir) {
/*
* Drop the link from ip's "..".
@@ -2009,8 +2000,8 @@ xfs_remove(
} else {
/*
* When removing a non-directory we need to log the parent
- * inode here for the i_gen update. For a directory this is
- * done implicitly by the xfs_droplink call for the ".." entry.
+ * inode here. For a directory this is done implicitly
+ * by the xfs_droplink call for the ".." entry.
*/
xfs_trans_log_inode(tp, dp, XFS_ILOG_CORE);
}
@@ -2170,7 +2161,6 @@ xfs_link(
if (error)
goto abort_return;
xfs_ichgtime(tdp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
- tdp->i_gen++;
xfs_trans_log_inode(tp, tdp, XFS_ILOG_CORE);
error = xfs_bumplink(tp, sip);
@@ -2347,18 +2337,10 @@ xfs_mkdir(
}
xfs_ichgtime(dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
- /*
- * Bump the in memory version number of the parent directory
- * so that other processes accessing it will recognize that
- * the directory has changed.
- */
- dp->i_gen++;
-
error = xfs_dir_init(tp, cdp, dp);
if (error)
goto error2;
- cdp->i_gen = 1;
error = xfs_bumplink(tp, dp);
if (error)
goto error2;
@@ -2645,13 +2627,6 @@ xfs_symlink(
xfs_trans_log_inode(tp, dp, XFS_ILOG_CORE);
/*
- * Bump the in memory version number of the parent directory
- * so that other processes accessing it will recognize that
- * the directory has changed.
- */
- dp->i_gen++;
-
- /*
* If this is a synchronous mount, make sure that the
* symlink transaction goes to disk before returning to
* the user.
--
1.5.6
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH] XFS: remove i_gen from incore inode
2008-09-13 13:47 [PATCH] XFS: remove i_gen from incore inode Dave Chinner
@ 2008-09-14 13:16 ` Christoph Hellwig
0 siblings, 0 replies; 13+ messages in thread
From: Christoph Hellwig @ 2008-09-14 13:16 UTC (permalink / raw)
To: Dave Chinner; +Cc: xfs
On Sat, Sep 13, 2008 at 11:47:11PM +1000, Dave Chinner wrote:
> i_gen is incremented in directory operations when the
> directory is changed. It is never read or otherwise used
> so it should be removed to help reduce the size of the
> struct xfs_inode.
>
> The patch also removes a duplicate logging of the directory
> inode core. We only need to do this once per transaction
> so kill the one associated with the i_gen increment.
Still looks as good as when you posted it first month ago :)
And for reference here's the required fixup for xfsidbg:
Index: linux-2.6-xfs/fs/xfs/xfsidbg.c
===================================================================
--- linux-2.6-xfs.orig/fs/xfs/xfsidbg.c 2008-08-11 13:02:32.000000000 -0300
+++ linux-2.6-xfs/fs/xfs/xfsidbg.c 2008-08-11 13:36:50.000000000 -0300
@@ -3633,7 +3633,6 @@ xfs_prdinode_incore(xfs_icdinode_t *dip)
xfs_fmtformat((xfs_dinode_fmt_t)dip->di_aformat),
dip->di_dmevmask, dip->di_dmstate);
printflags(dip->di_flags, diflags, "flags");
- kdb_printf("gen 0x%x\n", dip->di_gen);
}
#ifdef XFS_RW_TRACE
@@ -6385,11 +6384,8 @@ xfsidbg_xnode(xfs_inode_t *ip)
kdb_printf("\n");
kdb_printf("update_core %d update size %d\n",
(int)(ip->i_update_core), (int) ip->i_update_size);
- kdb_printf("gen 0x%x delayed blks %d",
- ip->i_gen,
- ip->i_delayed_blks);
- kdb_printf("size %lld\n",
- ip->i_size);
+ kdb_printf("delayed blks %d size %lld\n",
+ ip->i_delayed_blks, ip->i_size);
#ifdef XFS_INODE_TRACE
qprintf(" trace 0x%p\n", ip->i_trace);
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH] XFS: remove i_gen from incore inode
@ 2008-10-07 22:12 Dave Chinner
2008-10-22 6:20 ` Dave Chinner
0 siblings, 1 reply; 13+ messages in thread
From: Dave Chinner @ 2008-10-07 22:12 UTC (permalink / raw)
To: xfs
i_gen is incremented in directory operations when the
directory is changed. It is never read or otherwise used
so it should be removed to help reduce the size of the
struct xfs_inode.
The patch also removes a duplicate logging of the directory
inode core. We only need to do this once per transaction
so kill the one associated with the i_gen increment.
Signed-off-by: Dave Chinner <david@fromorbit.com>
---
fs/xfs/xfs_inode.h | 1 -
fs/xfs/xfs_rename.c | 12 ++----------
fs/xfs/xfs_vnodeops.c | 29 ++---------------------------
3 files changed, 4 insertions(+), 38 deletions(-)
diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h
index a8f1e68..5784f8e 100644
--- a/fs/xfs/xfs_inode.h
+++ b/fs/xfs/xfs_inode.h
@@ -272,7 +272,6 @@ typedef struct xfs_inode {
unsigned short i_flags; /* see defined flags below */
unsigned char i_update_core; /* timestamps/size is dirty */
unsigned char i_update_size; /* di_size field is dirty */
- unsigned int i_gen; /* generation count */
unsigned int i_delayed_blks; /* count of delay alloc blks */
xfs_icdinode_t i_d; /* most of ondisk inode */
diff --git a/fs/xfs/xfs_rename.c b/fs/xfs/xfs_rename.c
index d700dac..02f0e8f 100644
--- a/fs/xfs/xfs_rename.c
+++ b/fs/xfs/xfs_rename.c
@@ -367,19 +367,11 @@ xfs_rename(
&first_block, &free_list, spaceres);
if (error)
goto abort_return;
- xfs_ichgtime(src_dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
- /*
- * Update the generation counts on all the directory inodes
- * that we're modifying.
- */
- src_dp->i_gen++;
+ xfs_ichgtime(src_dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
xfs_trans_log_inode(tp, src_dp, XFS_ILOG_CORE);
-
- if (new_parent) {
- target_dp->i_gen++;
+ if (new_parent)
xfs_trans_log_inode(tp, target_dp, XFS_ILOG_CORE);
- }
/*
* If this is a synchronous mount, make sure that the
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
index 8b6812f..7a72b0a 100644
--- a/fs/xfs/xfs_vnodeops.c
+++ b/fs/xfs/xfs_vnodeops.c
@@ -1625,8 +1625,6 @@ xfs_create(
xfs_trans_set_sync(tp);
}
- dp->i_gen++;
-
/*
* Attach the dquot(s) to the inodes and modify them incore.
* These ids of the inode couldn't have changed since the new
@@ -1993,13 +1991,6 @@ xfs_remove(
}
xfs_ichgtime(dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
- /*
- * Bump the in memory generation count on the parent
- * directory so that other can know that it has changed.
- */
- dp->i_gen++;
- xfs_trans_log_inode(tp, dp, XFS_ILOG_CORE);
-
if (is_dir) {
/*
* Drop the link from ip's "..".
@@ -2017,8 +2008,8 @@ xfs_remove(
} else {
/*
* When removing a non-directory we need to log the parent
- * inode here for the i_gen update. For a directory this is
- * done implicitly by the xfs_droplink call for the ".." entry.
+ * inode here. For a directory this is done implicitly
+ * by the xfs_droplink call for the ".." entry.
*/
xfs_trans_log_inode(tp, dp, XFS_ILOG_CORE);
}
@@ -2178,7 +2169,6 @@ xfs_link(
if (error)
goto abort_return;
xfs_ichgtime(tdp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
- tdp->i_gen++;
xfs_trans_log_inode(tp, tdp, XFS_ILOG_CORE);
error = xfs_bumplink(tp, sip);
@@ -2355,18 +2345,10 @@ xfs_mkdir(
}
xfs_ichgtime(dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
- /*
- * Bump the in memory version number of the parent directory
- * so that other processes accessing it will recognize that
- * the directory has changed.
- */
- dp->i_gen++;
-
error = xfs_dir_init(tp, cdp, dp);
if (error)
goto error2;
- cdp->i_gen = 1;
error = xfs_bumplink(tp, dp);
if (error)
goto error2;
@@ -2653,13 +2635,6 @@ xfs_symlink(
xfs_trans_log_inode(tp, dp, XFS_ILOG_CORE);
/*
- * Bump the in memory version number of the parent directory
- * so that other processes accessing it will recognize that
- * the directory has changed.
- */
- dp->i_gen++;
-
- /*
* If this is a synchronous mount, make sure that the
* symlink transaction goes to disk before returning to
* the user.
--
1.5.6.5
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH] XFS: remove i_gen from incore inode
2008-10-07 22:12 Dave Chinner
@ 2008-10-22 6:20 ` Dave Chinner
2008-10-31 1:27 ` Dave Chinner
0 siblings, 1 reply; 13+ messages in thread
From: Dave Chinner @ 2008-10-22 6:20 UTC (permalink / raw)
To: xfs
Ping?
On Wed, Oct 08, 2008 at 09:12:29AM +1100, Dave Chinner wrote:
> i_gen is incremented in directory operations when the
> directory is changed. It is never read or otherwise used
> so it should be removed to help reduce the size of the
> struct xfs_inode.
>
> The patch also removes a duplicate logging of the directory
> inode core. We only need to do this once per transaction
> so kill the one associated with the i_gen increment.
>
> Signed-off-by: Dave Chinner <david@fromorbit.com>
> ---
> fs/xfs/xfs_inode.h | 1 -
> fs/xfs/xfs_rename.c | 12 ++----------
> fs/xfs/xfs_vnodeops.c | 29 ++---------------------------
> 3 files changed, 4 insertions(+), 38 deletions(-)
>
> diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h
> index a8f1e68..5784f8e 100644
> --- a/fs/xfs/xfs_inode.h
> +++ b/fs/xfs/xfs_inode.h
> @@ -272,7 +272,6 @@ typedef struct xfs_inode {
> unsigned short i_flags; /* see defined flags below */
> unsigned char i_update_core; /* timestamps/size is dirty */
> unsigned char i_update_size; /* di_size field is dirty */
> - unsigned int i_gen; /* generation count */
> unsigned int i_delayed_blks; /* count of delay alloc blks */
>
> xfs_icdinode_t i_d; /* most of ondisk inode */
> diff --git a/fs/xfs/xfs_rename.c b/fs/xfs/xfs_rename.c
> index d700dac..02f0e8f 100644
> --- a/fs/xfs/xfs_rename.c
> +++ b/fs/xfs/xfs_rename.c
> @@ -367,19 +367,11 @@ xfs_rename(
> &first_block, &free_list, spaceres);
> if (error)
> goto abort_return;
> - xfs_ichgtime(src_dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
>
> - /*
> - * Update the generation counts on all the directory inodes
> - * that we're modifying.
> - */
> - src_dp->i_gen++;
> + xfs_ichgtime(src_dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
> xfs_trans_log_inode(tp, src_dp, XFS_ILOG_CORE);
> -
> - if (new_parent) {
> - target_dp->i_gen++;
> + if (new_parent)
> xfs_trans_log_inode(tp, target_dp, XFS_ILOG_CORE);
> - }
>
> /*
> * If this is a synchronous mount, make sure that the
> diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
> index 8b6812f..7a72b0a 100644
> --- a/fs/xfs/xfs_vnodeops.c
> +++ b/fs/xfs/xfs_vnodeops.c
> @@ -1625,8 +1625,6 @@ xfs_create(
> xfs_trans_set_sync(tp);
> }
>
> - dp->i_gen++;
> -
> /*
> * Attach the dquot(s) to the inodes and modify them incore.
> * These ids of the inode couldn't have changed since the new
> @@ -1993,13 +1991,6 @@ xfs_remove(
> }
> xfs_ichgtime(dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
>
> - /*
> - * Bump the in memory generation count on the parent
> - * directory so that other can know that it has changed.
> - */
> - dp->i_gen++;
> - xfs_trans_log_inode(tp, dp, XFS_ILOG_CORE);
> -
> if (is_dir) {
> /*
> * Drop the link from ip's "..".
> @@ -2017,8 +2008,8 @@ xfs_remove(
> } else {
> /*
> * When removing a non-directory we need to log the parent
> - * inode here for the i_gen update. For a directory this is
> - * done implicitly by the xfs_droplink call for the ".." entry.
> + * inode here. For a directory this is done implicitly
> + * by the xfs_droplink call for the ".." entry.
> */
> xfs_trans_log_inode(tp, dp, XFS_ILOG_CORE);
> }
> @@ -2178,7 +2169,6 @@ xfs_link(
> if (error)
> goto abort_return;
> xfs_ichgtime(tdp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
> - tdp->i_gen++;
> xfs_trans_log_inode(tp, tdp, XFS_ILOG_CORE);
>
> error = xfs_bumplink(tp, sip);
> @@ -2355,18 +2345,10 @@ xfs_mkdir(
> }
> xfs_ichgtime(dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
>
> - /*
> - * Bump the in memory version number of the parent directory
> - * so that other processes accessing it will recognize that
> - * the directory has changed.
> - */
> - dp->i_gen++;
> -
> error = xfs_dir_init(tp, cdp, dp);
> if (error)
> goto error2;
>
> - cdp->i_gen = 1;
> error = xfs_bumplink(tp, dp);
> if (error)
> goto error2;
> @@ -2653,13 +2635,6 @@ xfs_symlink(
> xfs_trans_log_inode(tp, dp, XFS_ILOG_CORE);
>
> /*
> - * Bump the in memory version number of the parent directory
> - * so that other processes accessing it will recognize that
> - * the directory has changed.
> - */
> - dp->i_gen++;
> -
> - /*
> * If this is a synchronous mount, make sure that the
> * symlink transaction goes to disk before returning to
> * the user.
> --
> 1.5.6.5
>
>
>
--
Dave Chinner
david@fromorbit.com
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] XFS: remove i_gen from incore inode
2008-10-22 6:20 ` Dave Chinner
@ 2008-10-31 1:27 ` Dave Chinner
0 siblings, 0 replies; 13+ messages in thread
From: Dave Chinner @ 2008-10-31 1:27 UTC (permalink / raw)
To: xfs
Ping?
On Wed, Oct 22, 2008 at 05:20:44PM +1100, Dave Chinner wrote:
> Ping?
>
> On Wed, Oct 08, 2008 at 09:12:29AM +1100, Dave Chinner wrote:
> > i_gen is incremented in directory operations when the
> > directory is changed. It is never read or otherwise used
> > so it should be removed to help reduce the size of the
> > struct xfs_inode.
> >
> > The patch also removes a duplicate logging of the directory
> > inode core. We only need to do this once per transaction
> > so kill the one associated with the i_gen increment.
> >
> > Signed-off-by: Dave Chinner <david@fromorbit.com>
> > ---
> > fs/xfs/xfs_inode.h | 1 -
> > fs/xfs/xfs_rename.c | 12 ++----------
> > fs/xfs/xfs_vnodeops.c | 29 ++---------------------------
> > 3 files changed, 4 insertions(+), 38 deletions(-)
> >
> > diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h
> > index a8f1e68..5784f8e 100644
> > --- a/fs/xfs/xfs_inode.h
> > +++ b/fs/xfs/xfs_inode.h
> > @@ -272,7 +272,6 @@ typedef struct xfs_inode {
> > unsigned short i_flags; /* see defined flags below */
> > unsigned char i_update_core; /* timestamps/size is dirty */
> > unsigned char i_update_size; /* di_size field is dirty */
> > - unsigned int i_gen; /* generation count */
> > unsigned int i_delayed_blks; /* count of delay alloc blks */
> >
> > xfs_icdinode_t i_d; /* most of ondisk inode */
> > diff --git a/fs/xfs/xfs_rename.c b/fs/xfs/xfs_rename.c
> > index d700dac..02f0e8f 100644
> > --- a/fs/xfs/xfs_rename.c
> > +++ b/fs/xfs/xfs_rename.c
> > @@ -367,19 +367,11 @@ xfs_rename(
> > &first_block, &free_list, spaceres);
> > if (error)
> > goto abort_return;
> > - xfs_ichgtime(src_dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
> >
> > - /*
> > - * Update the generation counts on all the directory inodes
> > - * that we're modifying.
> > - */
> > - src_dp->i_gen++;
> > + xfs_ichgtime(src_dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
> > xfs_trans_log_inode(tp, src_dp, XFS_ILOG_CORE);
> > -
> > - if (new_parent) {
> > - target_dp->i_gen++;
> > + if (new_parent)
> > xfs_trans_log_inode(tp, target_dp, XFS_ILOG_CORE);
> > - }
> >
> > /*
> > * If this is a synchronous mount, make sure that the
> > diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
> > index 8b6812f..7a72b0a 100644
> > --- a/fs/xfs/xfs_vnodeops.c
> > +++ b/fs/xfs/xfs_vnodeops.c
> > @@ -1625,8 +1625,6 @@ xfs_create(
> > xfs_trans_set_sync(tp);
> > }
> >
> > - dp->i_gen++;
> > -
> > /*
> > * Attach the dquot(s) to the inodes and modify them incore.
> > * These ids of the inode couldn't have changed since the new
> > @@ -1993,13 +1991,6 @@ xfs_remove(
> > }
> > xfs_ichgtime(dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
> >
> > - /*
> > - * Bump the in memory generation count on the parent
> > - * directory so that other can know that it has changed.
> > - */
> > - dp->i_gen++;
> > - xfs_trans_log_inode(tp, dp, XFS_ILOG_CORE);
> > -
> > if (is_dir) {
> > /*
> > * Drop the link from ip's "..".
> > @@ -2017,8 +2008,8 @@ xfs_remove(
> > } else {
> > /*
> > * When removing a non-directory we need to log the parent
> > - * inode here for the i_gen update. For a directory this is
> > - * done implicitly by the xfs_droplink call for the ".." entry.
> > + * inode here. For a directory this is done implicitly
> > + * by the xfs_droplink call for the ".." entry.
> > */
> > xfs_trans_log_inode(tp, dp, XFS_ILOG_CORE);
> > }
> > @@ -2178,7 +2169,6 @@ xfs_link(
> > if (error)
> > goto abort_return;
> > xfs_ichgtime(tdp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
> > - tdp->i_gen++;
> > xfs_trans_log_inode(tp, tdp, XFS_ILOG_CORE);
> >
> > error = xfs_bumplink(tp, sip);
> > @@ -2355,18 +2345,10 @@ xfs_mkdir(
> > }
> > xfs_ichgtime(dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
> >
> > - /*
> > - * Bump the in memory version number of the parent directory
> > - * so that other processes accessing it will recognize that
> > - * the directory has changed.
> > - */
> > - dp->i_gen++;
> > -
> > error = xfs_dir_init(tp, cdp, dp);
> > if (error)
> > goto error2;
> >
> > - cdp->i_gen = 1;
> > error = xfs_bumplink(tp, dp);
> > if (error)
> > goto error2;
> > @@ -2653,13 +2635,6 @@ xfs_symlink(
> > xfs_trans_log_inode(tp, dp, XFS_ILOG_CORE);
> >
> > /*
> > - * Bump the in memory version number of the parent directory
> > - * so that other processes accessing it will recognize that
> > - * the directory has changed.
> > - */
> > - dp->i_gen++;
> > -
> > - /*
> > * If this is a synchronous mount, make sure that the
> > * symlink transaction goes to disk before returning to
> > * the user.
> > --
> > 1.5.6.5
> >
> >
> >
>
> --
> Dave Chinner
> david@fromorbit.com
>
>
>
--
Dave Chinner
david@fromorbit.com
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] XFS: remove i_gen from incore inode
2008-07-21 12:04 ` Dave Chinner
2008-07-21 12:05 ` Christoph Hellwig
2008-08-11 16:39 ` Christoph Hellwig
@ 2008-11-21 18:01 ` Christoph Hellwig
2 siblings, 0 replies; 13+ messages in thread
From: Christoph Hellwig @ 2008-11-21 18:01 UTC (permalink / raw)
To: Christoph Hellwig, xfs
Any chance we can get this patch in? It's been out for exactly 4 month
in it's final reviewed form, and I still have patches that I rebased on
top of it waiting..
On Mon, Jul 21, 2008 at 10:04:40PM +1000, Dave Chinner wrote:
> XFS: remove i_gen from incore inode
>
> i_gen is incremented in directory operations when the
> directory is changed. It is never read or otherwise used
> so it should be removed to help reduce the size of the
> struct xfs_inode.
>
> The patch also removes a duplicate logging of the directory
> inode core. We only need to do this once per transaction
> so kill the one associated with the i_gen increment.
>
> Signed-off-by: Dave Chinner <david@fromorbit.com>
> ---
> fs/xfs/xfs_inode.h | 1 -
> fs/xfs/xfs_rename.c | 12 ++----------
> fs/xfs/xfs_vnodeops.c | 29 ++---------------------------
> 3 files changed, 4 insertions(+), 38 deletions(-)
>
> diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h
> index 440b443..316c374 100644
> --- a/fs/xfs/xfs_inode.h
> +++ b/fs/xfs/xfs_inode.h
> @@ -223,7 +223,6 @@ typedef struct xfs_inode {
> unsigned short i_flags; /* see defined flags below */
> unsigned char i_update_core; /* timestamps/size is dirty */
> unsigned char i_update_size; /* di_size field is dirty */
> - unsigned int i_gen; /* generation count */
> unsigned int i_delayed_blks; /* count of delay alloc blks */
>
> xfs_icdinode_t i_d; /* most of ondisk inode */
> diff --git a/fs/xfs/xfs_rename.c b/fs/xfs/xfs_rename.c
> index d700dac..02f0e8f 100644
> --- a/fs/xfs/xfs_rename.c
> +++ b/fs/xfs/xfs_rename.c
> @@ -367,19 +367,11 @@ xfs_rename(
> &first_block, &free_list, spaceres);
> if (error)
> goto abort_return;
> - xfs_ichgtime(src_dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
>
> - /*
> - * Update the generation counts on all the directory inodes
> - * that we're modifying.
> - */
> - src_dp->i_gen++;
> + xfs_ichgtime(src_dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
> xfs_trans_log_inode(tp, src_dp, XFS_ILOG_CORE);
> -
> - if (new_parent) {
> - target_dp->i_gen++;
> + if (new_parent)
> xfs_trans_log_inode(tp, target_dp, XFS_ILOG_CORE);
> - }
>
> /*
> * If this is a synchronous mount, make sure that the
> diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
> index 94ec74b..426c574 100644
> --- a/fs/xfs/xfs_vnodeops.c
> +++ b/fs/xfs/xfs_vnodeops.c
> @@ -1798,8 +1798,6 @@ xfs_create(
> xfs_trans_set_sync(tp);
> }
>
> - dp->i_gen++;
> -
> /*
> * Attach the dquot(s) to the inodes and modify them incore.
> * These ids of the inode couldn't have changed since the new
> @@ -2229,13 +2227,6 @@ xfs_remove(
> }
> xfs_ichgtime(dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
>
> - /*
> - * Bump the in memory generation count on the parent
> - * directory so that other can know that it has changed.
> - */
> - dp->i_gen++;
> - xfs_trans_log_inode(tp, dp, XFS_ILOG_CORE);
> -
> if (is_dir) {
> /*
> * Drop the link from ip's "..".
> @@ -2253,8 +2244,8 @@ xfs_remove(
> } else {
> /*
> * When removing a non-directory we need to log the parent
> - * inode here for the i_gen update. For a directory this is
> - * done implicitly by the xfs_droplink call for the ".." entry.
> + * inode here. For a directory this is done implicitly
> + * by the xfs_droplink call for the ".." entry.
> */
> xfs_trans_log_inode(tp, dp, XFS_ILOG_CORE);
> }
> @@ -2423,7 +2414,6 @@ xfs_link(
> if (error)
> goto abort_return;
> xfs_ichgtime(tdp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
> - tdp->i_gen++;
> xfs_trans_log_inode(tp, tdp, XFS_ILOG_CORE);
>
> error = xfs_bumplink(tp, sip);
> @@ -2600,18 +2590,10 @@ xfs_mkdir(
> }
> xfs_ichgtime(dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
>
> - /*
> - * Bump the in memory version number of the parent directory
> - * so that other processes accessing it will recognize that
> - * the directory has changed.
> - */
> - dp->i_gen++;
> -
> error = xfs_dir_init(tp, cdp, dp);
> if (error)
> goto error2;
>
> - cdp->i_gen = 1;
> error = xfs_bumplink(tp, dp);
> if (error)
> goto error2;
> @@ -2898,13 +2880,6 @@ xfs_symlink(
> xfs_trans_log_inode(tp, dp, XFS_ILOG_CORE);
>
> /*
> - * Bump the in memory version number of the parent directory
> - * so that other processes accessing it will recognize that
> - * the directory has changed.
> - */
> - dp->i_gen++;
> -
> - /*
> * If this is a synchronous mount, make sure that the
> * symlink transaction goes to disk before returning to
> * the user.
>
>
---end quoted text---
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2008-11-21 18:01 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-13 13:47 [PATCH] XFS: remove i_gen from incore inode Dave Chinner
2008-09-14 13:16 ` Christoph Hellwig
-- strict thread matches above, loose matches on Subject: below --
2008-10-07 22:12 Dave Chinner
2008-10-22 6:20 ` Dave Chinner
2008-10-31 1:27 ` Dave Chinner
2008-07-20 12:46 Dave Chinner
2008-07-21 7:54 ` Christoph Hellwig
2008-07-21 11:08 ` Dave Chinner
2008-07-21 11:52 ` Christoph Hellwig
2008-07-21 12:04 ` Dave Chinner
2008-07-21 12:05 ` Christoph Hellwig
2008-08-11 16:39 ` Christoph Hellwig
2008-11-21 18:01 ` Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox