X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=fs%2Fncpfs%2Fmmap.c;h=70a69115500f1603b589fb3d65e72acc5eb771db;hb=refs%2Fheads%2Fvserver;hp=5fb8e87164873fdaae4da07d77452a9ccec74ebd;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/fs/ncpfs/mmap.c b/fs/ncpfs/mmap.c index 5fb8e8716..70a691155 100644 --- a/fs/ncpfs/mmap.c +++ b/fs/ncpfs/mmap.c @@ -29,7 +29,7 @@ static struct page* ncp_file_mmap_nopage(struct vm_area_struct *area, unsigned long address, int *type) { struct file *file = area->vm_file; - struct dentry *dentry = file->f_dentry; + struct dentry *dentry = file->f_path.dentry; struct inode *inode = dentry->d_inode; struct page* page; char *pg_addr; @@ -93,7 +93,7 @@ static struct page* ncp_file_mmap_nopage(struct vm_area_struct *area, */ if (type) *type = VM_FAULT_MAJOR; - inc_page_state(pgmajfault); + count_vm_event(PGMAJFAULT); return page; } @@ -106,27 +106,23 @@ static struct vm_operations_struct ncp_file_mmap = /* This is used for a general mmap of a ncp file */ int ncp_mmap(struct file *file, struct vm_area_struct *vma) { - struct inode *inode = file->f_dentry->d_inode; + struct inode *inode = file->f_path.dentry->d_inode; DPRINTK("ncp_mmap: called\n"); - if (!ncp_conn_valid(NCP_SERVER(inode))) { + if (!ncp_conn_valid(NCP_SERVER(inode))) return -EIO; - } + /* only PAGE_COW or read-only supported now */ if (vma->vm_flags & VM_SHARED) return -EINVAL; - if (!inode->i_sb || !S_ISREG(inode->i_mode)) - return -EACCES; /* we do not support files bigger than 4GB... We eventually supports just 4GB... */ if (((vma->vm_end - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff > (1U << (32 - PAGE_SHIFT))) return -EFBIG; - if (!IS_RDONLY(inode)) { - inode->i_atime = CURRENT_TIME; - } vma->vm_ops = &ncp_file_mmap; + file_accessed(file); return 0; }