Commit 75bd228d authored by David Howells's avatar David Howells
parent 8bb7eca9
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
static int afs_file_mmap(struct file *file, struct vm_area_struct *vma); static int afs_file_mmap(struct file *file, struct vm_area_struct *vma);
static int afs_readpage(struct file *file, struct page *page); static int afs_readpage(struct file *file, struct page *page);
static int afs_symlink_readpage(struct file *file, struct page *page);
static void afs_invalidatepage(struct page *page, unsigned int offset, static void afs_invalidatepage(struct page *page, unsigned int offset,
unsigned int length); unsigned int length);
static int afs_releasepage(struct page *page, gfp_t gfp_flags); static int afs_releasepage(struct page *page, gfp_t gfp_flags);
...@@ -49,7 +50,7 @@ const struct inode_operations afs_file_inode_operations = { ...@@ -49,7 +50,7 @@ const struct inode_operations afs_file_inode_operations = {
.permission = afs_permission, .permission = afs_permission,
}; };
const struct address_space_operations afs_fs_aops = { const struct address_space_operations afs_file_aops = {
.readpage = afs_readpage, .readpage = afs_readpage,
.readahead = afs_readahead, .readahead = afs_readahead,
.set_page_dirty = afs_set_page_dirty, .set_page_dirty = afs_set_page_dirty,
...@@ -62,6 +63,12 @@ const struct address_space_operations afs_fs_aops = { ...@@ -62,6 +63,12 @@ const struct address_space_operations afs_fs_aops = {
.writepages = afs_writepages, .writepages = afs_writepages,
}; };
const struct address_space_operations afs_symlink_aops = {
.readpage = afs_symlink_readpage,
.releasepage = afs_releasepage,
.invalidatepage = afs_invalidatepage,
};
static const struct vm_operations_struct afs_vm_ops = { static const struct vm_operations_struct afs_vm_ops = {
.open = afs_vm_open, .open = afs_vm_open,
.close = afs_vm_close, .close = afs_vm_close,
...@@ -313,7 +320,7 @@ static void afs_req_issue_op(struct netfs_read_subrequest *subreq) ...@@ -313,7 +320,7 @@ static void afs_req_issue_op(struct netfs_read_subrequest *subreq)
afs_put_read(fsreq); afs_put_read(fsreq);
} }
static int afs_symlink_readpage(struct page *page) static int afs_symlink_readpage(struct file *file, struct page *page)
{ {
struct afs_vnode *vnode = AFS_FS_I(page->mapping->host); struct afs_vnode *vnode = AFS_FS_I(page->mapping->host);
struct afs_read *fsreq; struct afs_read *fsreq;
...@@ -378,9 +385,6 @@ const struct netfs_read_request_ops afs_req_ops = { ...@@ -378,9 +385,6 @@ const struct netfs_read_request_ops afs_req_ops = {
static int afs_readpage(struct file *file, struct page *page) static int afs_readpage(struct file *file, struct page *page)
{ {
if (!file)
return afs_symlink_readpage(page);
return netfs_readpage(file, page, &afs_req_ops, NULL); return netfs_readpage(file, page, &afs_req_ops, NULL);
} }
......
...@@ -95,7 +95,7 @@ static int afs_inode_init_from_status(struct afs_operation *op, ...@@ -95,7 +95,7 @@ static int afs_inode_init_from_status(struct afs_operation *op,
inode->i_mode = S_IFREG | (status->mode & S_IALLUGO); inode->i_mode = S_IFREG | (status->mode & S_IALLUGO);
inode->i_op = &afs_file_inode_operations; inode->i_op = &afs_file_inode_operations;
inode->i_fop = &afs_file_operations; inode->i_fop = &afs_file_operations;
inode->i_mapping->a_ops = &afs_fs_aops; inode->i_mapping->a_ops = &afs_file_aops;
break; break;
case AFS_FTYPE_DIR: case AFS_FTYPE_DIR:
inode->i_mode = S_IFDIR | (status->mode & S_IALLUGO); inode->i_mode = S_IFDIR | (status->mode & S_IALLUGO);
...@@ -113,11 +113,11 @@ static int afs_inode_init_from_status(struct afs_operation *op, ...@@ -113,11 +113,11 @@ static int afs_inode_init_from_status(struct afs_operation *op,
inode->i_mode = S_IFDIR | 0555; inode->i_mode = S_IFDIR | 0555;
inode->i_op = &afs_mntpt_inode_operations; inode->i_op = &afs_mntpt_inode_operations;
inode->i_fop = &afs_mntpt_file_operations; inode->i_fop = &afs_mntpt_file_operations;
inode->i_mapping->a_ops = &afs_fs_aops; inode->i_mapping->a_ops = &afs_symlink_aops;
} else { } else {
inode->i_mode = S_IFLNK | status->mode; inode->i_mode = S_IFLNK | status->mode;
inode->i_op = &afs_symlink_inode_operations; inode->i_op = &afs_symlink_inode_operations;
inode->i_mapping->a_ops = &afs_fs_aops; inode->i_mapping->a_ops = &afs_symlink_aops;
} }
inode_nohighmem(inode); inode_nohighmem(inode);
break; break;
......
...@@ -1055,7 +1055,8 @@ extern void afs_dynroot_depopulate(struct super_block *); ...@@ -1055,7 +1055,8 @@ extern void afs_dynroot_depopulate(struct super_block *);
/* /*
* file.c * file.c
*/ */
extern const struct address_space_operations afs_fs_aops; extern const struct address_space_operations afs_file_aops;
extern const struct address_space_operations afs_symlink_aops;
extern const struct inode_operations afs_file_inode_operations; extern const struct inode_operations afs_file_inode_operations;
extern const struct file_operations afs_file_operations; extern const struct file_operations afs_file_operations;
extern const struct netfs_read_request_ops afs_req_ops; extern const struct netfs_read_request_ops afs_req_ops;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment