if (!ncp_conn_valid(NCP_SERVER(inode)))
return -EIO;
- if (!S_ISREG(inode->i_mode)) {
- DPRINTK("ncp_file_read: read from non-file, mode %07o\n",
- inode->i_mode);
- return -EINVAL;
- }
pos = *ppos;
*ppos = pos;
- if (!IS_RDONLY(inode)) {
- inode->i_atime = CURRENT_TIME;
- }
-
+ file_accessed(file);
+
DPRINTK("ncp_file_read: exit %s/%s\n",
dentry->d_parent->d_name.name, dentry->d_name.name);
outrel:
dentry->d_parent->d_name.name, dentry->d_name.name);
if (!ncp_conn_valid(NCP_SERVER(inode)))
return -EIO;
- if (!S_ISREG(inode->i_mode)) {
- DPRINTK("ncp_file_write: write to non-file, mode %07o\n",
- inode->i_mode);
- return -EINVAL;
- }
if ((ssize_t) count < 0)
return -EINVAL;
pos = *ppos;
}
}
vfree(bouncebuffer);
- inode->i_mtime = inode->i_atime = CURRENT_TIME;
-
+
+ inode_update_time(inode, 1);
+
*ppos = pos;
if (pos > inode->i_size) {
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;
}