aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/ext3/namei.c21
-rw-r--r--fs/ext4/namei.c21
2 files changed, 6 insertions, 36 deletions
diff --git a/fs/ext3/namei.c b/fs/ext3/namei.c
index 57402b5f030c..a8e89328e66d 100644
--- a/fs/ext3/namei.c
+++ b/fs/ext3/namei.c
@@ -1618,21 +1618,6 @@ static int ext3_delete_entry (handle_t *handle,
1618 return -ENOENT; 1618 return -ENOENT;
1619} 1619}
1620 1620
1621/*
1622 * ext3_mark_inode_dirty is somewhat expensive, so unlike ext2 we
1623 * do not perform it in these functions. We perform it at the call site,
1624 * if it is needed.
1625 */
1626static inline void ext3_inc_count(handle_t *handle, struct inode *inode)
1627{
1628 inc_nlink(inode);
1629}
1630
1631static inline void ext3_dec_count(handle_t *handle, struct inode *inode)
1632{
1633 drop_nlink(inode);
1634}
1635
1636static int ext3_add_nondir(handle_t *handle, 1621static int ext3_add_nondir(handle_t *handle,
1637 struct dentry *dentry, struct inode *inode) 1622 struct dentry *dentry, struct inode *inode)
1638{ 1623{
@@ -1642,7 +1627,7 @@ static int ext3_add_nondir(handle_t *handle,
1642 d_instantiate(dentry, inode); 1627 d_instantiate(dentry, inode);
1643 return 0; 1628 return 0;
1644 } 1629 }
1645 ext3_dec_count(handle, inode); 1630 drop_nlink(inode);
1646 iput(inode); 1631 iput(inode);
1647 return err; 1632 return err;
1648} 1633}
@@ -2163,7 +2148,7 @@ retry:
2163 err = __page_symlink(inode, symname, l, 2148 err = __page_symlink(inode, symname, l,
2164 mapping_gfp_mask(inode->i_mapping) & ~__GFP_FS); 2149 mapping_gfp_mask(inode->i_mapping) & ~__GFP_FS);
2165 if (err) { 2150 if (err) {
2166 ext3_dec_count(handle, inode); 2151 drop_nlink(inode);
2167 ext3_mark_inode_dirty(handle, inode); 2152 ext3_mark_inode_dirty(handle, inode);
2168 iput (inode); 2153 iput (inode);
2169 goto out_stop; 2154 goto out_stop;
@@ -2208,7 +2193,7 @@ retry:
2208 handle->h_sync = 1; 2193 handle->h_sync = 1;
2209 2194
2210 inode->i_ctime = CURRENT_TIME_SEC; 2195 inode->i_ctime = CURRENT_TIME_SEC;
2211 ext3_inc_count(handle, inode); 2196 inc_nlink(inode);
2212 atomic_inc(&inode->i_count); 2197 atomic_inc(&inode->i_count);
2213 2198
2214 err = ext3_add_nondir(handle, dentry, inode); 2199 err = ext3_add_nondir(handle, dentry, inode);
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index 05c0d7f8fdf9..34b3448b40f9 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -1616,21 +1616,6 @@ static int ext4_delete_entry (handle_t *handle,
1616 return -ENOENT; 1616 return -ENOENT;
1617} 1617}
1618 1618
1619/*
1620 * ext4_mark_inode_dirty is somewhat expensive, so unlike ext2 we
1621 * do not perform it in these functions. We perform it at the call site,
1622 * if it is needed.
1623 */
1624static inline void ext4_inc_count(handle_t *handle, struct inode *inode)
1625{
1626 inc_nlink(inode);
1627}
1628
1629static inline void ext4_dec_count(handle_t *handle, struct inode *inode)
1630{
1631 drop_nlink(inode);
1632}
1633
1634static int ext4_add_nondir(handle_t *handle, 1619static int ext4_add_nondir(handle_t *handle,
1635 struct dentry *dentry, struct inode *inode) 1620 struct dentry *dentry, struct inode *inode)
1636{ 1621{
@@ -1640,7 +1625,7 @@ static int ext4_add_nondir(handle_t *handle,
1640 d_instantiate(dentry, inode); 1625 d_instantiate(dentry, inode);
1641 return 0; 1626 return 0;
1642 } 1627 }
1643 ext4_dec_count(handle, inode); 1628 drop_nlink(inode);
1644 iput(inode); 1629 iput(inode);
1645 return err; 1630 return err;
1646} 1631}
@@ -2161,7 +2146,7 @@ retry:
2161 err = __page_symlink(inode, symname, l, 2146 err = __page_symlink(inode, symname, l,
2162 mapping_gfp_mask(inode->i_mapping) & ~__GFP_FS); 2147 mapping_gfp_mask(inode->i_mapping) & ~__GFP_FS);
2163 if (err) { 2148 if (err) {
2164 ext4_dec_count(handle, inode); 2149 drop_nlink(inode);
2165 ext4_mark_inode_dirty(handle, inode); 2150 ext4_mark_inode_dirty(handle, inode);
2166 iput (inode); 2151 iput (inode);
2167 goto out_stop; 2152 goto out_stop;
@@ -2206,7 +2191,7 @@ retry:
2206 handle->h_sync = 1; 2191 handle->h_sync = 1;
2207 2192
2208 inode->i_ctime = CURRENT_TIME_SEC; 2193 inode->i_ctime = CURRENT_TIME_SEC;
2209 ext4_inc_count(handle, inode); 2194 inc_nlink(inode);
2210 atomic_inc(&inode->i_count); 2195 atomic_inc(&inode->i_count);
2211 2196
2212 err = ext4_add_nondir(handle, dentry, inode); 2197 err = ext4_add_nondir(handle, dentry, inode);