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
nexedi
linux
Commits
dd2907bf
Commit
dd2907bf
authored
Feb 07, 2002
by
Alexander Viro
Committed by
Linus Torvalds
Feb 07, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] knfsd cleanups
unused arguments (and dead code) removed from exp_rootfh().
parent
8c06da79
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
38 deletions
+17
-38
fs/nfsd/export.c
fs/nfsd/export.c
+14
-35
fs/nfsd/nfsctl.c
fs/nfsd/nfsctl.c
+2
-2
include/linux/nfsd/export.h
include/linux/nfsd/export.h
+1
-1
No files found.
fs/nfsd/export.c
View file @
dd2907bf
...
...
@@ -380,55 +380,34 @@ exp_unexport(struct nfsctl_export *nxp)
* since its harder to fool a kernel module than a user space program.
*/
int
exp_rootfh
(
struct
svc_client
*
clp
,
kdev_t
dev
,
ino_t
ino
,
char
*
path
,
struct
knfsd_fh
*
f
,
int
maxsize
)
exp_rootfh
(
struct
svc_client
*
clp
,
char
*
path
,
struct
knfsd_fh
*
f
,
int
maxsize
)
{
struct
svc_export
*
exp
;
struct
nameidata
nd
;
struct
inode
*
inode
;
struct
svc_fh
fh
;
kdev_t
dev
;
int
err
;
err
=
-
EPERM
;
if
(
path
)
{
if
(
path_init
(
path
,
LOOKUP_POSITIVE
,
&
nd
)
&&
path_walk
(
path
,
&
nd
))
{
printk
(
"nfsd: exp_rootfh path not found %s"
,
path
);
return
err
;
}
dev
=
nd
.
dentry
->
d_inode
->
i_dev
;
ino
=
nd
.
dentry
->
d_inode
->
i_ino
;
dprintk
(
"nfsd: exp_rootfh(%s [%p] %s:%02x:%02x/%ld)
\n
"
,
path
,
nd
.
dentry
,
clp
->
cl_ident
,
major
(
dev
),
minor
(
dev
),
(
long
)
ino
);
exp
=
exp_parent
(
clp
,
dev
,
nd
.
dentry
);
}
else
{
dprintk
(
"nfsd: exp_rootfh(%s:%02x:%02x/%ld)
\n
"
,
clp
->
cl_ident
,
major
(
dev
),
minor
(
dev
),
(
long
)
ino
);
if
((
exp
=
exp_get
(
clp
,
dev
,
ino
)))
{
nd
.
mnt
=
mntget
(
exp
->
ex_mnt
);
nd
.
dentry
=
dget
(
exp
->
ex_dentry
);
}
/* NB: we probably ought to check that it's NUL-terminated */
if
(
path_init
(
path
,
LOOKUP_POSITIVE
,
&
nd
)
&&
path_walk
(
path
,
&
nd
))
{
printk
(
"nfsd: exp_rootfh path not found %s"
,
path
);
return
err
;
}
inode
=
nd
.
dentry
->
d_inode
;
dev
=
inode
->
i_dev
;
dprintk
(
"nfsd: exp_rootfh(%s [%p] %s:%02x:%02x/%ld)
\n
"
,
path
,
nd
.
dentry
,
clp
->
cl_ident
,
major
(
dev
),
minor
(
dev
),
(
long
)
inode
->
i_ino
);
exp
=
exp_parent
(
clp
,
dev
,
nd
.
dentry
);
if
(
!
exp
)
{
dprintk
(
"nfsd: exp_rootfh export not found.
\n
"
);
goto
out
;
}
inode
=
nd
.
dentry
->
d_inode
;
if
(
!
inode
)
{
printk
(
"exp_rootfh: Aieee, NULL d_inode
\n
"
);
goto
out
;
}
if
(
!
kdev_same
(
inode
->
i_dev
,
dev
)
||
inode
->
i_ino
!=
ino
)
{
printk
(
"exp_rootfh: Aieee, ino/dev mismatch
\n
"
);
printk
(
"exp_rootfh: arg[dev(%02x:%02x):ino(%ld)]"
" inode[dev(%02x:%02x):ino(%ld)]
\n
"
,
major
(
dev
),
minor
(
dev
),
(
long
)
ino
,
major
(
inode
->
i_dev
),
minor
(
inode
->
i_dev
),
(
long
)
inode
->
i_ino
);
}
/*
* fh must be initialized before calling fh_compose
*/
...
...
fs/nfsd/nfsctl.c
View file @
dd2907bf
...
...
@@ -124,7 +124,7 @@ nfsctl_getfs(struct nfsctl_fsparm *data, struct knfsd_fh *res)
if
(
!
(
clp
=
exp_getclient
(
sin
)))
err
=
-
EPERM
;
else
err
=
exp_rootfh
(
clp
,
NODEV
,
0
,
data
->
gd_path
,
res
,
data
->
gd_maxlen
);
err
=
exp_rootfh
(
clp
,
data
->
gd_path
,
res
,
data
->
gd_maxlen
);
exp_unlock
();
return
err
;
}
...
...
@@ -147,7 +147,7 @@ nfsctl_getfd(struct nfsctl_fdparm *data, __u8 *res)
if
(
!
(
clp
=
exp_getclient
(
sin
)))
err
=
-
EPERM
;
else
err
=
exp_rootfh
(
clp
,
NODEV
,
0
,
data
->
gd_path
,
&
fh
,
NFS_FHSIZE
);
err
=
exp_rootfh
(
clp
,
data
->
gd_path
,
&
fh
,
NFS_FHSIZE
);
exp_unlock
();
if
(
err
==
0
)
{
...
...
include/linux/nfsd/export.h
View file @
dd2907bf
...
...
@@ -90,7 +90,7 @@ void exp_unlock(void);
struct
svc_client
*
exp_getclient
(
struct
sockaddr_in
*
sin
);
void
exp_putclient
(
struct
svc_client
*
clp
);
struct
svc_export
*
exp_get
(
struct
svc_client
*
clp
,
kdev_t
dev
,
ino_t
ino
);
int
exp_rootfh
(
struct
svc_client
*
,
kdev_t
,
ino_t
,
int
exp_rootfh
(
struct
svc_client
*
,
char
*
path
,
struct
knfsd_fh
*
,
int
maxsize
);
int
nfserrno
(
int
errno
);
void
exp_nlmdetach
(
void
);
...
...
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