Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
55430e2e
Commit
55430e2e
authored
Apr 18, 2009
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nfsd struct path use: exp_get_by_name()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
dd5cae6e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
20 deletions
+18
-20
fs/nfsd/export.c
fs/nfsd/export.c
+18
-20
No files found.
fs/nfsd/export.c
View file @
55430e2e
...
@@ -847,9 +847,8 @@ exp_get_fsid_key(svc_client *clp, int fsid)
...
@@ -847,9 +847,8 @@ exp_get_fsid_key(svc_client *clp, int fsid)
return
exp_find_key
(
clp
,
FSID_NUM
,
fsidv
,
NULL
);
return
exp_find_key
(
clp
,
FSID_NUM
,
fsidv
,
NULL
);
}
}
static
svc_export
*
exp_get_by_name
(
svc_client
*
clp
,
struct
vfsmount
*
mnt
,
static
svc_export
*
exp_get_by_name
(
svc_client
*
clp
,
const
struct
path
*
path
,
struct
dentry
*
dentry
,
struct
cache_req
*
reqp
)
struct
cache_req
*
reqp
)
{
{
struct
svc_export
*
exp
,
key
;
struct
svc_export
*
exp
,
key
;
int
err
;
int
err
;
...
@@ -858,8 +857,7 @@ static svc_export *exp_get_by_name(svc_client *clp, struct vfsmount *mnt,
...
@@ -858,8 +857,7 @@ static svc_export *exp_get_by_name(svc_client *clp, struct vfsmount *mnt,
return
ERR_PTR
(
-
ENOENT
);
return
ERR_PTR
(
-
ENOENT
);
key
.
ex_client
=
clp
;
key
.
ex_client
=
clp
;
key
.
ex_path
.
mnt
=
mnt
;
key
.
ex_path
=
*
path
;
key
.
ex_path
.
dentry
=
dentry
;
exp
=
svc_export_lookup
(
&
key
);
exp
=
svc_export_lookup
(
&
key
);
if
(
exp
==
NULL
)
if
(
exp
==
NULL
)
...
@@ -877,20 +875,19 @@ static struct svc_export *exp_parent(svc_client *clp, struct vfsmount *mnt,
...
@@ -877,20 +875,19 @@ static struct svc_export *exp_parent(svc_client *clp, struct vfsmount *mnt,
struct
dentry
*
dentry
,
struct
dentry
*
dentry
,
struct
cache_req
*
reqp
)
struct
cache_req
*
reqp
)
{
{
struct
path
path
=
{.
mnt
=
mnt
,
.
dentry
=
dentry
};
svc_export
*
exp
;
svc_export
*
exp
;
dget
(
dentry
);
dget
(
path
.
dentry
);
exp
=
exp_get_by_name
(
clp
,
mnt
,
dentry
,
reqp
);
exp
=
exp_get_by_name
(
clp
,
&
path
,
reqp
);
while
(
PTR_ERR
(
exp
)
==
-
ENOENT
&&
!
IS_ROOT
(
dentry
))
{
struct
dentry
*
parent
;
parent
=
dget_parent
(
dentry
);
while
(
PTR_ERR
(
exp
)
==
-
ENOENT
&&
!
IS_ROOT
(
path
.
dentry
))
{
dput
(
dentry
);
struct
dentry
*
parent
=
dget_parent
(
path
.
dentry
);
dentry
=
parent
;
dput
(
path
.
dentry
);
exp
=
exp_get_by_name
(
clp
,
mnt
,
dentry
,
reqp
);
path
.
dentry
=
parent
;
exp
=
exp_get_by_name
(
clp
,
&
path
,
reqp
);
}
}
dput
(
dentry
);
dput
(
path
.
dentry
);
return
exp
;
return
exp
;
}
}
...
@@ -1018,7 +1015,7 @@ exp_export(struct nfsctl_export *nxp)
...
@@ -1018,7 +1015,7 @@ exp_export(struct nfsctl_export *nxp)
goto
out_put_clp
;
goto
out_put_clp
;
err
=
-
EINVAL
;
err
=
-
EINVAL
;
exp
=
exp_get_by_name
(
clp
,
path
.
mnt
,
path
.
dentry
,
NULL
);
exp
=
exp_get_by_name
(
clp
,
&
path
,
NULL
);
memset
(
&
new
,
0
,
sizeof
(
new
));
memset
(
&
new
,
0
,
sizeof
(
new
));
...
@@ -1135,7 +1132,7 @@ exp_unexport(struct nfsctl_export *nxp)
...
@@ -1135,7 +1132,7 @@ exp_unexport(struct nfsctl_export *nxp)
goto
out_domain
;
goto
out_domain
;
err
=
-
EINVAL
;
err
=
-
EINVAL
;
exp
=
exp_get_by_name
(
dom
,
path
.
mnt
,
path
.
dentry
,
NULL
);
exp
=
exp_get_by_name
(
dom
,
&
path
,
NULL
);
path_put
(
&
path
);
path_put
(
&
path
);
if
(
IS_ERR
(
exp
))
if
(
IS_ERR
(
exp
))
goto
out_domain
;
goto
out_domain
;
...
@@ -1207,7 +1204,7 @@ static struct svc_export *exp_find(struct auth_domain *clp, int fsid_type,
...
@@ -1207,7 +1204,7 @@ static struct svc_export *exp_find(struct auth_domain *clp, int fsid_type,
if
(
IS_ERR
(
ek
))
if
(
IS_ERR
(
ek
))
return
ERR_CAST
(
ek
);
return
ERR_CAST
(
ek
);
exp
=
exp_get_by_name
(
clp
,
ek
->
ek_path
.
mnt
,
ek
->
ek_path
.
dentry
,
reqp
);
exp
=
exp_get_by_name
(
clp
,
&
ek
->
ek_path
,
reqp
);
cache_put
(
&
ek
->
h
,
&
svc_expkey_cache
);
cache_put
(
&
ek
->
h
,
&
svc_expkey_cache
);
if
(
IS_ERR
(
exp
))
if
(
IS_ERR
(
exp
))
...
@@ -1251,12 +1248,13 @@ rqst_exp_get_by_name(struct svc_rqst *rqstp, struct vfsmount *mnt,
...
@@ -1251,12 +1248,13 @@ rqst_exp_get_by_name(struct svc_rqst *rqstp, struct vfsmount *mnt,
struct
dentry
*
dentry
)
struct
dentry
*
dentry
)
{
{
struct
svc_export
*
gssexp
,
*
exp
=
ERR_PTR
(
-
ENOENT
);
struct
svc_export
*
gssexp
,
*
exp
=
ERR_PTR
(
-
ENOENT
);
struct
path
path
=
{.
mnt
=
mnt
,
.
dentry
=
dentry
};
if
(
rqstp
->
rq_client
==
NULL
)
if
(
rqstp
->
rq_client
==
NULL
)
goto
gss
;
goto
gss
;
/* First try the auth_unix client: */
/* First try the auth_unix client: */
exp
=
exp_get_by_name
(
rqstp
->
rq_client
,
mnt
,
dentry
,
exp
=
exp_get_by_name
(
rqstp
->
rq_client
,
&
path
,
&
rqstp
->
rq_chandle
);
&
rqstp
->
rq_chandle
);
if
(
PTR_ERR
(
exp
)
==
-
ENOENT
)
if
(
PTR_ERR
(
exp
)
==
-
ENOENT
)
goto
gss
;
goto
gss
;
...
@@ -1269,7 +1267,7 @@ gss:
...
@@ -1269,7 +1267,7 @@ gss:
/* Otherwise, try falling back on gss client */
/* Otherwise, try falling back on gss client */
if
(
rqstp
->
rq_gssclient
==
NULL
)
if
(
rqstp
->
rq_gssclient
==
NULL
)
return
exp
;
return
exp
;
gssexp
=
exp_get_by_name
(
rqstp
->
rq_gssclient
,
mnt
,
dentry
,
gssexp
=
exp_get_by_name
(
rqstp
->
rq_gssclient
,
&
path
,
&
rqstp
->
rq_chandle
);
&
rqstp
->
rq_chandle
);
if
(
PTR_ERR
(
gssexp
)
==
-
ENOENT
)
if
(
PTR_ERR
(
gssexp
)
==
-
ENOENT
)
return
exp
;
return
exp
;
...
...
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