Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4188c78d951d8a44630f4c33bc0f5b63374572a4
Commit:     4188c78d951d8a44630f4c33bc0f5b63374572a4
Parent:     222096ae7f7616caa9e4150948096160cc8a8141
Author:     Christoph Hellwig <[EMAIL PROTECTED]>
AuthorDate: Tue Feb 5 12:13:53 2008 +1100
Committer:  Lachlan McIlroy <[EMAIL PROTECTED]>
CommitDate: Thu Feb 7 18:23:38 2008 +1100

    [XFS] keep i_nlink updated and use proper accessors
    
    To get the read-only bind mounts in -mm to work correctly with XFS we need
    to call the drop_nlink and inc_nlink helpers to monitor the link count.
    Add calls to these to xfs_bumplink and xfs_droplink and stop copying over
    di_nlink to i_nlink in xfs_validate_fields and vn_revalidate.
    
    SGI-PV: 971186
    SGI-Modid: xfs-linux-melb:xfs-kern:30392a
    
    Signed-off-by: Christoph Hellwig <[EMAIL PROTECTED]>
    Signed-off-by: Lachlan McIlroy <[EMAIL PROTECTED]>
---
 fs/xfs/linux-2.6/xfs_iops.c  |    1 -
 fs/xfs/linux-2.6/xfs_vnode.c |    1 -
 fs/xfs/xfs_utils.c           |    2 ++
 3 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c
index 5e16016..cc4abd3 100644
--- a/fs/xfs/linux-2.6/xfs_iops.c
+++ b/fs/xfs/linux-2.6/xfs_iops.c
@@ -201,7 +201,6 @@ xfs_validate_fields(
        struct xfs_inode        *ip = XFS_I(inode);
        loff_t size;
 
-       inode->i_nlink = ip->i_d.di_nlink;
        /* we're under i_sem so i_size can't change under us */
        size = XFS_ISIZE(ip);
        if (i_size_read(inode) != size)
diff --git a/fs/xfs/linux-2.6/xfs_vnode.c b/fs/xfs/linux-2.6/xfs_vnode.c
index 9bf36dc..44a48ef 100644
--- a/fs/xfs/linux-2.6/xfs_vnode.c
+++ b/fs/xfs/linux-2.6/xfs_vnode.c
@@ -103,7 +103,6 @@ vn_revalidate(
 
        xfs_ilock(ip, XFS_ILOCK_SHARED);
        inode->i_mode       = ip->i_d.di_mode;
-       inode->i_nlink      = ip->i_d.di_nlink;
        inode->i_uid        = ip->i_d.di_uid;
        inode->i_gid        = ip->i_d.di_gid;
        inode->i_mtime.tv_sec = ip->i_d.di_mtime.t_sec;
diff --git a/fs/xfs/xfs_utils.c b/fs/xfs/xfs_utils.c
index 4df466f..45d740d 100644
--- a/fs/xfs/xfs_utils.c
+++ b/fs/xfs/xfs_utils.c
@@ -302,6 +302,7 @@ xfs_droplink(
 
        ASSERT (ip->i_d.di_nlink > 0);
        ip->i_d.di_nlink--;
+       drop_nlink(ip->i_vnode);
        xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
 
        error = 0;
@@ -365,6 +366,7 @@ xfs_bumplink(
 
        ASSERT(ip->i_d.di_nlink > 0);
        ip->i_d.di_nlink++;
+       inc_nlink(ip->i_vnode);
        if ((ip->i_d.di_version == XFS_DINODE_VERSION_1) &&
            (ip->i_d.di_nlink > XFS_MAXLINK_1)) {
                /*
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to