Commit 731b9a54 authored by Eric Sandeen's avatar Eric Sandeen Committed by Linus Torvalds
Browse files

[PATCH] remove ext[34]_inc_count and _dec_count



- Naming is confusing, ext3_inc_count manipulates i_nlink not i_count
- handle argument passed in is not used
- ext3 and ext4 already call inc_nlink and dec_nlink directly in other places
Signed-off-by: default avatarEric Sandeen <sandeen@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 2988a774
...@@ -1618,21 +1618,6 @@ static int ext3_delete_entry (handle_t *handle, ...@@ -1618,21 +1618,6 @@ static int ext3_delete_entry (handle_t *handle,
return -ENOENT; return -ENOENT;
} }
/*
* ext3_mark_inode_dirty is somewhat expensive, so unlike ext2 we
* do not perform it in these functions. We perform it at the call site,
* if it is needed.
*/
static inline void ext3_inc_count(handle_t *handle, struct inode *inode)
{
inc_nlink(inode);
}
static inline void ext3_dec_count(handle_t *handle, struct inode *inode)
{
drop_nlink(inode);
}
static int ext3_add_nondir(handle_t *handle, static int ext3_add_nondir(handle_t *handle,
struct dentry *dentry, struct inode *inode) struct dentry *dentry, struct inode *inode)
{ {
...@@ -1642,7 +1627,7 @@ static int ext3_add_nondir(handle_t *handle, ...@@ -1642,7 +1627,7 @@ static int ext3_add_nondir(handle_t *handle,
d_instantiate(dentry, inode); d_instantiate(dentry, inode);
return 0; return 0;
} }
ext3_dec_count(handle, inode); drop_nlink(inode);
iput(inode); iput(inode);
return err; return err;
} }
...@@ -2163,7 +2148,7 @@ retry: ...@@ -2163,7 +2148,7 @@ retry:
err = __page_symlink(inode, symname, l, err = __page_symlink(inode, symname, l,
mapping_gfp_mask(inode->i_mapping) & ~__GFP_FS); mapping_gfp_mask(inode->i_mapping) & ~__GFP_FS);
if (err) { if (err) {
ext3_dec_count(handle, inode); drop_nlink(inode);
ext3_mark_inode_dirty(handle, inode); ext3_mark_inode_dirty(handle, inode);
iput (inode); iput (inode);
goto out_stop; goto out_stop;
...@@ -2208,7 +2193,7 @@ retry: ...@@ -2208,7 +2193,7 @@ retry:
handle->h_sync = 1; handle->h_sync = 1;
inode->i_ctime = CURRENT_TIME_SEC; inode->i_ctime = CURRENT_TIME_SEC;
ext3_inc_count(handle, inode); inc_nlink(inode);
atomic_inc(&inode->i_count); atomic_inc(&inode->i_count);
err = ext3_add_nondir(handle, dentry, inode); err = ext3_add_nondir(handle, dentry, inode);
......
...@@ -1616,21 +1616,6 @@ static int ext4_delete_entry (handle_t *handle, ...@@ -1616,21 +1616,6 @@ static int ext4_delete_entry (handle_t *handle,
return -ENOENT; return -ENOENT;
} }
/*
* ext4_mark_inode_dirty is somewhat expensive, so unlike ext2 we
* do not perform it in these functions. We perform it at the call site,
* if it is needed.
*/
static inline void ext4_inc_count(handle_t *handle, struct inode *inode)
{
inc_nlink(inode);
}
static inline void ext4_dec_count(handle_t *handle, struct inode *inode)
{
drop_nlink(inode);
}
static int ext4_add_nondir(handle_t *handle, static int ext4_add_nondir(handle_t *handle,
struct dentry *dentry, struct inode *inode) struct dentry *dentry, struct inode *inode)
{ {
...@@ -1640,7 +1625,7 @@ static int ext4_add_nondir(handle_t *handle, ...@@ -1640,7 +1625,7 @@ static int ext4_add_nondir(handle_t *handle,
d_instantiate(dentry, inode); d_instantiate(dentry, inode);
return 0; return 0;
} }
ext4_dec_count(handle, inode); drop_nlink(inode);
iput(inode); iput(inode);
return err; return err;
} }
...@@ -2161,7 +2146,7 @@ retry: ...@@ -2161,7 +2146,7 @@ retry:
err = __page_symlink(inode, symname, l, err = __page_symlink(inode, symname, l,
mapping_gfp_mask(inode->i_mapping) & ~__GFP_FS); mapping_gfp_mask(inode->i_mapping) & ~__GFP_FS);
if (err) { if (err) {
ext4_dec_count(handle, inode); drop_nlink(inode);
ext4_mark_inode_dirty(handle, inode); ext4_mark_inode_dirty(handle, inode);
iput (inode); iput (inode);
goto out_stop; goto out_stop;
...@@ -2206,7 +2191,7 @@ retry: ...@@ -2206,7 +2191,7 @@ retry:
handle->h_sync = 1; handle->h_sync = 1;
inode->i_ctime = CURRENT_TIME_SEC; inode->i_ctime = CURRENT_TIME_SEC;
ext4_inc_count(handle, inode); inc_nlink(inode);
atomic_inc(&inode->i_count); atomic_inc(&inode->i_count);
err = ext4_add_nondir(handle, dentry, inode); err = ext4_add_nondir(handle, dentry, inode);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment