net/xilinx: remove __dev* attributes
[firefly-linux-kernel-4.4.55.git] / kernel / acct.c
index 02e6167a53b0af6bcbc166cc810cae9ab04e54f7..051e071a06e7a745a96c2fac6317d330dc33da43 100644 (file)
@@ -193,7 +193,7 @@ static void acct_file_reopen(struct bsd_acct_struct *acct, struct file *file,
        }
 }
 
-static int acct_on(char *name)
+static int acct_on(struct filename *pathname)
 {
        struct file *file;
        struct vfsmount *mnt;
@@ -201,7 +201,7 @@ static int acct_on(char *name)
        struct bsd_acct_struct *acct = NULL;
 
        /* Difference from BSD - they don't do O_APPEND */
-       file = filp_open(name, O_WRONLY|O_APPEND|O_LARGEFILE, 0);
+       file = file_open_name(pathname, O_WRONLY|O_APPEND|O_LARGEFILE, 0);
        if (IS_ERR(file))
                return PTR_ERR(file);
 
@@ -260,7 +260,7 @@ SYSCALL_DEFINE1(acct, const char __user *, name)
                return -EPERM;
 
        if (name) {
-               char *tmp = getname(name);
+               struct filename *tmp = getname(name);
                if (IS_ERR(tmp))
                        return (PTR_ERR(tmp));
                error = acct_on(tmp);
@@ -507,8 +507,8 @@ static void do_acct_process(struct bsd_acct_struct *acct,
        do_div(elapsed, AHZ);
        ac.ac_btime = get_seconds() - elapsed;
        /* we really need to bite the bullet and change layout */
-       ac.ac_uid = orig_cred->uid;
-       ac.ac_gid = orig_cred->gid;
+       ac.ac_uid = from_kuid_munged(file->f_cred->user_ns, orig_cred->uid);
+       ac.ac_gid = from_kgid_munged(file->f_cred->user_ns, orig_cred->gid);
 #if ACCT_VERSION==2
        ac.ac_ahz = AHZ;
 #endif