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
8a2cf9f5
Commit
8a2cf9f5
authored
Nov 15, 2020
by
Chuck Lever
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NFSD: Remove unused NFSv2 directory entry encoders
Clean up. Signed-off-by:
Chuck Lever
<
chuck.lever@oracle.com
>
parent
f5dcccd6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
57 deletions
+6
-57
fs/nfsd/nfsproc.c
fs/nfsd/nfsproc.c
+1
-1
fs/nfsd/nfsxdr.c
fs/nfsd/nfsxdr.c
+3
-48
fs/nfsd/xdr.h
fs/nfsd/xdr.h
+2
-8
No files found.
fs/nfsd/nfsproc.c
View file @
8a2cf9f5
...
...
@@ -602,7 +602,7 @@ nfsd_proc_readdir(struct svc_rqst *rqstp)
resp
->
cookie_offset
=
0
;
offset
=
argp
->
cookie
;
resp
->
status
=
nfsd_readdir
(
rqstp
,
&
argp
->
fh
,
&
offset
,
&
resp
->
common
,
nfs
2
svc_encode_entry
);
&
resp
->
common
,
nfssvc_encode_entry
);
nfssvc_encode_nfscookie
(
resp
,
offset
);
fh_put
(
&
argp
->
fh
);
...
...
fs/nfsd/nfsxdr.c
View file @
8a2cf9f5
...
...
@@ -663,7 +663,7 @@ svcxdr_encode_entry_common(struct nfsd_readdirres *resp, const char *name,
}
/**
* nfs
2
svc_encode_entry - encode one NFSv2 READDIR entry
* nfssvc_encode_entry - encode one NFSv2 READDIR entry
* @data: directory context
* @name: name of the object to be encoded
* @namlen: length of that name, in bytes
...
...
@@ -680,8 +680,8 @@ svcxdr_encode_entry_common(struct nfsd_readdirres *resp, const char *name,
* - resp->common.err
* - resp->cookie_offset
*/
int
nfs
2
svc_encode_entry
(
void
*
data
,
const
char
*
name
,
int
namlen
,
loff_t
offset
,
u64
ino
,
unsigned
int
d_type
)
int
nfssvc_encode_entry
(
void
*
data
,
const
char
*
name
,
int
namlen
,
loff_t
offset
,
u64
ino
,
unsigned
int
d_type
)
{
struct
readdir_cd
*
ccd
=
data
;
struct
nfsd_readdirres
*
resp
=
container_of
(
ccd
,
...
...
@@ -706,51 +706,6 @@ int nfs2svc_encode_entry(void *data, const char *name, int namlen,
return
-
EINVAL
;
}
int
nfssvc_encode_entry
(
void
*
ccdv
,
const
char
*
name
,
int
namlen
,
loff_t
offset
,
u64
ino
,
unsigned
int
d_type
)
{
struct
readdir_cd
*
ccd
=
ccdv
;
struct
nfsd_readdirres
*
cd
=
container_of
(
ccd
,
struct
nfsd_readdirres
,
common
);
__be32
*
p
=
cd
->
buffer
;
int
buflen
,
slen
;
/*
dprintk("nfsd: entry(%.*s off %ld ino %ld)\n",
namlen, name, offset, ino);
*/
if
(
offset
>
~
((
u32
)
0
))
{
cd
->
common
.
err
=
nfserr_fbig
;
return
-
EINVAL
;
}
nfssvc_encode_nfscookie
(
cd
,
offset
);
/* truncate filename */
namlen
=
min
(
namlen
,
NFS2_MAXNAMLEN
);
slen
=
XDR_QUADLEN
(
namlen
);
if
((
buflen
=
cd
->
buflen
-
slen
-
4
)
<
0
)
{
cd
->
common
.
err
=
nfserr_toosmall
;
return
-
EINVAL
;
}
if
(
ino
>
~
((
u32
)
0
))
{
cd
->
common
.
err
=
nfserr_fbig
;
return
-
EINVAL
;
}
*
p
++
=
xdr_one
;
/* mark entry present */
*
p
++
=
htonl
((
u32
)
ino
);
/* file id */
p
=
xdr_encode_array
(
p
,
name
,
namlen
);
/* name length & name */
cd
->
offset
=
p
;
/* remember pointer */
*
p
++
=
htonl
(
~
0U
);
/* offset of next entry */
cd
->
count
+=
p
-
cd
->
buffer
;
cd
->
buflen
=
buflen
;
cd
->
buffer
=
p
;
cd
->
common
.
err
=
nfs_ok
;
return
0
;
}
/*
* XDR release functions
*/
...
...
fs/nfsd/xdr.h
View file @
8a2cf9f5
...
...
@@ -115,10 +115,6 @@ struct nfsd_readdirres {
struct
xdr_stream
xdr
;
struct
xdr_buf
dirlist
;
struct
readdir_cd
common
;
__be32
*
buffer
;
int
buflen
;
__be32
*
offset
;
struct
page
*
page
;
unsigned
int
cookie_offset
;
};
...
...
@@ -164,10 +160,8 @@ int nfssvc_encode_statfsres(struct svc_rqst *, __be32 *);
int
nfssvc_encode_readdirres
(
struct
svc_rqst
*
,
__be32
*
);
void
nfssvc_encode_nfscookie
(
struct
nfsd_readdirres
*
resp
,
u32
offset
);
int
nfs2svc_encode_entry
(
void
*
data
,
const
char
*
name
,
int
namlen
,
loff_t
offset
,
u64
ino
,
unsigned
int
d_type
);
int
nfssvc_encode_entry
(
void
*
,
const
char
*
name
,
int
namlen
,
loff_t
offset
,
u64
ino
,
unsigned
int
);
int
nfssvc_encode_entry
(
void
*
data
,
const
char
*
name
,
int
namlen
,
loff_t
offset
,
u64
ino
,
unsigned
int
d_type
);
void
nfssvc_release_attrstat
(
struct
svc_rqst
*
rqstp
);
void
nfssvc_release_diropres
(
struct
svc_rqst
*
rqstp
);
...
...
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