]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - fs/open.c
net: hns: add the code for cleaning pkt in chip
[mirror_ubuntu-bionic-kernel.git] / fs / open.c
index 35bb784763a4fde35558b10d8538cb9617a7c728..861efbefa6d78c4e39f229b90fbb8cdc11807ebf 100644 (file)
--- a/fs/open.c
+++ b/fs/open.c
@@ -34,6 +34,9 @@
 
 #include "internal.h"
 
+#define CREATE_TRACE_POINTS
+#include <trace/events/fs.h>
+
 int do_truncate(struct dentry *dentry, loff_t length, unsigned int time_attrs,
        struct file *filp)
 {
@@ -64,6 +67,7 @@ int do_truncate(struct dentry *dentry, loff_t length, unsigned int time_attrs,
        inode_unlock(dentry->d_inode);
        return ret;
 }
+EXPORT_SYMBOL_GPL(do_truncate);
 
 long vfs_truncate(const struct path *path, loff_t length)
 {
@@ -96,7 +100,7 @@ long vfs_truncate(const struct path *path, loff_t length)
         * write access on the upper inode, not on the overlay inode.  For
         * non-overlay filesystems d_real() is an identity function.
         */
-       upperdentry = d_real(path->dentry, NULL, O_WRONLY);
+       upperdentry = d_real(path->dentry, NULL, O_WRONLY, 0);
        error = PTR_ERR(upperdentry);
        if (IS_ERR(upperdentry))
                goto mnt_drop_write_and_out;
@@ -670,12 +674,12 @@ SYSCALL_DEFINE3(fchown, unsigned int, fd, uid_t, user, gid_t, group)
        if (!f.file)
                goto out;
 
-       error = mnt_want_write_file(f.file);
+       error = mnt_want_write_file_path(f.file);
        if (error)
                goto out_fput;
        audit_file(f.file);
        error = chown_common(&f.file->f_path, user, group);
-       mnt_drop_write_file(f.file);
+       mnt_drop_write_file_path(f.file);
 out_fput:
        fdput(f);
 out:
@@ -691,6 +695,7 @@ int open_check_o_direct(struct file *f)
        }
        return 0;
 }
+EXPORT_SYMBOL_GPL(open_check_o_direct);
 
 static int do_dentry_open(struct file *f,
                          struct inode *inode,
@@ -857,7 +862,7 @@ EXPORT_SYMBOL(file_path);
 int vfs_open(const struct path *path, struct file *file,
             const struct cred *cred)
 {
-       struct dentry *dentry = d_real(path->dentry, NULL, file->f_flags);
+       struct dentry *dentry = d_real(path->dentry, NULL, file->f_flags, 0);
 
        if (IS_ERR(dentry))
                return PTR_ERR(dentry);
@@ -1063,6 +1068,7 @@ long do_sys_open(int dfd, const char __user *filename, int flags, umode_t mode)
                } else {
                        fsnotify_open(f);
                        fd_install(fd, f);
+                       trace_do_sys_open(tmp->name, flags, mode);
                }
        }
        putname(tmp);