diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2008-07-26 00:39:17 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2008-07-26 20:53:40 -0400 |
commit | 516e0cc5646f377ab80fcc2ee639892eccb99853 (patch) | |
tree | e06296dcedb42dbe397d237887873e70c5823d51 /include/linux/fs.h | |
parent | 3c333937ee3be114b181c4861188cfe8f6a59697 (diff) |
[PATCH] f_count may wrap around
make it atomic_long_t; while we are at it, get rid of useless checks in affs,
hfs and hpfs - ->open() always has it equal to 1, ->release() - to 0.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r-- | include/linux/fs.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 9d2de4cadabd..7676fa1c20ae 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -795,7 +795,7 @@ struct file { | |||
795 | #define f_dentry f_path.dentry | 795 | #define f_dentry f_path.dentry |
796 | #define f_vfsmnt f_path.mnt | 796 | #define f_vfsmnt f_path.mnt |
797 | const struct file_operations *f_op; | 797 | const struct file_operations *f_op; |
798 | atomic_t f_count; | 798 | atomic_long_t f_count; |
799 | unsigned int f_flags; | 799 | unsigned int f_flags; |
800 | mode_t f_mode; | 800 | mode_t f_mode; |
801 | loff_t f_pos; | 801 | loff_t f_pos; |
@@ -824,8 +824,8 @@ extern spinlock_t files_lock; | |||
824 | #define file_list_lock() spin_lock(&files_lock); | 824 | #define file_list_lock() spin_lock(&files_lock); |
825 | #define file_list_unlock() spin_unlock(&files_lock); | 825 | #define file_list_unlock() spin_unlock(&files_lock); |
826 | 826 | ||
827 | #define get_file(x) atomic_inc(&(x)->f_count) | 827 | #define get_file(x) atomic_long_inc(&(x)->f_count) |
828 | #define file_count(x) atomic_read(&(x)->f_count) | 828 | #define file_count(x) atomic_long_read(&(x)->f_count) |
829 | 829 | ||
830 | #ifdef CONFIG_DEBUG_WRITECOUNT | 830 | #ifdef CONFIG_DEBUG_WRITECOUNT |
831 | static inline void file_take_write(struct file *f) | 831 | static inline void file_take_write(struct file *f) |