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
83d0b845
Commit
83d0b845
authored
Nov 15, 2020
by
Chuck Lever
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NFSD: Clean up after updating NFSv2 ACL encoders
Signed-off-by:
Chuck Lever
<
chuck.lever@oracle.com
>
parent
07f5c296
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
65 deletions
+0
-65
fs/nfsd/nfsxdr.c
fs/nfsd/nfsxdr.c
+0
-64
fs/nfsd/xdr.h
fs/nfsd/xdr.h
+0
-1
No files found.
fs/nfsd/nfsxdr.c
View file @
83d0b845
...
...
@@ -201,64 +201,6 @@ svcxdr_decode_sattr(struct svc_rqst *rqstp, struct xdr_stream *xdr,
return
true
;
}
static
__be32
*
encode_fattr
(
struct
svc_rqst
*
rqstp
,
__be32
*
p
,
struct
svc_fh
*
fhp
,
struct
kstat
*
stat
)
{
struct
user_namespace
*
userns
=
nfsd_user_namespace
(
rqstp
);
struct
dentry
*
dentry
=
fhp
->
fh_dentry
;
int
type
;
struct
timespec64
time
;
u32
f
;
type
=
(
stat
->
mode
&
S_IFMT
);
*
p
++
=
htonl
(
nfs_ftypes
[
type
>>
12
]);
*
p
++
=
htonl
((
u32
)
stat
->
mode
);
*
p
++
=
htonl
((
u32
)
stat
->
nlink
);
*
p
++
=
htonl
((
u32
)
from_kuid_munged
(
userns
,
stat
->
uid
));
*
p
++
=
htonl
((
u32
)
from_kgid_munged
(
userns
,
stat
->
gid
));
if
(
S_ISLNK
(
type
)
&&
stat
->
size
>
NFS_MAXPATHLEN
)
{
*
p
++
=
htonl
(
NFS_MAXPATHLEN
);
}
else
{
*
p
++
=
htonl
((
u32
)
stat
->
size
);
}
*
p
++
=
htonl
((
u32
)
stat
->
blksize
);
if
(
S_ISCHR
(
type
)
||
S_ISBLK
(
type
))
*
p
++
=
htonl
(
new_encode_dev
(
stat
->
rdev
));
else
*
p
++
=
htonl
(
0xffffffff
);
*
p
++
=
htonl
((
u32
)
stat
->
blocks
);
switch
(
fsid_source
(
fhp
))
{
default:
case
FSIDSOURCE_DEV
:
*
p
++
=
htonl
(
new_encode_dev
(
stat
->
dev
));
break
;
case
FSIDSOURCE_FSID
:
*
p
++
=
htonl
((
u32
)
fhp
->
fh_export
->
ex_fsid
);
break
;
case
FSIDSOURCE_UUID
:
f
=
((
u32
*
)
fhp
->
fh_export
->
ex_uuid
)[
0
];
f
^=
((
u32
*
)
fhp
->
fh_export
->
ex_uuid
)[
1
];
f
^=
((
u32
*
)
fhp
->
fh_export
->
ex_uuid
)[
2
];
f
^=
((
u32
*
)
fhp
->
fh_export
->
ex_uuid
)[
3
];
*
p
++
=
htonl
(
f
);
break
;
}
*
p
++
=
htonl
((
u32
)
stat
->
ino
);
*
p
++
=
htonl
((
u32
)
stat
->
atime
.
tv_sec
);
*
p
++
=
htonl
(
stat
->
atime
.
tv_nsec
?
stat
->
atime
.
tv_nsec
/
1000
:
0
);
time
=
stat
->
mtime
;
lease_get_mtime
(
d_inode
(
dentry
),
&
time
);
*
p
++
=
htonl
((
u32
)
time
.
tv_sec
);
*
p
++
=
htonl
(
time
.
tv_nsec
?
time
.
tv_nsec
/
1000
:
0
);
*
p
++
=
htonl
((
u32
)
stat
->
ctime
.
tv_sec
);
*
p
++
=
htonl
(
stat
->
ctime
.
tv_nsec
?
stat
->
ctime
.
tv_nsec
/
1000
:
0
);
return
p
;
}
/**
* svcxdr_encode_fattr - Encode NFSv2 file attributes
* @rqstp: Context of a completed RPC transaction
...
...
@@ -328,12 +270,6 @@ svcxdr_encode_fattr(struct svc_rqst *rqstp, struct xdr_stream *xdr,
return
true
;
}
/* Helper function for NFSv2 ACL code */
__be32
*
nfs2svc_encode_fattr
(
struct
svc_rqst
*
rqstp
,
__be32
*
p
,
struct
svc_fh
*
fhp
,
struct
kstat
*
stat
)
{
return
encode_fattr
(
rqstp
,
p
,
fhp
,
stat
);
}
/*
* XDR decode functions
*/
...
...
fs/nfsd/xdr.h
View file @
83d0b845
...
...
@@ -168,7 +168,6 @@ void nfssvc_release_diropres(struct svc_rqst *rqstp);
void
nfssvc_release_readres
(
struct
svc_rqst
*
rqstp
);
/* Helper functions for NFSv2 ACL code */
__be32
*
nfs2svc_encode_fattr
(
struct
svc_rqst
*
rqstp
,
__be32
*
p
,
struct
svc_fh
*
fhp
,
struct
kstat
*
stat
);
bool
svcxdr_decode_fhandle
(
struct
xdr_stream
*
xdr
,
struct
svc_fh
*
fhp
);
bool
svcxdr_encode_stat
(
struct
xdr_stream
*
xdr
,
__be32
status
);
bool
svcxdr_encode_fattr
(
struct
svc_rqst
*
rqstp
,
struct
xdr_stream
*
xdr
,
...
...
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