Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
LU-12657 llite: forget cached ACLs properly
[fs/lustre-release.git]
/
lustre
/
llite
/
pcc.c
diff --git
a/lustre/llite/pcc.c
b/lustre/llite/pcc.c
index
fcebed4
..
b99c702
100644
(file)
--- a/
lustre/llite/pcc.c
+++ b/
lustre/llite/pcc.c
@@
-1699,15
+1699,8
@@
int pcc_fsync(struct file *file, loff_t start, loff_t end,
if (!*cached)
RETURN(0);
if (!*cached)
RETURN(0);
-#ifdef HAVE_FILE_FSYNC_4ARGS
rc = file_inode(pcc_file)->i_fop->fsync(pcc_file,
start, end, datasync);
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);
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;
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;
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;
{
int rc = 0;
ssize_t rc2;
- mm_segment_t oldfs;
loff_t pos, offset = 0;
size_t buf_len = 1048576;
void *buf;
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);
if (buf == NULL)
RETURN(-ENOMEM);
- oldfs = get_fs();
- set_fs(KERNEL_DS);
while (1) {
pos = offset;
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)
if (rc2 < 0)
- GOTO(out_f
s
, rc = rc2);
+ GOTO(out_f
ree
, rc = rc2);
else if (rc2 == 0)
break;
pos = offset;
rc = pcc_filp_write(dst, buf, rc2, &pos);
if (rc < 0)
else if (rc2 == 0)
break;
pos = offset;
rc = pcc_filp_write(dst, buf, rc2, &pos);
if (rc < 0)
- GOTO(out_f
s
, rc);
+ GOTO(out_f
ree
, rc);
offset += rc2;
}
offset += rc2;
}
-out_fs:
- set_fs(oldfs);
+out_free:
OBD_FREE_LARGE(buf, buf_len);
RETURN(rc);
}
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;
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));
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);
if (strlcpy(state->pccs_path, path, buf_len) >= buf_len)
GOTO(out_unlock, rc = -ENAMETOOLONG);