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-10092 llite: Add persistent cache on client
[fs/lustre-release.git]
/
lustre
/
llite
/
llite_mmap.c
diff --git
a/lustre/llite/llite_mmap.c
b/lustre/llite/llite_mmap.c
index
989a53b
..
65e4af6
100644
(file)
--- a/
lustre/llite/llite_mmap.c
+++ b/
lustre/llite/llite_mmap.c
@@
-504,18
+504,27
@@
int ll_file_mmap(struct file *file, struct vm_area_struct * vma)
{
struct inode *inode = file_inode(file);
int rc;
+ struct ll_file_data *fd = LUSTRE_FPRIVATE(file);
+ struct file *pcc_file = fd->fd_pcc_file.pccf_file;
+
ENTRY;
+ /* pcc cache path */
+ if (pcc_file) {
+ vma->vm_file = pcc_file;
+ return file_inode(pcc_file)->i_fop->mmap(pcc_file, vma);
+ }
+
if (ll_file_nolock(file))
RETURN(-EOPNOTSUPP);
ll_stats_ops_tally(ll_i2sbi(inode), LPROC_LL_MAP, 1);
rc = generic_file_mmap(file, vma);
if (rc == 0) {
-
vma->vm_ops = &ll_file_vm_ops;
+ vma->vm_ops = &ll_file_vm_ops;
vma->vm_ops->open(vma);
/* update the inode's size and mtime */
-
rc = ll_glimpse_size(inode);
+ rc = ll_glimpse_size(inode);
}
RETURN(rc);