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 | |
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')
-rw-r--r-- | include/linux/fs.h | 6 | ||||
-rw-r--r-- | include/net/af_unix.h | 2 |
2 files changed, 4 insertions, 4 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) |
diff --git a/include/net/af_unix.h b/include/net/af_unix.h index 2dfa96b0575e..7dd29b7e461d 100644 --- a/include/net/af_unix.h +++ b/include/net/af_unix.h | |||
@@ -51,7 +51,7 @@ struct unix_sock { | |||
51 | struct sock *peer; | 51 | struct sock *peer; |
52 | struct sock *other; | 52 | struct sock *other; |
53 | struct list_head link; | 53 | struct list_head link; |
54 | atomic_t inflight; | 54 | atomic_long_t inflight; |
55 | spinlock_t lock; | 55 | spinlock_t lock; |
56 | unsigned int gc_candidate : 1; | 56 | unsigned int gc_candidate : 1; |
57 | wait_queue_head_t peer_wait; | 57 | wait_queue_head_t peer_wait; |