aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_vnodeops.c
diff options
context:
space:
mode:
authorDave Chinner <david@fromorbit.com>2008-11-27 22:23:37 -0500
committerNiv Sardi <xaiki@sgi.com>2008-11-30 19:37:10 -0500
commit26c5295135d10fc90cbf160adfda392d91f58279 (patch)
tree783ec22542fc70bd2bcab6c111205dc62b214e71 /fs/xfs/xfs_vnodeops.c
parent207fcfad58482c7c9f92939a1f6df9f7e8873a34 (diff)
[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> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Niv Sardi <xaiki@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_vnodeops.c')
-rw-r--r--fs/xfs/xfs_vnodeops.c29
1 files changed, 2 insertions, 27 deletions
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
index f26b038004a7..b29a0eb9c0f7 100644
--- a/fs/xfs/xfs_vnodeops.c
+++ b/fs/xfs/xfs_vnodeops.c
@@ -1599,8 +1599,6 @@ xfs_create(
1599 xfs_trans_set_sync(tp); 1599 xfs_trans_set_sync(tp);
1600 } 1600 }
1601 1601
1602 dp->i_gen++;
1603
1604 /* 1602 /*
1605 * Attach the dquot(s) to the inodes and modify them incore. 1603 * Attach the dquot(s) to the inodes and modify them incore.
1606 * These ids of the inode couldn't have changed since the new 1604 * These ids of the inode couldn't have changed since the new
@@ -1967,13 +1965,6 @@ xfs_remove(
1967 } 1965 }
1968 xfs_ichgtime(dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG); 1966 xfs_ichgtime(dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
1969 1967
1970 /*
1971 * Bump the in memory generation count on the parent
1972 * directory so that other can know that it has changed.
1973 */
1974 dp->i_gen++;
1975 xfs_trans_log_inode(tp, dp, XFS_ILOG_CORE);
1976
1977 if (is_dir) { 1968 if (is_dir) {
1978 /* 1969 /*
1979 * Drop the link from ip's "..". 1970 * Drop the link from ip's "..".
@@ -1991,8 +1982,8 @@ xfs_remove(
1991 } else { 1982 } else {
1992 /* 1983 /*
1993 * When removing a non-directory we need to log the parent 1984 * When removing a non-directory we need to log the parent
1994 * inode here for the i_gen update. For a directory this is 1985 * inode here. For a directory this is done implicitly
1995 * done implicitly by the xfs_droplink call for the ".." entry. 1986 * by the xfs_droplink call for the ".." entry.
1996 */ 1987 */
1997 xfs_trans_log_inode(tp, dp, XFS_ILOG_CORE); 1988 xfs_trans_log_inode(tp, dp, XFS_ILOG_CORE);
1998 } 1989 }
@@ -2152,7 +2143,6 @@ xfs_link(
2152 if (error) 2143 if (error)
2153 goto abort_return; 2144 goto abort_return;
2154 xfs_ichgtime(tdp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG); 2145 xfs_ichgtime(tdp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
2155 tdp->i_gen++;
2156 xfs_trans_log_inode(tp, tdp, XFS_ILOG_CORE); 2146 xfs_trans_log_inode(tp, tdp, XFS_ILOG_CORE);
2157 2147
2158 error = xfs_bumplink(tp, sip); 2148 error = xfs_bumplink(tp, sip);
@@ -2329,18 +2319,10 @@ xfs_mkdir(
2329 } 2319 }
2330 xfs_ichgtime(dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG); 2320 xfs_ichgtime(dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
2331 2321
2332 /*
2333 * Bump the in memory version number of the parent directory
2334 * so that other processes accessing it will recognize that
2335 * the directory has changed.
2336 */
2337 dp->i_gen++;
2338
2339 error = xfs_dir_init(tp, cdp, dp); 2322 error = xfs_dir_init(tp, cdp, dp);
2340 if (error) 2323 if (error)
2341 goto error2; 2324 goto error2;
2342 2325
2343 cdp->i_gen = 1;
2344 error = xfs_bumplink(tp, dp); 2326 error = xfs_bumplink(tp, dp);
2345 if (error) 2327 if (error)
2346 goto error2; 2328 goto error2;
@@ -2627,13 +2609,6 @@ xfs_symlink(
2627 xfs_trans_log_inode(tp, dp, XFS_ILOG_CORE); 2609 xfs_trans_log_inode(tp, dp, XFS_ILOG_CORE);
2628 2610
2629 /* 2611 /*
2630 * Bump the in memory version number of the parent directory
2631 * so that other processes accessing it will recognize that
2632 * the directory has changed.
2633 */
2634 dp->i_gen++;
2635
2636 /*
2637 * If this is a synchronous mount, make sure that the 2612 * If this is a synchronous mount, make sure that the
2638 * symlink transaction goes to disk before returning to 2613 * symlink transaction goes to disk before returning to
2639 * the user. 2614 * the user.