patch-2.1.118 linux/fs/open.c
Next file: linux/fs/pipe.c
Previous file: linux/fs/ntfs/fs.c
Back to the patch index
Back to the overall index
- Lines: 43
- Date:
Mon Aug 24 13:55:03 1998
- Orig file:
v2.1.117/linux/fs/open.c
- Orig date:
Tue Jul 28 14:21:09 1998
diff -u --recursive --new-file v2.1.117/linux/fs/open.c linux/fs/open.c
@@ -770,19 +770,17 @@
/*
* Called when retiring the last use of a file pointer.
*/
-int __fput(struct file *filp)
+void __fput(struct file *filp)
{
struct dentry * dentry = filp->f_dentry;
struct inode * inode = dentry->d_inode;
- int error = 0;
if (filp->f_op && filp->f_op->release)
- error = filp->f_op->release(inode, filp);
+ filp->f_op->release(inode, filp);
filp->f_dentry = NULL;
if (filp->f_mode & FMODE_WRITE)
put_write_access(inode);
dput(dentry);
- return error;
}
/*
@@ -791,6 +789,7 @@
*/
int close_fp(struct file *filp, fl_owner_t id)
{
+ int retval;
struct dentry *dentry = filp->f_dentry;
if (filp->f_count == 0) {
@@ -799,7 +798,11 @@
}
if (dentry->d_inode)
locks_remove_posix(filp, id);
- return fput(filp);
+ retval = 0;
+ if (filp->f_op && filp->f_op->flush)
+ retval = filp->f_op->flush(filp);
+ fput(filp);
+ return retval;
}
/*
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov