aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ncpfs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2014-10-31 02:41:28 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2014-11-19 13:01:25 -0500
commita67f797db61ee8f2d732e411bf35a92fd78b44a2 (patch)
tree87f3040a01368e10310a899b3db35545885d7c36 /fs/ncpfs
parentb583043e99bc6d91e98fae32bd9eff6a5958240a (diff)
ncpfs: use file_inode()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/ncpfs')
-rw-r--r--fs/ncpfs/dir.c6
-rw-r--r--fs/ncpfs/file.c14
-rw-r--r--fs/ncpfs/mmap.c4
3 files changed, 9 insertions, 15 deletions
diff --git a/fs/ncpfs/dir.c b/fs/ncpfs/dir.c
index 865d578704c8..008960101520 100644
--- a/fs/ncpfs/dir.c
+++ b/fs/ncpfs/dir.c
@@ -685,8 +685,7 @@ static void
685ncp_read_volume_list(struct file *file, struct dir_context *ctx, 685ncp_read_volume_list(struct file *file, struct dir_context *ctx,
686 struct ncp_cache_control *ctl) 686 struct ncp_cache_control *ctl)
687{ 687{
688 struct dentry *dentry = file->f_path.dentry; 688 struct inode *inode = file_inode(file);
689 struct inode *inode = dentry->d_inode;
690 struct ncp_server *server = NCP_SERVER(inode); 689 struct ncp_server *server = NCP_SERVER(inode);
691 struct ncp_volume_info info; 690 struct ncp_volume_info info;
692 struct ncp_entry_info entry; 691 struct ncp_entry_info entry;
@@ -721,8 +720,7 @@ static void
721ncp_do_readdir(struct file *file, struct dir_context *ctx, 720ncp_do_readdir(struct file *file, struct dir_context *ctx,
722 struct ncp_cache_control *ctl) 721 struct ncp_cache_control *ctl)
723{ 722{
724 struct dentry *dentry = file->f_path.dentry; 723 struct inode *dir = file_inode(file);
725 struct inode *dir = dentry->d_inode;
726 struct ncp_server *server = NCP_SERVER(dir); 724 struct ncp_server *server = NCP_SERVER(dir);
727 struct nw_search_sequence seq; 725 struct nw_search_sequence seq;
728 struct ncp_entry_info entry; 726 struct ncp_entry_info entry;
diff --git a/fs/ncpfs/file.c b/fs/ncpfs/file.c
index 77640a8bfb87..1dd7007f974d 100644
--- a/fs/ncpfs/file.c
+++ b/fs/ncpfs/file.c
@@ -100,8 +100,7 @@ out:
100static ssize_t 100static ssize_t
101ncp_file_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) 101ncp_file_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
102{ 102{
103 struct dentry *dentry = file->f_path.dentry; 103 struct inode *inode = file_inode(file);
104 struct inode *inode = dentry->d_inode;
105 size_t already_read = 0; 104 size_t already_read = 0;
106 off_t pos; 105 off_t pos;
107 size_t bufsize; 106 size_t bufsize;
@@ -109,7 +108,7 @@ ncp_file_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
109 void* freepage; 108 void* freepage;
110 size_t freelen; 109 size_t freelen;
111 110
112 ncp_dbg(1, "enter %pd2\n", dentry); 111 ncp_dbg(1, "enter %pD2\n", file);
113 112
114 pos = *ppos; 113 pos = *ppos;
115 114
@@ -167,7 +166,7 @@ ncp_file_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
167 166
168 file_accessed(file); 167 file_accessed(file);
169 168
170 ncp_dbg(1, "exit %pd2\n", dentry); 169 ncp_dbg(1, "exit %pD2\n", file);
171outrel: 170outrel:
172 ncp_inode_close(inode); 171 ncp_inode_close(inode);
173 return already_read ? already_read : error; 172 return already_read ? already_read : error;
@@ -176,15 +175,14 @@ outrel:
176static ssize_t 175static ssize_t
177ncp_file_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) 176ncp_file_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
178{ 177{
179 struct dentry *dentry = file->f_path.dentry; 178 struct inode *inode = file_inode(file);
180 struct inode *inode = dentry->d_inode;
181 size_t already_written = 0; 179 size_t already_written = 0;
182 off_t pos; 180 off_t pos;
183 size_t bufsize; 181 size_t bufsize;
184 int errno; 182 int errno;
185 void* bouncebuffer; 183 void* bouncebuffer;
186 184
187 ncp_dbg(1, "enter %pd2\n", dentry); 185 ncp_dbg(1, "enter %pD2\n", file);
188 if ((ssize_t) count < 0) 186 if ((ssize_t) count < 0)
189 return -EINVAL; 187 return -EINVAL;
190 pos = *ppos; 188 pos = *ppos;
@@ -263,7 +261,7 @@ ncp_file_write(struct file *file, const char __user *buf, size_t count, loff_t *
263 i_size_write(inode, pos); 261 i_size_write(inode, pos);
264 mutex_unlock(&inode->i_mutex); 262 mutex_unlock(&inode->i_mutex);
265 } 263 }
266 ncp_dbg(1, "exit %pd2\n", dentry); 264 ncp_dbg(1, "exit %pD2\n", file);
267outrel: 265outrel:
268 ncp_inode_close(inode); 266 ncp_inode_close(inode);
269 return already_written ? already_written : errno; 267 return already_written ? already_written : errno;
diff --git a/fs/ncpfs/mmap.c b/fs/ncpfs/mmap.c
index b359d12eb359..33b873b259a8 100644
--- a/fs/ncpfs/mmap.c
+++ b/fs/ncpfs/mmap.c
@@ -30,9 +30,7 @@
30static int ncp_file_mmap_fault(struct vm_area_struct *area, 30static int ncp_file_mmap_fault(struct vm_area_struct *area,
31 struct vm_fault *vmf) 31 struct vm_fault *vmf)
32{ 32{
33 struct file *file = area->vm_file; 33 struct inode *inode = file_inode(area->vm_file);
34 struct dentry *dentry = file->f_path.dentry;
35 struct inode *inode = dentry->d_inode;
36 char *pg_addr; 34 char *pg_addr;
37 unsigned int already_read; 35 unsigned int already_read;
38 unsigned int count; 36 unsigned int count;