Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
a67f797d
Commit
a67f797d
authored
Oct 31, 2014
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ncpfs: use file_inode()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
b583043e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
15 deletions
+9
-15
fs/ncpfs/dir.c
fs/ncpfs/dir.c
+2
-4
fs/ncpfs/file.c
fs/ncpfs/file.c
+6
-8
fs/ncpfs/mmap.c
fs/ncpfs/mmap.c
+1
-3
No files found.
fs/ncpfs/dir.c
View file @
a67f797d
...
@@ -685,8 +685,7 @@ static void
...
@@ -685,8 +685,7 @@ static void
ncp_read_volume_list
(
struct
file
*
file
,
struct
dir_context
*
ctx
,
ncp_read_volume_list
(
struct
file
*
file
,
struct
dir_context
*
ctx
,
struct
ncp_cache_control
*
ctl
)
struct
ncp_cache_control
*
ctl
)
{
{
struct
dentry
*
dentry
=
file
->
f_path
.
dentry
;
struct
inode
*
inode
=
file_inode
(
file
);
struct
inode
*
inode
=
dentry
->
d_inode
;
struct
ncp_server
*
server
=
NCP_SERVER
(
inode
);
struct
ncp_server
*
server
=
NCP_SERVER
(
inode
);
struct
ncp_volume_info
info
;
struct
ncp_volume_info
info
;
struct
ncp_entry_info
entry
;
struct
ncp_entry_info
entry
;
...
@@ -721,8 +720,7 @@ static void
...
@@ -721,8 +720,7 @@ static void
ncp_do_readdir
(
struct
file
*
file
,
struct
dir_context
*
ctx
,
ncp_do_readdir
(
struct
file
*
file
,
struct
dir_context
*
ctx
,
struct
ncp_cache_control
*
ctl
)
struct
ncp_cache_control
*
ctl
)
{
{
struct
dentry
*
dentry
=
file
->
f_path
.
dentry
;
struct
inode
*
dir
=
file_inode
(
file
);
struct
inode
*
dir
=
dentry
->
d_inode
;
struct
ncp_server
*
server
=
NCP_SERVER
(
dir
);
struct
ncp_server
*
server
=
NCP_SERVER
(
dir
);
struct
nw_search_sequence
seq
;
struct
nw_search_sequence
seq
;
struct
ncp_entry_info
entry
;
struct
ncp_entry_info
entry
;
...
...
fs/ncpfs/file.c
View file @
a67f797d
...
@@ -100,8 +100,7 @@ int ncp_make_open(struct inode *inode, int right)
...
@@ -100,8 +100,7 @@ int ncp_make_open(struct inode *inode, int right)
static
ssize_t
static
ssize_t
ncp_file_read
(
struct
file
*
file
,
char
__user
*
buf
,
size_t
count
,
loff_t
*
ppos
)
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
=
file_inode
(
file
);
struct
inode
*
inode
=
dentry
->
d_inode
;
size_t
already_read
=
0
;
size_t
already_read
=
0
;
off_t
pos
;
off_t
pos
;
size_t
bufsize
;
size_t
bufsize
;
...
@@ -109,7 +108,7 @@ ncp_file_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
...
@@ -109,7 +108,7 @@ ncp_file_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
void
*
freepage
;
void
*
freepage
;
size_t
freelen
;
size_t
freelen
;
ncp_dbg
(
1
,
"enter %p
d2
\n
"
,
dentry
);
ncp_dbg
(
1
,
"enter %p
D2
\n
"
,
file
);
pos
=
*
ppos
;
pos
=
*
ppos
;
...
@@ -167,7 +166,7 @@ ncp_file_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
...
@@ -167,7 +166,7 @@ ncp_file_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
file_accessed
(
file
);
file_accessed
(
file
);
ncp_dbg
(
1
,
"exit %p
d2
\n
"
,
dentry
);
ncp_dbg
(
1
,
"exit %p
D2
\n
"
,
file
);
outrel:
outrel:
ncp_inode_close
(
inode
);
ncp_inode_close
(
inode
);
return
already_read
?
already_read
:
error
;
return
already_read
?
already_read
:
error
;
...
@@ -176,15 +175,14 @@ ncp_file_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
...
@@ -176,15 +175,14 @@ ncp_file_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
static
ssize_t
static
ssize_t
ncp_file_write
(
struct
file
*
file
,
const
char
__user
*
buf
,
size_t
count
,
loff_t
*
ppos
)
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
=
file_inode
(
file
);
struct
inode
*
inode
=
dentry
->
d_inode
;
size_t
already_written
=
0
;
size_t
already_written
=
0
;
off_t
pos
;
off_t
pos
;
size_t
bufsize
;
size_t
bufsize
;
int
errno
;
int
errno
;
void
*
bouncebuffer
;
void
*
bouncebuffer
;
ncp_dbg
(
1
,
"enter %p
d2
\n
"
,
dentry
);
ncp_dbg
(
1
,
"enter %p
D2
\n
"
,
file
);
if
((
ssize_t
)
count
<
0
)
if
((
ssize_t
)
count
<
0
)
return
-
EINVAL
;
return
-
EINVAL
;
pos
=
*
ppos
;
pos
=
*
ppos
;
...
@@ -263,7 +261,7 @@ ncp_file_write(struct file *file, const char __user *buf, size_t count, loff_t *
...
@@ -263,7 +261,7 @@ ncp_file_write(struct file *file, const char __user *buf, size_t count, loff_t *
i_size_write
(
inode
,
pos
);
i_size_write
(
inode
,
pos
);
mutex_unlock
(
&
inode
->
i_mutex
);
mutex_unlock
(
&
inode
->
i_mutex
);
}
}
ncp_dbg
(
1
,
"exit %p
d2
\n
"
,
dentry
);
ncp_dbg
(
1
,
"exit %p
D2
\n
"
,
file
);
outrel:
outrel:
ncp_inode_close
(
inode
);
ncp_inode_close
(
inode
);
return
already_written
?
already_written
:
errno
;
return
already_written
?
already_written
:
errno
;
...
...
fs/ncpfs/mmap.c
View file @
a67f797d
...
@@ -30,9 +30,7 @@
...
@@ -30,9 +30,7 @@
static
int
ncp_file_mmap_fault
(
struct
vm_area_struct
*
area
,
static
int
ncp_file_mmap_fault
(
struct
vm_area_struct
*
area
,
struct
vm_fault
*
vmf
)
struct
vm_fault
*
vmf
)
{
{
struct
file
*
file
=
area
->
vm_file
;
struct
inode
*
inode
=
file_inode
(
area
->
vm_file
);
struct
dentry
*
dentry
=
file
->
f_path
.
dentry
;
struct
inode
*
inode
=
dentry
->
d_inode
;
char
*
pg_addr
;
char
*
pg_addr
;
unsigned
int
already_read
;
unsigned
int
already_read
;
unsigned
int
count
;
unsigned
int
count
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment