mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-23 07:01:23 +00:00
[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>
This commit is contained in:
parent
3c333937ee
commit
516e0cc564
11 changed files with 27 additions and 39 deletions
|
@ -795,7 +795,7 @@ struct file {
|
|||
#define f_dentry f_path.dentry
|
||||
#define f_vfsmnt f_path.mnt
|
||||
const struct file_operations *f_op;
|
||||
atomic_t f_count;
|
||||
atomic_long_t f_count;
|
||||
unsigned int f_flags;
|
||||
mode_t f_mode;
|
||||
loff_t f_pos;
|
||||
|
@ -824,8 +824,8 @@ extern spinlock_t files_lock;
|
|||
#define file_list_lock() spin_lock(&files_lock);
|
||||
#define file_list_unlock() spin_unlock(&files_lock);
|
||||
|
||||
#define get_file(x) atomic_inc(&(x)->f_count)
|
||||
#define file_count(x) atomic_read(&(x)->f_count)
|
||||
#define get_file(x) atomic_long_inc(&(x)->f_count)
|
||||
#define file_count(x) atomic_long_read(&(x)->f_count)
|
||||
|
||||
#ifdef CONFIG_DEBUG_WRITECOUNT
|
||||
static inline void file_take_write(struct file *f)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue