Skip to content

Commit

Permalink
ncpfs: use file_inode()
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
Al Viro committed Nov 19, 2014
1 parent b583043 commit a67f797
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 15 deletions.
6 changes: 2 additions & 4 deletions fs/ncpfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -685,8 +685,7 @@ static void
ncp_read_volume_list(struct file *file, struct dir_context *ctx,
struct ncp_cache_control *ctl)
{
struct dentry *dentry = file->f_path.dentry;
struct inode *inode = dentry->d_inode;
struct inode *inode = file_inode(file);
struct ncp_server *server = NCP_SERVER(inode);
struct ncp_volume_info info;
struct ncp_entry_info entry;
Expand Down Expand Up @@ -721,8 +720,7 @@ static void
ncp_do_readdir(struct file *file, struct dir_context *ctx,
struct ncp_cache_control *ctl)
{
struct dentry *dentry = file->f_path.dentry;
struct inode *dir = dentry->d_inode;
struct inode *dir = file_inode(file);
struct ncp_server *server = NCP_SERVER(dir);
struct nw_search_sequence seq;
struct ncp_entry_info entry;
Expand Down
14 changes: 6 additions & 8 deletions fs/ncpfs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,15 @@ int ncp_make_open(struct inode *inode, int right)
static ssize_t
ncp_file_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
{
struct dentry *dentry = file->f_path.dentry;
struct inode *inode = dentry->d_inode;
struct inode *inode = file_inode(file);
size_t already_read = 0;
off_t pos;
size_t bufsize;
int error;
void* freepage;
size_t freelen;

ncp_dbg(1, "enter %pd2\n", dentry);
ncp_dbg(1, "enter %pD2\n", file);

pos = *ppos;

Expand Down Expand Up @@ -167,7 +166,7 @@ ncp_file_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)

file_accessed(file);

ncp_dbg(1, "exit %pd2\n", dentry);
ncp_dbg(1, "exit %pD2\n", file);
outrel:
ncp_inode_close(inode);
return already_read ? already_read : error;
Expand All @@ -176,15 +175,14 @@ ncp_file_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
static ssize_t
ncp_file_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
{
struct dentry *dentry = file->f_path.dentry;
struct inode *inode = dentry->d_inode;
struct inode *inode = file_inode(file);
size_t already_written = 0;
off_t pos;
size_t bufsize;
int errno;
void* bouncebuffer;

ncp_dbg(1, "enter %pd2\n", dentry);
ncp_dbg(1, "enter %pD2\n", file);
if ((ssize_t) count < 0)
return -EINVAL;
pos = *ppos;
Expand Down Expand Up @@ -263,7 +261,7 @@ ncp_file_write(struct file *file, const char __user *buf, size_t count, loff_t *
i_size_write(inode, pos);
mutex_unlock(&inode->i_mutex);
}
ncp_dbg(1, "exit %pd2\n", dentry);
ncp_dbg(1, "exit %pD2\n", file);
outrel:
ncp_inode_close(inode);
return already_written ? already_written : errno;
Expand Down
4 changes: 1 addition & 3 deletions fs/ncpfs/mmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@
static int ncp_file_mmap_fault(struct vm_area_struct *area,
struct vm_fault *vmf)
{
struct file *file = area->vm_file;
struct dentry *dentry = file->f_path.dentry;
struct inode *inode = dentry->d_inode;
struct inode *inode = file_inode(area->vm_file);
char *pg_addr;
unsigned int already_read;
unsigned int count;
Expand Down

0 comments on commit a67f797

Please sign in to comment.