*
* You should have received a copy of the GNU General Public License
* version 2 along with this program; If not, see
- * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * http://www.gnu.org/licenses/gpl-2.0.html
*
* GPL HEADER END
*/
* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
- * Copyright (c) 2011, 2015, Intel Corporation.
+ * Copyright (c) 2011, 2016, Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
unsigned long addr, size_t count)
{
policy->l_extent.start = ((addr - vma->vm_start) & PAGE_MASK) +
- (vma->vm_pgoff << PAGE_CACHE_SHIFT);
+ (vma->vm_pgoff << PAGE_SHIFT);
policy->l_extent.end = (policy->l_extent.start + count - 1) |
~PAGE_MASK;
}
pgoff_t index, unsigned long *ra_flags)
{
struct file *file = vma->vm_file;
- struct inode *inode = file->f_path.dentry->d_inode;
+ struct inode *inode = file_inode(file);
struct cl_io *io;
struct cl_fault_io *fio;
int rc;
if (ll_sbi_has_fast_read(ll_i2sbi(file_inode(vma->vm_file)))) {
/* do fast fault */
ll_cl_add(vma->vm_file, env, NULL, LCC_MMAP);
- fault_ret = filemap_fault(vma, vmf);
+ fault_ret = ll_filemap_fault(vma, vmf);
ll_cl_remove(vma->vm_file, env);
/* - If there is no error, then the page was found in cache and
vmpage = vio->u.fault.ft_vmpage;
if (result != 0 && vmpage != NULL) {
- page_cache_release(vmpage);
+ put_page(vmpage);
vmf->page = NULL;
}
}
RETURN(fault_ret);
}
+#ifdef HAVE_VM_OPS_USE_VM_FAULT_ONLY
+static int ll_fault(struct vm_fault *vmf)
+{
+ struct vm_area_struct *vma = vmf->vma;
+#else
static int ll_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
{
+#endif
int count = 0;
bool printed = false;
int result;
lock_page(vmpage);
if (unlikely(vmpage->mapping == NULL)) { /* unlucky */
unlock_page(vmpage);
- page_cache_release(vmpage);
+ put_page(vmpage);
vmf->page = NULL;
if (!printed && ++count > 16) {
return result;
}
+#ifdef HAVE_VM_OPS_USE_VM_FAULT_ONLY
+static int ll_page_mkwrite(struct vm_fault *vmf)
+{
+ struct vm_area_struct *vma = vmf->vma;
+#else
static int ll_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
{
+#endif
int count = 0;
bool printed = false;
bool retry;
result = ll_page_mkwrite0(vma, vmf->page, &retry);
if (!printed && ++count > 16) {
- const struct dentry *de = vma->vm_file->f_path.dentry;
+ const struct dentry *de = file_dentry(vma->vm_file);
CWARN("app(%s): the page %lu of file "DFID" is under"
" heavy contention\n",
*/
static void ll_vm_open(struct vm_area_struct * vma)
{
- struct inode *inode = vma->vm_file->f_path.dentry->d_inode;
+ struct inode *inode = file_inode(vma->vm_file);
struct vvp_object *vob = cl_inode2vvp(inode);
ENTRY;
- LASSERT(vma->vm_file);
LASSERT(atomic_read(&vob->vob_mmap_cnt) >= 0);
atomic_inc(&vob->vob_mmap_cnt);
EXIT;
*/
static void ll_vm_close(struct vm_area_struct *vma)
{
- struct inode *inode = vma->vm_file->f_path.dentry->d_inode;
+ struct inode *inode = file_inode(vma->vm_file);
struct vvp_object *vob = cl_inode2vvp(inode);
ENTRY;
- LASSERT(vma->vm_file);
atomic_dec(&vob->vob_mmap_cnt);
LASSERT(atomic_read(&vob->vob_mmap_cnt) >= 0);
EXIT;
int rc = -ENOENT;
ENTRY;
- LASSERTF(last > first, "last "LPU64" first "LPU64"\n", last, first);
+ LASSERTF(last > first, "last %llu first %llu\n", last, first);
if (mapping_mapped(mapping)) {
rc = 0;
- unmap_mapping_range(mapping, first + PAGE_CACHE_SIZE - 1,
+ unmap_mapping_range(mapping, first + PAGE_SIZE - 1,
last - first + 1, 0);
}
int ll_file_mmap(struct file *file, struct vm_area_struct * vma)
{
- struct inode *inode = file->f_path.dentry->d_inode;
+ struct inode *inode = file_inode(file);
int rc;
ENTRY;