diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2014-03-14 10:06:32 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2014-04-01 23:19:12 -0400 |
commit | 4597e695b8baa3e2620da89c7593be70cf20566b (patch) | |
tree | f8e8cf56e4b154e8bef5e6ae2aa802526ccd1668 /fs | |
parent | dd20908a8a06b22c171f6c3fcdbdbd65bed07505 (diff) |
get rid of DEBUG_WRITECOUNT
it only makes control flow in __fput() and friends more convoluted.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/file_table.c | 5 | ||||
-rw-r--r-- | fs/open.c | 8 |
2 files changed, 0 insertions, 13 deletions
diff --git a/fs/file_table.c b/fs/file_table.c index 79ecae62209a..ee20658a0647 100644 --- a/fs/file_table.c +++ b/fs/file_table.c | |||
@@ -52,7 +52,6 @@ static void file_free_rcu(struct rcu_head *head) | |||
52 | static inline void file_free(struct file *f) | 52 | static inline void file_free(struct file *f) |
53 | { | 53 | { |
54 | percpu_counter_dec(&nr_files); | 54 | percpu_counter_dec(&nr_files); |
55 | file_check_state(f); | ||
56 | call_rcu(&f->f_u.fu_rcuhead, file_free_rcu); | 55 | call_rcu(&f->f_u.fu_rcuhead, file_free_rcu); |
57 | } | 56 | } |
58 | 57 | ||
@@ -186,7 +185,6 @@ struct file *alloc_file(struct path *path, fmode_t mode, | |||
186 | * that we can do debugging checks at __fput() | 185 | * that we can do debugging checks at __fput() |
187 | */ | 186 | */ |
188 | if ((mode & FMODE_WRITE) && !special_file(path->dentry->d_inode->i_mode)) { | 187 | if ((mode & FMODE_WRITE) && !special_file(path->dentry->d_inode->i_mode)) { |
189 | file_take_write(file); | ||
190 | WARN_ON(mnt_clone_write(path->mnt)); | 188 | WARN_ON(mnt_clone_write(path->mnt)); |
191 | } | 189 | } |
192 | if ((mode & (FMODE_READ | FMODE_WRITE)) == FMODE_READ) | 190 | if ((mode & (FMODE_READ | FMODE_WRITE)) == FMODE_READ) |
@@ -213,10 +211,7 @@ static void drop_file_write_access(struct file *file) | |||
213 | return; | 211 | return; |
214 | 212 | ||
215 | put_write_access(inode); | 213 | put_write_access(inode); |
216 | if (file_check_writeable(file) != 0) | ||
217 | return; | ||
218 | __mnt_drop_write(mnt); | 214 | __mnt_drop_write(mnt); |
219 | file_release_write(file); | ||
220 | } | 215 | } |
221 | 216 | ||
222 | /* the real guts of fput() - releasing the last reference to file | 217 | /* the real guts of fput() - releasing the last reference to file |
@@ -683,7 +683,6 @@ static int do_dentry_open(struct file *f, | |||
683 | error = __get_file_write_access(inode, f->f_path.mnt); | 683 | error = __get_file_write_access(inode, f->f_path.mnt); |
684 | if (error) | 684 | if (error) |
685 | goto cleanup_file; | 685 | goto cleanup_file; |
686 | file_take_write(f); | ||
687 | } | 686 | } |
688 | 687 | ||
689 | f->f_mapping = inode->i_mapping; | 688 | f->f_mapping = inode->i_mapping; |
@@ -731,14 +730,7 @@ cleanup_all: | |||
731 | fops_put(f->f_op); | 730 | fops_put(f->f_op); |
732 | if (f->f_mode & FMODE_WRITE) { | 731 | if (f->f_mode & FMODE_WRITE) { |
733 | if (!special_file(inode->i_mode)) { | 732 | if (!special_file(inode->i_mode)) { |
734 | /* | ||
735 | * We don't consider this a real | ||
736 | * mnt_want/drop_write() pair | ||
737 | * because it all happenend right | ||
738 | * here, so just reset the state. | ||
739 | */ | ||
740 | put_write_access(inode); | 733 | put_write_access(inode); |
741 | file_reset_write(f); | ||
742 | __mnt_drop_write(f->f_path.mnt); | 734 | __mnt_drop_write(f->f_path.mnt); |
743 | } | 735 | } |
744 | } | 736 | } |