aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs
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
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')
-rw-r--r--fs/xfs/xfs_inode.h1
-rw-r--r--fs/xfs/xfs_rename.c12
-rw-r--r--fs/xfs/xfs_vnodeops.c29
3 files changed, 4 insertions, 38 deletions
diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h
index 7f007ef4bbb3..ea691c738f2e 100644
--- a/fs/xfs/xfs_inode.h
+++ b/fs/xfs/xfs_inode.h
@@ -261,7 +261,6 @@ typedef struct xfs_inode {
261 unsigned short i_flags; /* see defined flags below */ 261 unsigned short i_flags; /* see defined flags below */
262 unsigned char i_update_core; /* timestamps/size is dirty */ 262 unsigned char i_update_core; /* timestamps/size is dirty */
263 unsigned char i_update_size; /* di_size field is dirty */ 263 unsigned char i_update_size; /* di_size field is dirty */
264 unsigned int i_gen; /* generation count */
265 unsigned int i_delayed_blks; /* count of delay alloc blks */ 264 unsigned int i_delayed_blks; /* count of delay alloc blks */
266 265
267 xfs_icdinode_t i_d; /* most of ondisk inode */ 266 xfs_icdinode_t i_d; /* most of ondisk inode */
diff --git a/fs/xfs/xfs_rename.c b/fs/xfs/xfs_rename.c
index d700dacdb10e..02f0e8f53a94 100644
--- a/fs/xfs/xfs_rename.c
+++ b/fs/xfs/xfs_rename.c
@@ -367,19 +367,11 @@ xfs_rename(
367 &first_block, &free_list, spaceres); 367 &first_block, &free_list, spaceres);
368 if (error) 368 if (error)
369 goto abort_return; 369 goto abort_return;
370 xfs_ichgtime(src_dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
371 370
372 /* 371 xfs_ichgtime(src_dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
373 * Update the generation counts on all the directory inodes
374 * that we're modifying.
375 */
376 src_dp->i_gen++;
377 xfs_trans_log_inode(tp, src_dp, XFS_ILOG_CORE); 372 xfs_trans_log_inode(tp, src_dp, XFS_ILOG_CORE);
378 373 if (new_parent)
379 if (new_parent) {
380 target_dp->i_gen++;
381 xfs_trans_log_inode(tp, target_dp, XFS_ILOG_CORE); 374 xfs_trans_log_inode(tp, target_dp, XFS_ILOG_CORE);
382 }
383 375
384 /* 376 /*
385 * If this is a synchronous mount, make sure that the 377 * 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 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.