aboutsummaryrefslogtreecommitdiffstats
path: root/fs/file_table.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-07-26 23:23:44 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-26 23:23:44 -0400
commit4836e3007882984279ca63d3c42bf0b14616eb78 (patch)
tree28bf22726964e068b825491d71a141eefedbe5f8 /fs/file_table.c
parent5c7c204aeca51ccfad63caab4fcdc5d8026c0fd8 (diff)
parent4e1e018ecc6f7bfd10fc75b3ff9715cc8164e0a2 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (39 commits) [PATCH] fix RLIM_NOFILE handling [PATCH] get rid of corner case in dup3() entirely [PATCH] remove remaining namei_{32,64}.h crap [PATCH] get rid of indirect users of namei.h [PATCH] get rid of __user_path_lookup_open [PATCH] f_count may wrap around [PATCH] dup3 fix [PATCH] don't pass nameidata to __ncp_lookup_validate() [PATCH] don't pass nameidata to gfs2_lookupi() [PATCH] new (local) helper: user_path_parent() [PATCH] sanitize __user_walk_fd() et.al. [PATCH] preparation to __user_walk_fd cleanup [PATCH] kill nameidata passing to permission(), rename to inode_permission() [PATCH] take noexec checks to very few callers that care Re: [PATCH 3/6] vfs: open_exec cleanup [patch 4/4] vfs: immutable inode checking cleanup [patch 3/4] fat: dont call notify_change [patch 2/4] vfs: utimes cleanup [patch 1/4] vfs: utimes: move owner check into inode_change_ok() [PATCH] vfs: use kstrdup() and check failing allocation ...
Diffstat (limited to 'fs/file_table.c')
-rw-r--r--fs/file_table.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/file_table.c b/fs/file_table.c
index 83084225b4c3..f45a4493f9e7 100644
--- a/fs/file_table.c
+++ b/fs/file_table.c
@@ -120,7 +120,7 @@ struct file *get_empty_filp(void)
120 120
121 tsk = current; 121 tsk = current;
122 INIT_LIST_HEAD(&f->f_u.fu_list); 122 INIT_LIST_HEAD(&f->f_u.fu_list);
123 atomic_set(&f->f_count, 1); 123 atomic_long_set(&f->f_count, 1);
124 rwlock_init(&f->f_owner.lock); 124 rwlock_init(&f->f_owner.lock);
125 f->f_uid = tsk->fsuid; 125 f->f_uid = tsk->fsuid;
126 f->f_gid = tsk->fsgid; 126 f->f_gid = tsk->fsgid;
@@ -219,7 +219,7 @@ EXPORT_SYMBOL(init_file);
219 219
220void fput(struct file *file) 220void fput(struct file *file)
221{ 221{
222 if (atomic_dec_and_test(&file->f_count)) 222 if (atomic_long_dec_and_test(&file->f_count))
223 __fput(file); 223 __fput(file);
224} 224}
225 225
@@ -294,7 +294,7 @@ struct file *fget(unsigned int fd)
294 rcu_read_lock(); 294 rcu_read_lock();
295 file = fcheck_files(files, fd); 295 file = fcheck_files(files, fd);
296 if (file) { 296 if (file) {
297 if (!atomic_inc_not_zero(&file->f_count)) { 297 if (!atomic_long_inc_not_zero(&file->f_count)) {
298 /* File object ref couldn't be taken */ 298 /* File object ref couldn't be taken */
299 rcu_read_unlock(); 299 rcu_read_unlock();
300 return NULL; 300 return NULL;
@@ -326,7 +326,7 @@ struct file *fget_light(unsigned int fd, int *fput_needed)
326 rcu_read_lock(); 326 rcu_read_lock();
327 file = fcheck_files(files, fd); 327 file = fcheck_files(files, fd);
328 if (file) { 328 if (file) {
329 if (atomic_inc_not_zero(&file->f_count)) 329 if (atomic_long_inc_not_zero(&file->f_count))
330 *fput_needed = 1; 330 *fput_needed = 1;
331 else 331 else
332 /* Didn't get the reference, someone's freed */ 332 /* Didn't get the reference, someone's freed */
@@ -341,7 +341,7 @@ struct file *fget_light(unsigned int fd, int *fput_needed)
341 341
342void put_filp(struct file *file) 342void put_filp(struct file *file)
343{ 343{
344 if (atomic_dec_and_test(&file->f_count)) { 344 if (atomic_long_dec_and_test(&file->f_count)) {
345 security_file_free(file); 345 security_file_free(file);
346 file_kill(file); 346 file_kill(file);
347 file_free(file); 347 file_free(file);