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
df821d2c
Commit
df821d2c
authored
Oct 11, 2002
by
Neil Brown
Committed by
Linus Torvalds
Oct 11, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] kNFSd: Open code exp_get and exp_get_fsid in the one place they are called.
parent
98b86145
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
35 deletions
+13
-35
fs/nfsd/export.c
fs/nfsd/export.c
+13
-35
No files found.
fs/nfsd/export.c
View file @
df821d2c
...
@@ -112,18 +112,6 @@ exp_get_key(svc_client *clp, dev_t dev, ino_t ino)
...
@@ -112,18 +112,6 @@ exp_get_key(svc_client *clp, dev_t dev, ino_t ino)
return
exp_find_key
(
clp
,
0
,
fsidv
);
return
exp_find_key
(
clp
,
0
,
fsidv
);
}
}
static
inline
svc_export
*
exp_get
(
svc_client
*
clp
,
dev_t
dev
,
ino_t
ino
)
{
struct
svc_expkey
*
ek
;
ek
=
exp_get_key
(
clp
,
dev
,
ino
);
if
(
ek
)
return
ek
->
ek_export
;
else
return
NULL
;
}
/*
/*
* Find the client's export entry matching fsid
* Find the client's export entry matching fsid
*/
*/
...
@@ -137,18 +125,6 @@ exp_get_fsid_key(svc_client *clp, int fsid)
...
@@ -137,18 +125,6 @@ exp_get_fsid_key(svc_client *clp, int fsid)
return
exp_find_key
(
clp
,
1
,
fsidv
);
return
exp_find_key
(
clp
,
1
,
fsidv
);
}
}
static
inline
svc_export
*
exp_get_fsid
(
svc_client
*
clp
,
int
fsid
)
{
struct
svc_expkey
*
ek
;
ek
=
exp_get_fsid_key
(
clp
,
fsid
);
if
(
ek
)
return
ek
->
ek_export
;
else
return
NULL
;
}
svc_export
*
svc_export
*
exp_get_by_name
(
svc_client
*
clp
,
struct
vfsmount
*
mnt
,
struct
dentry
*
dentry
)
exp_get_by_name
(
svc_client
*
clp
,
struct
vfsmount
*
mnt
,
struct
dentry
*
dentry
)
{
{
...
@@ -301,7 +277,7 @@ exp_export(struct nfsctl_export *nxp)
...
@@ -301,7 +277,7 @@ exp_export(struct nfsctl_export *nxp)
{
{
svc_client
*
clp
;
svc_client
*
clp
;
svc_export
*
exp
=
NULL
;
svc_export
*
exp
=
NULL
;
s
vc_export
*
fsid_exp
;
s
truct
svc_expkey
*
fsid_key
;
struct
nameidata
nd
;
struct
nameidata
nd
;
struct
inode
*
inode
=
NULL
;
struct
inode
*
inode
=
NULL
;
int
err
;
int
err
;
...
@@ -335,8 +311,9 @@ exp_export(struct nfsctl_export *nxp)
...
@@ -335,8 +311,9 @@ exp_export(struct nfsctl_export *nxp)
/* must make sure there wont be an ex_fsid clash */
/* must make sure there wont be an ex_fsid clash */
if
((
nxp
->
ex_flags
&
NFSEXP_FSID
)
&&
if
((
nxp
->
ex_flags
&
NFSEXP_FSID
)
&&
(
fsid_exp
=
exp_get_fsid
(
clp
,
nxp
->
ex_dev
))
&&
(
fsid_key
=
exp_get_fsid_key
(
clp
,
nxp
->
ex_dev
))
&&
fsid_exp
!=
exp
)
fsid_key
->
ek_export
&&
fsid_key
->
ek_export
!=
exp
)
goto
finish
;
goto
finish
;
if
(
exp
!=
NULL
)
{
if
(
exp
!=
NULL
)
{
...
@@ -477,9 +454,9 @@ exp_unexport(struct nfsctl_export *nxp)
...
@@ -477,9 +454,9 @@ exp_unexport(struct nfsctl_export *nxp)
dom
=
auth_domain_find
(
nxp
->
ex_client
);
dom
=
auth_domain_find
(
nxp
->
ex_client
);
if
(
dom
)
{
if
(
dom
)
{
s
vc_export
*
exp
=
exp_get
(
dom
,
nxp
->
ex_dev
,
nxp
->
ex_ino
);
s
truct
svc_expkey
*
key
=
exp_get_key
(
dom
,
nxp
->
ex_dev
,
nxp
->
ex_ino
);
if
(
exp
)
{
if
(
key
&&
key
->
ek_export
)
{
exp_do_unexport
(
exp
);
exp_do_unexport
(
key
->
ek_export
);
err
=
0
;
err
=
0
;
}
else
}
else
dprintk
(
"nfsd: no export %x/%lx for %s
\n
"
,
dprintk
(
"nfsd: no export %x/%lx for %s
\n
"
,
...
@@ -547,14 +524,15 @@ exp_rootfh(svc_client *clp, char *path, struct knfsd_fh *f, int maxsize)
...
@@ -547,14 +524,15 @@ exp_rootfh(svc_client *clp, char *path, struct knfsd_fh *f, int maxsize)
int
int
exp_pseudoroot
(
struct
auth_domain
*
clp
,
struct
svc_fh
*
fhp
)
exp_pseudoroot
(
struct
auth_domain
*
clp
,
struct
svc_fh
*
fhp
)
{
{
struct
svc_exp
ort
*
exp
;
struct
svc_exp
key
*
fsid_key
;
exp
=
exp_get_fsid
(
clp
,
0
);
fsid_key
=
exp_get_fsid_key
(
clp
,
0
);
if
(
!
exp
)
if
(
!
fsid_key
||
IS_ERR
(
fsid_key
)
)
return
nfserr_perm
;
return
nfserr_perm
;
dget
(
exp
->
ex_dentry
);
dget
(
fsid_key
->
ek_export
->
ex_dentry
);
return
fh_compose
(
fhp
,
exp
,
exp
->
ex_dentry
,
NULL
);
return
fh_compose
(
fhp
,
fsid_key
->
ek_export
,
fsid_key
->
ek_export
->
ex_dentry
,
NULL
);
}
}
/* Iterator */
/* Iterator */
...
...
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