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 /fs/hfs | |
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 'fs/hfs')
-rw-r--r-- | fs/hfs/inode.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/fs/hfs/inode.c b/fs/hfs/inode.c index aa73f3fd5dd9..7e19835efa2e 100644 --- a/fs/hfs/inode.c +++ b/fs/hfs/inode.c | |||
@@ -522,8 +522,6 @@ static int hfs_file_open(struct inode *inode, struct file *file) | |||
522 | { | 522 | { |
523 | if (HFS_IS_RSRC(inode)) | 523 | if (HFS_IS_RSRC(inode)) |
524 | inode = HFS_I(inode)->rsrc_inode; | 524 | inode = HFS_I(inode)->rsrc_inode; |
525 | if (atomic_read(&file->f_count) != 1) | ||
526 | return 0; | ||
527 | atomic_inc(&HFS_I(inode)->opencnt); | 525 | atomic_inc(&HFS_I(inode)->opencnt); |
528 | return 0; | 526 | return 0; |
529 | } | 527 | } |
@@ -534,8 +532,6 @@ static int hfs_file_release(struct inode *inode, struct file *file) | |||
534 | 532 | ||
535 | if (HFS_IS_RSRC(inode)) | 533 | if (HFS_IS_RSRC(inode)) |
536 | inode = HFS_I(inode)->rsrc_inode; | 534 | inode = HFS_I(inode)->rsrc_inode; |
537 | if (atomic_read(&file->f_count) != 0) | ||
538 | return 0; | ||
539 | if (atomic_dec_and_test(&HFS_I(inode)->opencnt)) { | 535 | if (atomic_dec_and_test(&HFS_I(inode)->opencnt)) { |
540 | mutex_lock(&inode->i_mutex); | 536 | mutex_lock(&inode->i_mutex); |
541 | hfs_file_truncate(inode); | 537 | hfs_file_truncate(inode); |