Whamcloud - gitweb
LU-12657 llite: forget cached ACLs properly
[fs/lustre-release.git] / lustre / llite / pcc.c
index fcebed4..b99c702 100644 (file)
@@ -1699,15 +1699,8 @@ int pcc_fsync(struct file *file, loff_t start, loff_t end,
        if (!*cached)
                RETURN(0);
 
-#ifdef HAVE_FILE_FSYNC_4ARGS
        rc = file_inode(pcc_file)->i_fop->fsync(pcc_file,
                                                start, end, datasync);
-#elif defined(HAVE_FILE_FSYNC_2ARGS)
-       rc = file_inode(pcc_file)->i_fop->fsync(pcc_file, datasync);
-#else
-       rc = file_inode(pcc_file)->i_fop->fsync(pcc_file,
-                               file_dentry(dentry), datasync);
-#endif
 
        pcc_io_fini(inode);
        RETURN(rc);
@@ -2168,7 +2161,7 @@ static int pcc_filp_write(struct file *filp, const void *buf, ssize_t count,
        while (count > 0) {
                ssize_t size;
 
-               size = vfs_write(filp, (const void __user *)buf, count, offset);
+               size = cfs_kernel_write(filp, buf, count, offset);
                if (size < 0)
                        return size;
                count -= size;
@@ -2181,7 +2174,6 @@ static int pcc_copy_data(struct file *src, struct file *dst)
 {
        int rc = 0;
        ssize_t rc2;
-       mm_segment_t oldfs;
        loff_t pos, offset = 0;
        size_t buf_len = 1048576;
        void *buf;
@@ -2192,25 +2184,22 @@ static int pcc_copy_data(struct file *src, struct file *dst)
        if (buf == NULL)
                RETURN(-ENOMEM);
 
-       oldfs = get_fs();
-       set_fs(KERNEL_DS);
        while (1) {
                pos = offset;
-               rc2 = vfs_read(src, (void __user *)buf, buf_len, &pos);
+               rc2 = cfs_kernel_read(src, buf, buf_len, &pos);
                if (rc2 < 0)
-                       GOTO(out_fs, rc = rc2);
+                       GOTO(out_free, rc = rc2);
                else if (rc2 == 0)
                        break;
 
                pos = offset;
                rc = pcc_filp_write(dst, buf, rc2, &pos);
                if (rc < 0)
-                       GOTO(out_fs, rc);
+                       GOTO(out_free, rc);
                offset += rc2;
        }
 
-out_fs:
-       set_fs(oldfs);
+out_free:
        OBD_FREE_LARGE(buf, buf_len);
        RETURN(rc);
 }
@@ -2496,13 +2485,9 @@ int pcc_ioctl_state(struct file *file, struct inode *inode,
        state->pccs_type = pcci->pcci_type;
        state->pccs_open_count = count;
        state->pccs_flags = ll_i2info(inode)->lli_pcc_state;
-#ifdef HAVE_DENTRY_PATH_RAW
        path = dentry_path_raw(pcci->pcci_path.dentry, buf, buf_len);
        if (IS_ERR(path))
                GOTO(out_unlock, rc = PTR_ERR(path));
-#else
-       path = "UNKNOWN";
-#endif
 
        if (strlcpy(state->pccs_path, path, buf_len) >= buf_len)
                GOTO(out_unlock, rc = -ENAMETOOLONG);