diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2006-01-17 16:26:28 +0100 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2006-01-17 16:26:28 +0100 |
commit | 0825788ff27c7145e9d558cb2a26f3837d1f9be5 (patch) | |
tree | f6bdb892cec8ca0df69c08a3477c89f1542999e5 /fs/file_table.c | |
parent | Merge branch 'upstream' (diff) | |
parent | [PATCH] libata: add a function to decide if we need iordy (diff) | |
download | linux-0825788ff27c7145e9d558cb2a26f3837d1f9be5.tar.xz linux-0825788ff27c7145e9d558cb2a26f3837d1f9be5.zip |
Merge branch 'upstream'
Diffstat (limited to 'fs/file_table.c')
-rw-r--r-- | fs/file_table.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/file_table.c b/fs/file_table.c index c3a5e2fd663b..768b58167543 100644 --- a/fs/file_table.c +++ b/fs/file_table.c @@ -16,6 +16,7 @@ #include <linux/eventpoll.h> #include <linux/rcupdate.h> #include <linux/mount.h> +#include <linux/capability.h> #include <linux/cdev.h> #include <linux/fsnotify.h> @@ -117,7 +118,7 @@ EXPORT_SYMBOL(get_empty_filp); void fastcall fput(struct file *file) { - if (rcuref_dec_and_test(&file->f_count)) + if (atomic_dec_and_test(&file->f_count)) __fput(file); } @@ -166,7 +167,7 @@ struct file fastcall *fget(unsigned int fd) rcu_read_lock(); file = fcheck_files(files, fd); if (file) { - if (!rcuref_inc_lf(&file->f_count)) { + if (!atomic_inc_not_zero(&file->f_count)) { /* File object ref couldn't be taken */ rcu_read_unlock(); return NULL; @@ -198,7 +199,7 @@ struct file fastcall *fget_light(unsigned int fd, int *fput_needed) rcu_read_lock(); file = fcheck_files(files, fd); if (file) { - if (rcuref_inc_lf(&file->f_count)) + if (atomic_inc_not_zero(&file->f_count)) *fput_needed = 1; else /* Didn't get the reference, someone's freed */ @@ -213,7 +214,7 @@ struct file fastcall *fget_light(unsigned int fd, int *fput_needed) void put_filp(struct file *file) { - if (rcuref_dec_and_test(&file->f_count)) { + if (atomic_dec_and_test(&file->f_count)) { security_file_free(file); file_kill(file); file_free(file); |