git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git]
/
fs
/
file_table.c
diff --git
a/fs/file_table.c
b/fs/file_table.c
index
cc11ccb
..
6e8d15f
100644
(file)
--- a/
fs/file_table.c
+++ b/
fs/file_table.c
@@
-5,7
+5,6
@@
* Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu)
*/
* Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu)
*/
-#include <linux/config.h>
#include <linux/string.h>
#include <linux/slab.h>
#include <linux/file.h>
#include <linux/string.h>
#include <linux/slab.h>
#include <linux/file.h>
@@
-90,6
+89,7
@@
int proc_nr_files(ctl_table *table, int write, struct file *filp,
*/
struct file *get_empty_filp(void)
{
*/
struct file *get_empty_filp(void)
{
+ struct task_struct *tsk;
static int old_max;
struct file * f;
static int old_max;
struct file * f;
@@
-114,13
+114,14
@@
struct file *get_empty_filp(void)
if (security_file_alloc(f))
goto fail_sec;
if (security_file_alloc(f))
goto fail_sec;
- eventpoll_init_file(f);
+ tsk = current;
+ INIT_LIST_HEAD(&f->f_u.fu_list);
atomic_set(&f->f_count, 1);
atomic_set(&f->f_count, 1);
- f->f_uid = current->fsuid;
- f->f_gid = current->fsgid;
rwlock_init(&f->f_owner.lock);
rwlock_init(&f->f_owner.lock);
+ f->f_uid = tsk->fsuid;
+ f->f_gid = tsk->fsgid;
+ eventpoll_init_file(f);
/* f->f_version: 0 */
/* f->f_version: 0 */
- INIT_LIST_HEAD(&f->f_u.fu_list);
f->f_xid = vx_current_xid();
vx_files_inc(f);
return f;
f->f_xid = vx_current_xid();
vx_files_inc(f);
return f;
@@
-155,8
+156,8
@@
EXPORT_SYMBOL(fput);
*/
void fastcall __fput(struct file *file)
{
*/
void fastcall __fput(struct file *file)
{
- struct dentry *dentry = file->f_dentry;
- struct vfsmount *mnt = file->f_
vfs
mnt;
+ struct dentry *dentry = file->f_
path.
dentry;
+ struct vfsmount *mnt = file->f_
path.
mnt;
struct inode *inode = dentry->d_inode;
might_sleep();
struct inode *inode = dentry->d_inode;
might_sleep();
@@
-172,16
+173,17
@@
void fastcall __fput(struct file *file)
if (file->f_op && file->f_op->release)
file->f_op->release(inode, file);
security_file_free(file);
if (file->f_op && file->f_op->release)
file->f_op->release(inode, file);
security_file_free(file);
- if (unlikely(inode->i_cdev != NULL))
+ if (unlikely(
S_ISCHR(inode->i_mode) &&
inode->i_cdev != NULL))
cdev_put(inode->i_cdev);
fops_put(file->f_op);
if (file->f_mode & FMODE_WRITE)
put_write_access(inode);
cdev_put(inode->i_cdev);
fops_put(file->f_op);
if (file->f_mode & FMODE_WRITE)
put_write_access(inode);
+ put_pid(file->f_owner.pid);
vx_files_dec(file);
file->f_xid = 0;
file_kill(file);
vx_files_dec(file);
file->f_xid = 0;
file_kill(file);
- file->f_dentry = NULL;
- file->f_
vfs
mnt = NULL;
+ file->f_
path.
dentry = NULL;
+ file->f_
path.
mnt = NULL;
file_free(file);
dput(dentry);
mntput(mnt);
file_free(file);
dput(dentry);
mntput(mnt);
@@
-239,6
+241,7
@@
struct file fastcall *fget_light(unsigned int fd, int *fput_needed)
return file;
}
return file;
}
+EXPORT_SYMBOL_GPL(fget_light);
void put_filp(struct file *file)
{
void put_filp(struct file *file)
{
@@
-277,7
+280,7
@@
int fs_may_remount_ro(struct super_block *sb)
file_list_lock();
list_for_each(p, &sb->s_files) {
struct file *file = list_entry(p, struct file, f_u.fu_list);
file_list_lock();
list_for_each(p, &sb->s_files) {
struct file *file = list_entry(p, struct file, f_u.fu_list);
- struct inode *inode = file->f_dentry->d_inode;
+ struct inode *inode = file->f_
path.
dentry->d_inode;
/* File with pending delete? */
if (inode->i_nlink == 0)
/* File with pending delete? */
if (inode->i_nlink == 0)
@@
-306,5
+309,5
@@
void __init files_init(unsigned long mempages)
if (files_stat.max_files < NR_FILE)
files_stat.max_files = NR_FILE;
files_defer_init();
if (files_stat.max_files < NR_FILE)
files_stat.max_files = NR_FILE;
files_defer_init();
- percpu_counter_init(&nr_files);
+ percpu_counter_init(&nr_files
, 0
);
}
}