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
78f7d75e
Commit
78f7d75e
authored
Aug 27, 2012
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
switch coda get_device_index() to fget_light()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
88b428d6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
17 deletions
+15
-17
fs/coda/inode.c
fs/coda/inode.c
+15
-17
No files found.
fs/coda/inode.c
View file @
78f7d75e
...
@@ -109,41 +109,39 @@ static int get_device_index(struct coda_mount_data *data)
...
@@ -109,41 +109,39 @@ static int get_device_index(struct coda_mount_data *data)
{
{
struct
file
*
file
;
struct
file
*
file
;
struct
inode
*
inode
;
struct
inode
*
inode
;
int
idx
;
int
idx
,
fput_needed
;
if
(
data
==
NULL
)
{
if
(
data
==
NULL
)
{
printk
(
"coda_read_super: Bad mount data
\n
"
);
printk
(
"coda_read_super: Bad mount data
\n
"
);
return
-
1
;
return
-
1
;
}
}
if
(
data
->
version
!=
CODA_MOUNT_VERSION
)
{
if
(
data
->
version
!=
CODA_MOUNT_VERSION
)
{
printk
(
"coda_read_super: Bad mount version
\n
"
);
printk
(
"coda_read_super: Bad mount version
\n
"
);
return
-
1
;
return
-
1
;
}
}
file
=
fget
(
data
->
fd
);
file
=
fget_light
(
data
->
fd
,
&
fput_needed
);
inode
=
NULL
;
if
(
!
file
)
if
(
file
)
goto
Ebadf
;
inode
=
file
->
f_path
.
dentry
->
d_inode
;
inode
=
file
->
f_path
.
dentry
->
d_inode
;
if
(
!
S_ISCHR
(
inode
->
i_mode
)
||
imajor
(
inode
)
!=
CODA_PSDEV_MAJOR
)
{
if
(
!
inode
||
!
S_ISCHR
(
inode
->
i_mode
)
||
fput_light
(
file
,
fput_needed
);
imajor
(
inode
)
!=
CODA_PSDEV_MAJOR
)
{
goto
Ebadf
;
if
(
file
)
fput
(
file
);
printk
(
"coda_read_super: Bad file
\n
"
);
return
-
1
;
}
}
idx
=
iminor
(
inode
);
idx
=
iminor
(
inode
);
fput
(
file
);
fput
_light
(
file
,
fput_needed
);
if
(
idx
<
0
||
idx
>=
MAX_CODADEVS
)
{
if
(
idx
<
0
||
idx
>=
MAX_CODADEVS
)
{
printk
(
"coda_read_super: Bad minor number
\n
"
);
printk
(
"coda_read_super: Bad minor number
\n
"
);
return
-
1
;
return
-
1
;
}
}
return
idx
;
return
idx
;
Ebadf:
printk
(
"coda_read_super: Bad file
\n
"
);
return
-
1
;
}
}
static
int
coda_fill_super
(
struct
super_block
*
sb
,
void
*
data
,
int
silent
)
static
int
coda_fill_super
(
struct
super_block
*
sb
,
void
*
data
,
int
silent
)
...
...
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