patch-2.4.0-test2 linux/fs/open.c
Next file: linux/fs/partitions/acorn.c
Previous file: linux/fs/ntfs/super.c
Back to the patch index
Back to the overall index
- Lines: 48
- Date:
Wed Jun 21 10:10:02 2000
- Orig file:
v2.4.0-test1/linux/fs/open.c
- Orig date:
Thu May 11 15:30:08 2000
diff -u --recursive --new-file v2.4.0-test1/linux/fs/open.c linux/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 @@
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 @@
return f;
cleanup_all:
+ fops_put(f->f_op);
if (f->f_mode & FMODE_WRITE)
put_write_access(inode);
f->f_dentry = NULL;
@@ -738,22 +740,6 @@
out:
write_unlock(&files->file_lock);
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)
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)