Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=825f1481ead4ce40671089bae7412ac3519e8caa
Commit:     825f1481ead4ce40671089bae7412ac3519e8caa
Parent:     74d3487fc8aa58cec16dff7239dea1ca59bdab0e
Author:     Theodore Ts'o <[EMAIL PROTECTED]>
AuthorDate: Fri Feb 15 15:00:38 2008 -0500
Committer:  Theodore Ts'o <[EMAIL PROTECTED]>
CommitDate: Fri Feb 15 15:00:38 2008 -0500

    ext4: Don't use ext4_dec_count() if not needed
    
    The ext4_dec_count() function is only needed when dropping the i_nlink
    count on inodes which are (or which could be) directories.  If we
    *know* that the inode in question can't possibly be a directory, use
    drop_nlink or clear_nlink() if we know i_nlink is 1.
    
    Signed-off-by: "Theodore Ts'o" <[EMAIL PROTECTED]>
---
 fs/ext4/namei.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index fffd080..5a79c6b 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -2161,7 +2161,7 @@ static int ext4_unlink(struct inode * dir, struct dentry 
*dentry)
        dir->i_ctime = dir->i_mtime = ext4_current_time(dir);
        ext4_update_dx_flag(dir);
        ext4_mark_inode_dirty(handle, dir);
-       ext4_dec_count(handle, inode);
+       drop_nlink(inode);
        if (!inode->i_nlink)
                ext4_orphan_add(handle, inode);
        inode->i_ctime = ext4_current_time(inode);
@@ -2211,7 +2211,7 @@ retry:
                err = __page_symlink(inode, symname, l,
                                mapping_gfp_mask(inode->i_mapping) & ~__GFP_FS);
                if (err) {
-                       ext4_dec_count(handle, inode);
+                       clear_nlink(inode);
                        ext4_mark_inode_dirty(handle, inode);
                        iput (inode);
                        goto out_stop;
@@ -2404,7 +2404,7 @@ static int ext4_rename (struct inode * old_dir, struct 
dentry *old_dentry,
                ext4_dec_count(handle, old_dir);
                if (new_inode) {
                        /* checked empty_dir above, can't have another parent,
-                        * ext3_dec_count() won't work for many-linked dirs */
+                        * ext4_dec_count() won't work for many-linked dirs */
                        new_inode->i_nlink = 0;
                } else {
                        ext4_inc_count(handle, new_dir);
-
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