summaryrefslogtreecommitdiffstats
path: root/fs/open.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-06-19 22:45:37 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-06-19 22:45:37 +0000
commit6d403070f28cd44860fdb3a53be5da0275c65cf4 (patch)
tree0d0e7fe7b5fb7568d19e11d7d862b77a866ce081 /fs/open.c
parentecf1bf5f6c2e668d03b0a9fb026db7aa41e292e1 (diff)
Merge with 2.4.0-test1-ac21 + pile of MIPS cleanups to make merging
possible. Chainsawed RM200 kernel to compile again. Jazz machine status unknown.
Diffstat (limited to 'fs/open.c')
-rw-r--r--fs/open.c20
1 files changed, 3 insertions, 17 deletions
diff --git a/fs/open.c b/fs/open.c
index e23e48194..b2f6f6ffa 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -10,6 +10,7 @@
#include <linux/file.h>
#include <linux/smp_lock.h>
#include <linux/quotaops.h>
+#include <linux/module.h>
#include <asm/uaccess.h>
@@ -653,7 +654,7 @@ struct file *dentry_open(struct dentry *dentry, struct vfsmount *mnt, int flags)
f->f_vfsmnt = mnt;
f->f_pos = 0;
f->f_reada = 0;
- f->f_op = inode->i_fop;
+ f->f_op = fops_get(inode->i_fop);
if (inode->i_sb)
file_move(f, &inode->i_sb->s_files);
if (f->f_op && f->f_op->open) {
@@ -666,6 +667,7 @@ struct file *dentry_open(struct dentry *dentry, struct vfsmount *mnt, int flags)
return f;
cleanup_all:
+ fops_put(f->f_op);
if (f->f_mode & FMODE_WRITE)
put_write_access(inode);
f->f_dentry = NULL;
@@ -740,22 +742,6 @@ out:
return error;
}
-inline void __put_unused_fd(struct files_struct *files, unsigned int fd)
-{
- FD_CLR(fd, files->open_fds);
- if (fd < files->next_fd)
- files->next_fd = fd;
-}
-
-inline void put_unused_fd(unsigned int fd)
-{
- struct files_struct *files = current->files;
-
- write_lock(&files->file_lock);
- __put_unused_fd(files, fd);
- write_unlock(&files->file_lock);
-}
-
asmlinkage long sys_open(const char * filename, int flags, int mode)
{
char * tmp;