projects
/
powerpc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PATCH] fsnotify: hook on removexattr, too
[powerpc.git]
/
fs
/
open.c
diff --git
a/fs/open.c
b/fs/open.c
index
2ebb72c
..
32bf05e
100644
(file)
--- a/
fs/open.c
+++ b/
fs/open.c
@@
-10,7
+10,7
@@
#include <linux/file.h>
#include <linux/smp_lock.h>
#include <linux/quotaops.h>
#include <linux/file.h>
#include <linux/smp_lock.h>
#include <linux/quotaops.h>
-#include <linux/
d
notify.h>
+#include <linux/
fs
notify.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/tty.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/tty.h>
@@
-808,7
+808,9
@@
struct file *dentry_open(struct dentry *dentry, struct vfsmount *mnt, int flags)
/* NB: we're sure to have correct a_ops only after f_op->open */
if (f->f_flags & O_DIRECT) {
/* NB: we're sure to have correct a_ops only after f_op->open */
if (f->f_flags & O_DIRECT) {
- if (!f->f_mapping->a_ops || !f->f_mapping->a_ops->direct_IO) {
+ if (!f->f_mapping->a_ops ||
+ ((!f->f_mapping->a_ops->direct_IO) &&
+ (!f->f_mapping->a_ops->get_xip_page))) {
fput(f);
f = ERR_PTR(-EINVAL);
}
fput(f);
f = ERR_PTR(-EINVAL);
}
@@
-934,7
+936,7
@@
EXPORT_SYMBOL(fd_install);
asmlinkage long sys_open(const char __user * filename, int flags, int mode)
{
char * tmp;
asmlinkage long sys_open(const char __user * filename, int flags, int mode)
{
char * tmp;
- int fd
, error
;
+ int fd;
if (force_o_largefile())
flags |= O_LARGEFILE;
if (force_o_largefile())
flags |= O_LARGEFILE;
@@
-945,20
+947,17
@@
asmlinkage long sys_open(const char __user * filename, int flags, int mode)
fd = get_unused_fd();
if (fd >= 0) {
struct file *f = filp_open(tmp, flags, mode);
fd = get_unused_fd();
if (fd >= 0) {
struct file *f = filp_open(tmp, flags, mode);
- error = PTR_ERR(f);
- if (IS_ERR(f))
- goto out_error;
- fd_install(fd, f);
+ if (IS_ERR(f)) {
+ put_unused_fd(fd);
+ fd = PTR_ERR(f);
+ } else {
+ fsnotify_open(f->f_dentry);
+ fd_install(fd, f);
+ }
}
}
-out:
putname(tmp);
}
return fd;
putname(tmp);
}
return fd;
-
-out_error:
- put_unused_fd(fd);
- fd = error;
- goto out;
}
EXPORT_SYMBOL_GPL(sys_open);
}
EXPORT_SYMBOL_GPL(sys_open);
@@
-981,23
+980,15
@@
asmlinkage long sys_creat(const char __user * pathname, int mode)
*/
int filp_close(struct file *filp, fl_owner_t id)
{
*/
int filp_close(struct file *filp, fl_owner_t id)
{
- int retval;
-
- /* Report and clear outstanding errors */
- retval = filp->f_error;
- if (retval)
- filp->f_error = 0;
+ int retval = 0;
if (!file_count(filp)) {
printk(KERN_ERR "VFS: Close: file count is 0\n");
if (!file_count(filp)) {
printk(KERN_ERR "VFS: Close: file count is 0\n");
- return
retval
;
+ return
0
;
}
}
- if (filp->f_op && filp->f_op->flush) {
- int err = filp->f_op->flush(filp);
- if (!retval)
- retval = err;
- }
+ if (filp->f_op && filp->f_op->flush)
+ retval = filp->f_op->flush(filp);
dnotify_flush(filp, id);
locks_remove_posix(filp, id);
dnotify_flush(filp, id);
locks_remove_posix(filp, id);