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
ea6cacaf
Commit
ea6cacaf
authored
Apr 10, 2004
by
Trond Myklebust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NFSv4: assorted code readability cleanups in the XDR
parent
829186b7
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
117 additions
and
486 deletions
+117
-486
fs/nfs/nfs4proc.c
fs/nfs/nfs4proc.c
+7
-47
fs/nfs/nfs4xdr.c
fs/nfs/nfs4xdr.c
+92
-413
include/linux/nfs_xdr.h
include/linux/nfs_xdr.h
+18
-26
No files found.
fs/nfs/nfs4proc.c
View file @
ea6cacaf
...
@@ -169,19 +169,6 @@ renew_lease(struct nfs_server *server, unsigned long timestamp)
...
@@ -169,19 +169,6 @@ renew_lease(struct nfs_server *server, unsigned long timestamp)
spin_unlock
(
&
clp
->
cl_lock
);
spin_unlock
(
&
clp
->
cl_lock
);
}
}
static
inline
void
process_cinfo
(
struct
nfs4_change_info
*
info
,
struct
nfs_fattr
*
fattr
)
{
BUG_ON
((
fattr
->
valid
&
NFS_ATTR_FATTR
)
==
0
);
BUG_ON
((
fattr
->
valid
&
NFS_ATTR_FATTR_V4
)
==
0
);
if
(
fattr
->
change_attr
==
info
->
after
)
{
fattr
->
pre_change_attr
=
info
->
before
;
fattr
->
valid
|=
NFS_ATTR_PRE_CHANGE
;
fattr
->
timestamp
=
jiffies
;
}
}
static
void
update_changeattr
(
struct
inode
*
inode
,
struct
nfs4_change_info
*
cinfo
)
static
void
update_changeattr
(
struct
inode
*
inode
,
struct
nfs4_change_info
*
cinfo
)
{
{
struct
nfs_inode
*
nfsi
=
NFS_I
(
inode
);
struct
nfs_inode
*
nfsi
=
NFS_I
(
inode
);
...
@@ -203,12 +190,6 @@ nfs4_open_reclaim(struct nfs4_state_owner *sp, struct nfs4_state *state)
...
@@ -203,12 +190,6 @@ nfs4_open_reclaim(struct nfs4_state_owner *sp, struct nfs4_state *state)
struct
nfs_fattr
fattr
=
{
struct
nfs_fattr
fattr
=
{
.
valid
=
0
,
.
valid
=
0
,
};
};
struct
nfs4_change_info
d_cinfo
;
struct
nfs4_getattr
f_getattr
=
{
.
gt_bmval
=
nfs4_fattr_bitmap
,
.
gt_attrs
=
&
fattr
,
};
struct
nfs_open_reclaimargs
o_arg
=
{
struct
nfs_open_reclaimargs
o_arg
=
{
.
fh
=
NFS_FH
(
inode
),
.
fh
=
NFS_FH
(
inode
),
.
seqid
=
sp
->
so_seqid
,
.
seqid
=
sp
->
so_seqid
,
...
@@ -216,11 +197,10 @@ nfs4_open_reclaim(struct nfs4_state_owner *sp, struct nfs4_state *state)
...
@@ -216,11 +197,10 @@ nfs4_open_reclaim(struct nfs4_state_owner *sp, struct nfs4_state *state)
.
share_access
=
state
->
state
,
.
share_access
=
state
->
state
,
.
clientid
=
server
->
nfs4_state
->
cl_clientid
,
.
clientid
=
server
->
nfs4_state
->
cl_clientid
,
.
claim
=
NFS4_OPEN_CLAIM_PREVIOUS
,
.
claim
=
NFS4_OPEN_CLAIM_PREVIOUS
,
.
f_getattr
=
&
f_getattr
,
.
bitmask
=
nfs4_fattr_bitmap
,
};
};
struct
nfs_openres
o_res
=
{
struct
nfs_openres
o_res
=
{
.
cinfo
=
&
d_cinfo
,
.
f_attr
=
&
fattr
,
.
f_getattr
=
&
f_getattr
,
.
server
=
server
,
/* Grrr */
.
server
=
server
,
/* Grrr */
};
};
struct
rpc_message
msg
=
{
struct
rpc_message
msg
=
{
...
@@ -250,36 +230,21 @@ nfs4_do_open(struct inode *dir, struct qstr *name, int flags, struct iattr *satt
...
@@ -250,36 +230,21 @@ nfs4_do_open(struct inode *dir, struct qstr *name, int flags, struct iattr *satt
struct
nfs4_state
*
state
=
NULL
;
struct
nfs4_state
*
state
=
NULL
;
struct
nfs_server
*
server
=
NFS_SERVER
(
dir
);
struct
nfs_server
*
server
=
NFS_SERVER
(
dir
);
struct
inode
*
inode
=
NULL
;
struct
inode
*
inode
=
NULL
;
struct
nfs4_change_info
d_cinfo
;
int
status
;
int
status
;
struct
nfs_fattr
d_attr
=
{
.
valid
=
0
,
};
struct
nfs_fattr
f_attr
=
{
struct
nfs_fattr
f_attr
=
{
.
valid
=
0
,
.
valid
=
0
,
};
};
struct
nfs4_getattr
f_getattr
=
{
.
gt_bmval
=
nfs4_fattr_bitmap
,
.
gt_attrs
=
&
f_attr
,
};
struct
nfs4_getattr
d_getattr
=
{
.
gt_bmval
=
nfs4_fattr_bitmap
,
.
gt_attrs
=
&
d_attr
,
};
struct
nfs_openargs
o_arg
=
{
struct
nfs_openargs
o_arg
=
{
.
fh
=
NFS_FH
(
dir
),
.
fh
=
NFS_FH
(
dir
),
.
share_access
=
flags
&
(
FMODE_READ
|
FMODE_WRITE
),
.
share_access
=
flags
&
(
FMODE_READ
|
FMODE_WRITE
),
.
opentype
=
(
flags
&
O_CREAT
)
?
NFS4_OPEN_CREATE
:
NFS4_OPEN_NOCREATE
,
.
opentype
=
(
flags
&
O_CREAT
)
?
NFS4_OPEN_CREATE
:
NFS4_OPEN_NOCREATE
,
.
createmode
=
(
flags
&
O_EXCL
)
?
NFS4_CREATE_EXCLUSIVE
:
NFS4_CREATE_UNCHECKED
,
.
createmode
=
(
flags
&
O_EXCL
)
?
NFS4_CREATE_EXCLUSIVE
:
NFS4_CREATE_UNCHECKED
,
.
name
=
name
,
.
name
=
name
,
.
f_getattr
=
&
f_getattr
,
.
d_getattr
=
&
d_getattr
,
.
server
=
server
,
.
server
=
server
,
.
bitmask
=
nfs4_fattr_bitmap
,
};
};
struct
nfs_openres
o_res
=
{
struct
nfs_openres
o_res
=
{
.
cinfo
=
&
d_cinfo
,
.
f_attr
=
&
f_attr
,
.
f_getattr
=
&
f_getattr
,
.
d_getattr
=
&
d_getattr
,
.
server
=
server
,
.
server
=
server
,
};
};
struct
rpc_message
msg
=
{
struct
rpc_message
msg
=
{
...
@@ -312,8 +277,7 @@ nfs4_do_open(struct inode *dir, struct qstr *name, int flags, struct iattr *satt
...
@@ -312,8 +277,7 @@ nfs4_do_open(struct inode *dir, struct qstr *name, int flags, struct iattr *satt
nfs4_increment_seqid
(
status
,
sp
);
nfs4_increment_seqid
(
status
,
sp
);
if
(
status
)
if
(
status
)
goto
out_up
;
goto
out_up
;
process_cinfo
(
&
d_cinfo
,
&
d_attr
);
update_changeattr
(
dir
,
&
o_res
.
cinfo
);
nfs_refresh_inode
(
dir
,
&
d_attr
);
status
=
-
ENOMEM
;
status
=
-
ENOMEM
;
inode
=
nfs_fhget
(
dir
->
i_sb
,
&
o_res
.
fh
,
&
f_attr
);
inode
=
nfs_fhget
(
dir
->
i_sb
,
&
o_res
.
fh
,
&
f_attr
);
...
@@ -395,18 +359,14 @@ nfs4_do_setattr(struct nfs_server *server, struct nfs_fattr *fattr,
...
@@ -395,18 +359,14 @@ nfs4_do_setattr(struct nfs_server *server, struct nfs_fattr *fattr,
struct
nfs_fh
*
fhandle
,
struct
iattr
*
sattr
,
struct
nfs_fh
*
fhandle
,
struct
iattr
*
sattr
,
struct
nfs4_state
*
state
)
struct
nfs4_state
*
state
)
{
{
struct
nfs4_getattr
getattr
=
{
.
gt_bmval
=
nfs4_fattr_bitmap
,
.
gt_attrs
=
fattr
,
};
struct
nfs_setattrargs
arg
=
{
struct
nfs_setattrargs
arg
=
{
.
fh
=
fhandle
,
.
fh
=
fhandle
,
.
iap
=
sattr
,
.
iap
=
sattr
,
.
attr
=
&
getattr
,
.
server
=
server
,
.
server
=
server
,
.
bitmask
=
nfs4_fattr_bitmap
,
};
};
struct
nfs_setattrres
res
=
{
struct
nfs_setattrres
res
=
{
.
attr
=
&
get
attr
,
.
fattr
=
f
attr
,
.
server
=
server
,
.
server
=
server
,
};
};
struct
rpc_message
msg
=
{
struct
rpc_message
msg
=
{
...
...
fs/nfs/nfs4xdr.c
View file @
ea6cacaf
...
@@ -89,8 +89,6 @@ static int nfs_stat_to_errno(int);
...
@@ -89,8 +89,6 @@ static int nfs_stat_to_errno(int);
nfs4_fattr_bitmap_maxsz)
nfs4_fattr_bitmap_maxsz)
#define encode_savefh_maxsz (op_encode_hdr_maxsz)
#define encode_savefh_maxsz (op_encode_hdr_maxsz)
#define decode_savefh_maxsz (op_decode_hdr_maxsz)
#define decode_savefh_maxsz (op_decode_hdr_maxsz)
#define encode_restorefh_maxsz (op_encode_hdr_maxsz)
#define decode_restorefh_maxsz (op_decode_hdr_maxsz)
#define encode_fsinfo_maxsz (op_encode_hdr_maxsz + 2)
#define encode_fsinfo_maxsz (op_encode_hdr_maxsz + 2)
#define decode_fsinfo_maxsz (op_decode_hdr_maxsz + 11)
#define decode_fsinfo_maxsz (op_decode_hdr_maxsz + 11)
#define encode_renew_maxsz (op_encode_hdr_maxsz + 3)
#define encode_renew_maxsz (op_encode_hdr_maxsz + 3)
...
@@ -158,21 +156,15 @@ static int nfs_stat_to_errno(int);
...
@@ -158,21 +156,15 @@ static int nfs_stat_to_errno(int);
op_decode_hdr_maxsz + 2)
op_decode_hdr_maxsz + 2)
#define NFS4_enc_open_sz (compound_encode_hdr_maxsz + \
#define NFS4_enc_open_sz (compound_encode_hdr_maxsz + \
encode_putfh_maxsz + \
encode_putfh_maxsz + \
encode_savefh_maxsz + \
op_encode_hdr_maxsz + \
op_encode_hdr_maxsz + \
13 + 3 + 2 + 64 + \
13 + 3 + 2 + 64 + \
encode_getattr_maxsz + \
encode_getattr_maxsz + \
encode_getfh_maxsz + \
encode_getfh_maxsz)
encode_restorefh_maxsz + \
encode_getattr_maxsz)
#define NFS4_dec_open_sz (compound_decode_hdr_maxsz + \
#define NFS4_dec_open_sz (compound_decode_hdr_maxsz + \
decode_putfh_maxsz + \
decode_putfh_maxsz + \
decode_savefh_maxsz + \
op_decode_hdr_maxsz + 4 + 5 + 2 + 3 + \
op_decode_hdr_maxsz + 4 + 5 + 2 + 3 + \
decode_getattr_maxsz + \
decode_getattr_maxsz + \
decode_getfh_maxsz + \
decode_getfh_maxsz)
decode_restorefh_maxsz + \
decode_getattr_maxsz)
#define NFS4_enc_open_confirm_sz \
#define NFS4_enc_open_confirm_sz \
(compound_encode_hdr_maxsz + \
(compound_encode_hdr_maxsz + \
encode_putfh_maxsz + \
encode_putfh_maxsz + \
...
@@ -344,8 +336,6 @@ static int nfs_stat_to_errno(int);
...
@@ -344,8 +336,6 @@ static int nfs_stat_to_errno(int);
decode_putfh_maxsz + \
decode_putfh_maxsz + \
op_decode_hdr_maxsz + 12)
op_decode_hdr_maxsz + 12)
static
struct
{
static
struct
{
unsigned
int
mode
;
unsigned
int
mode
;
unsigned
int
nfs2type
;
unsigned
int
nfs2type
;
...
@@ -394,8 +384,7 @@ struct compound_hdr {
...
@@ -394,8 +384,7 @@ struct compound_hdr {
BUG_ON(!p); \
BUG_ON(!p); \
} while (0)
} while (0)
static
int
static
int
encode_compound_hdr
(
struct
xdr_stream
*
xdr
,
struct
compound_hdr
*
hdr
)
encode_compound_hdr
(
struct
xdr_stream
*
xdr
,
struct
compound_hdr
*
hdr
)
{
{
uint32_t
*
p
;
uint32_t
*
p
;
...
@@ -547,8 +536,7 @@ static int encode_access(struct xdr_stream *xdr, u32 access)
...
@@ -547,8 +536,7 @@ static int encode_access(struct xdr_stream *xdr, u32 access)
return
0
;
return
0
;
}
}
static
int
static
int
encode_close
(
struct
xdr_stream
*
xdr
,
const
struct
nfs_closeargs
*
arg
)
encode_close
(
struct
xdr_stream
*
xdr
,
struct
nfs_closeargs
*
arg
)
{
{
uint32_t
*
p
;
uint32_t
*
p
;
...
@@ -560,8 +548,7 @@ encode_close(struct xdr_stream *xdr, struct nfs_closeargs *arg)
...
@@ -560,8 +548,7 @@ encode_close(struct xdr_stream *xdr, struct nfs_closeargs *arg)
return
0
;
return
0
;
}
}
static
int
static
int
encode_commit
(
struct
xdr_stream
*
xdr
,
const
struct
nfs_writeargs
*
args
)
encode_commit
(
struct
xdr_stream
*
xdr
,
struct
nfs_writeargs
*
args
)
{
{
uint32_t
*
p
;
uint32_t
*
p
;
...
@@ -605,8 +592,7 @@ static int encode_create(struct xdr_stream *xdr, const struct nfs4_create_arg *c
...
@@ -605,8 +592,7 @@ static int encode_create(struct xdr_stream *xdr, const struct nfs4_create_arg *c
return
encode_attrs
(
xdr
,
create
->
attrs
,
create
->
server
);
return
encode_attrs
(
xdr
,
create
->
attrs
,
create
->
server
);
}
}
static
int
static
int
encode_getattr_one
(
struct
xdr_stream
*
xdr
,
uint32_t
bitmap
)
encode_getattr_one
(
struct
xdr_stream
*
xdr
,
uint32_t
bitmap
)
{
{
uint32_t
*
p
;
uint32_t
*
p
;
...
@@ -617,8 +603,7 @@ encode_getattr_one(struct xdr_stream *xdr, uint32_t bitmap)
...
@@ -617,8 +603,7 @@ encode_getattr_one(struct xdr_stream *xdr, uint32_t bitmap)
return
0
;
return
0
;
}
}
static
int
static
int
encode_getattr_two
(
struct
xdr_stream
*
xdr
,
uint32_t
bm0
,
uint32_t
bm1
)
encode_getattr_two
(
struct
xdr_stream
*
xdr
,
uint32_t
bm0
,
uint32_t
bm1
)
{
{
uint32_t
*
p
;
uint32_t
*
p
;
...
@@ -639,15 +624,7 @@ static int encode_getfattr(struct xdr_stream *xdr, const u32* bitmask)
...
@@ -639,15 +624,7 @@ static int encode_getfattr(struct xdr_stream *xdr, const u32* bitmask)
bitmask
[
1
]
&
nfs4_fattr_bitmap
[
1
]);
bitmask
[
1
]
&
nfs4_fattr_bitmap
[
1
]);
}
}
static
inline
int
static
int
encode_fsinfo
(
struct
xdr_stream
*
xdr
)
encode_getattr
(
struct
xdr_stream
*
xdr
,
struct
nfs4_getattr
*
getattr
)
{
return
encode_getattr_two
(
xdr
,
getattr
->
gt_bmval
[
0
],
getattr
->
gt_bmval
[
1
]);
}
static
int
encode_fsinfo
(
struct
xdr_stream
*
xdr
)
{
{
return
encode_getattr_one
(
xdr
,
FATTR4_WORD0_MAXFILESIZE
return
encode_getattr_one
(
xdr
,
FATTR4_WORD0_MAXFILESIZE
|
FATTR4_WORD0_MAXREAD
|
FATTR4_WORD0_MAXREAD
...
@@ -655,8 +632,7 @@ encode_fsinfo(struct xdr_stream *xdr)
...
@@ -655,8 +632,7 @@ encode_fsinfo(struct xdr_stream *xdr)
|
FATTR4_WORD0_LEASE_TIME
);
|
FATTR4_WORD0_LEASE_TIME
);
}
}
static
int
static
int
encode_getfh
(
struct
xdr_stream
*
xdr
)
encode_getfh
(
struct
xdr_stream
*
xdr
)
{
{
uint32_t
*
p
;
uint32_t
*
p
;
...
@@ -682,8 +658,7 @@ static int encode_link(struct xdr_stream *xdr, const struct qstr *name)
...
@@ -682,8 +658,7 @@ static int encode_link(struct xdr_stream *xdr, const struct qstr *name)
* opcode,type,reclaim,offset,length,new_lock_owner = 32
* opcode,type,reclaim,offset,length,new_lock_owner = 32
* open_seqid,open_stateid,lock_seqid,lock_owner.clientid, lock_owner.id = 40
* open_seqid,open_stateid,lock_seqid,lock_owner.clientid, lock_owner.id = 40
*/
*/
static
int
static
int
encode_lock
(
struct
xdr_stream
*
xdr
,
const
struct
nfs_lockargs
*
arg
)
encode_lock
(
struct
xdr_stream
*
xdr
,
struct
nfs_lockargs
*
arg
)
{
{
uint32_t
*
p
;
uint32_t
*
p
;
struct
nfs_lock_opargs
*
opargs
=
arg
->
u
.
lock
;
struct
nfs_lock_opargs
*
opargs
=
arg
->
u
.
lock
;
...
@@ -717,8 +692,7 @@ encode_lock(struct xdr_stream *xdr, struct nfs_lockargs *arg)
...
@@ -717,8 +692,7 @@ encode_lock(struct xdr_stream *xdr, struct nfs_lockargs *arg)
return
0
;
return
0
;
}
}
static
int
static
int
encode_lockt
(
struct
xdr_stream
*
xdr
,
const
struct
nfs_lockargs
*
arg
)
encode_lockt
(
struct
xdr_stream
*
xdr
,
struct
nfs_lockargs
*
arg
)
{
{
uint32_t
*
p
;
uint32_t
*
p
;
struct
nfs_lowner
*
opargs
=
arg
->
u
.
lockt
;
struct
nfs_lowner
*
opargs
=
arg
->
u
.
lockt
;
...
@@ -735,8 +709,7 @@ encode_lockt(struct xdr_stream *xdr, struct nfs_lockargs *arg)
...
@@ -735,8 +709,7 @@ encode_lockt(struct xdr_stream *xdr, struct nfs_lockargs *arg)
return
0
;
return
0
;
}
}
static
int
static
int
encode_locku
(
struct
xdr_stream
*
xdr
,
const
struct
nfs_lockargs
*
arg
)
encode_locku
(
struct
xdr_stream
*
xdr
,
struct
nfs_lockargs
*
arg
)
{
{
uint32_t
*
p
;
uint32_t
*
p
;
struct
nfs_locku_opargs
*
opargs
=
arg
->
u
.
locku
;
struct
nfs_locku_opargs
*
opargs
=
arg
->
u
.
locku
;
...
@@ -765,8 +738,7 @@ static int encode_lookup(struct xdr_stream *xdr, const struct qstr *name)
...
@@ -765,8 +738,7 @@ static int encode_lookup(struct xdr_stream *xdr, const struct qstr *name)
return
0
;
return
0
;
}
}
static
int
static
int
encode_open
(
struct
xdr_stream
*
xdr
,
const
struct
nfs_openargs
*
arg
)
encode_open
(
struct
xdr_stream
*
xdr
,
struct
nfs_openargs
*
arg
)
{
{
int
status
;
int
status
;
uint32_t
*
p
;
uint32_t
*
p
;
...
@@ -825,8 +797,7 @@ encode_open(struct xdr_stream *xdr, struct nfs_openargs *arg)
...
@@ -825,8 +797,7 @@ encode_open(struct xdr_stream *xdr, struct nfs_openargs *arg)
return
0
;
return
0
;
}
}
static
int
static
int
encode_open_confirm
(
struct
xdr_stream
*
xdr
,
const
struct
nfs_open_confirmargs
*
arg
)
encode_open_confirm
(
struct
xdr_stream
*
xdr
,
struct
nfs_open_confirmargs
*
arg
)
{
{
uint32_t
*
p
;
uint32_t
*
p
;
...
@@ -839,8 +810,7 @@ encode_open_confirm(struct xdr_stream *xdr, struct nfs_open_confirmargs *arg)
...
@@ -839,8 +810,7 @@ encode_open_confirm(struct xdr_stream *xdr, struct nfs_open_confirmargs *arg)
}
}
static
int
static
int
encode_open_reclaim
(
struct
xdr_stream
*
xdr
,
const
struct
nfs_open_reclaimargs
*
arg
)
encode_open_reclaim
(
struct
xdr_stream
*
xdr
,
struct
nfs_open_reclaimargs
*
arg
)
{
{
uint32_t
*
p
;
uint32_t
*
p
;
...
@@ -874,8 +844,7 @@ encode_open_reclaim(struct xdr_stream *xdr, struct nfs_open_reclaimargs *arg)
...
@@ -874,8 +844,7 @@ encode_open_reclaim(struct xdr_stream *xdr, struct nfs_open_reclaimargs *arg)
return
0
;
return
0
;
}
}
static
int
static
int
encode_open_downgrade
(
struct
xdr_stream
*
xdr
,
const
struct
nfs_closeargs
*
arg
)
encode_open_downgrade
(
struct
xdr_stream
*
xdr
,
struct
nfs_closeargs
*
arg
)
{
{
uint32_t
*
p
;
uint32_t
*
p
;
...
@@ -904,8 +873,7 @@ encode_putfh(struct xdr_stream *xdr, const struct nfs_fh *fh)
...
@@ -904,8 +873,7 @@ encode_putfh(struct xdr_stream *xdr, const struct nfs_fh *fh)
return
0
;
return
0
;
}
}
static
int
static
int
encode_putrootfh
(
struct
xdr_stream
*
xdr
)
encode_putrootfh
(
struct
xdr_stream
*
xdr
)
{
{
uint32_t
*
p
;
uint32_t
*
p
;
...
@@ -915,8 +883,7 @@ encode_putrootfh(struct xdr_stream *xdr)
...
@@ -915,8 +883,7 @@ encode_putrootfh(struct xdr_stream *xdr)
return
0
;
return
0
;
}
}
static
void
static
void
encode_stateid
(
struct
xdr_stream
*
xdr
,
struct
nfs4_state
*
state
,
fl_owner_t
lockowner
)
encode_stateid
(
struct
xdr_stream
*
xdr
,
struct
nfs4_state
*
state
,
fl_owner_t
lockowner
)
{
{
extern
nfs4_stateid
zero_stateid
;
extern
nfs4_stateid
zero_stateid
;
nfs4_stateid
stateid
;
nfs4_stateid
stateid
;
...
@@ -930,8 +897,7 @@ encode_stateid(struct xdr_stream *xdr, struct nfs4_state *state, fl_owner_t lock
...
@@ -930,8 +897,7 @@ encode_stateid(struct xdr_stream *xdr, struct nfs4_state *state, fl_owner_t lock
WRITEMEM
(
zero_stateid
.
data
,
sizeof
(
zero_stateid
.
data
));
WRITEMEM
(
zero_stateid
.
data
,
sizeof
(
zero_stateid
.
data
));
}
}
static
int
static
int
encode_read
(
struct
xdr_stream
*
xdr
,
const
struct
nfs_readargs
*
args
)
encode_read
(
struct
xdr_stream
*
xdr
,
struct
nfs_readargs
*
args
)
{
{
uint32_t
*
p
;
uint32_t
*
p
;
...
@@ -1021,8 +987,7 @@ static int encode_rename(struct xdr_stream *xdr, const struct qstr *oldname, con
...
@@ -1021,8 +987,7 @@ static int encode_rename(struct xdr_stream *xdr, const struct qstr *oldname, con
return
0
;
return
0
;
}
}
static
int
static
int
encode_renew
(
struct
xdr_stream
*
xdr
,
const
struct
nfs4_client
*
client_stateid
)
encode_renew
(
struct
xdr_stream
*
xdr
,
struct
nfs4_client
*
client_stateid
)
{
{
uint32_t
*
p
;
uint32_t
*
p
;
...
@@ -1033,17 +998,6 @@ encode_renew(struct xdr_stream *xdr, struct nfs4_client *client_stateid)
...
@@ -1033,17 +998,6 @@ encode_renew(struct xdr_stream *xdr, struct nfs4_client *client_stateid)
return
0
;
return
0
;
}
}
static
int
encode_restorefh
(
struct
xdr_stream
*
xdr
)
{
uint32_t
*
p
;
RESERVE_SPACE
(
4
);
WRITE32
(
OP_RESTOREFH
);
return
0
;
}
static
int
static
int
encode_savefh
(
struct
xdr_stream
*
xdr
)
encode_savefh
(
struct
xdr_stream
*
xdr
)
{
{
...
@@ -1055,9 +1009,7 @@ encode_savefh(struct xdr_stream *xdr)
...
@@ -1055,9 +1009,7 @@ encode_savefh(struct xdr_stream *xdr)
return
0
;
return
0
;
}
}
static
int
static
int
encode_setattr
(
struct
xdr_stream
*
xdr
,
const
struct
nfs_setattrargs
*
arg
,
const
struct
nfs_server
*
server
)
encode_setattr
(
struct
xdr_stream
*
xdr
,
struct
nfs_setattrargs
*
arg
,
struct
nfs_server
*
server
)
{
{
int
status
;
int
status
;
uint32_t
*
p
;
uint32_t
*
p
;
...
@@ -1072,8 +1024,7 @@ encode_setattr(struct xdr_stream *xdr, struct nfs_setattrargs *arg,
...
@@ -1072,8 +1024,7 @@ encode_setattr(struct xdr_stream *xdr, struct nfs_setattrargs *arg,
return
0
;
return
0
;
}
}
static
int
static
int
encode_setclientid
(
struct
xdr_stream
*
xdr
,
const
struct
nfs4_setclientid
*
setclientid
)
encode_setclientid
(
struct
xdr_stream
*
xdr
,
struct
nfs4_setclientid
*
setclientid
)
{
{
uint32_t
total_len
;
uint32_t
total_len
;
uint32_t
len1
,
len2
,
len3
;
uint32_t
len1
,
len2
,
len3
;
...
@@ -1100,8 +1051,7 @@ encode_setclientid(struct xdr_stream *xdr, struct nfs4_setclientid *setclientid)
...
@@ -1100,8 +1051,7 @@ encode_setclientid(struct xdr_stream *xdr, struct nfs4_setclientid *setclientid)
return
0
;
return
0
;
}
}
static
int
static
int
encode_setclientid_confirm
(
struct
xdr_stream
*
xdr
,
const
struct
nfs4_client
*
client_state
)
encode_setclientid_confirm
(
struct
xdr_stream
*
xdr
,
struct
nfs4_client
*
client_state
)
{
{
uint32_t
*
p
;
uint32_t
*
p
;
...
@@ -1113,8 +1063,7 @@ encode_setclientid_confirm(struct xdr_stream *xdr, struct nfs4_client *client_st
...
@@ -1113,8 +1063,7 @@ encode_setclientid_confirm(struct xdr_stream *xdr, struct nfs4_client *client_st
return
0
;
return
0
;
}
}
static
int
static
int
encode_write
(
struct
xdr_stream
*
xdr
,
const
struct
nfs_writeargs
*
args
)
encode_write
(
struct
xdr_stream
*
xdr
,
struct
nfs_writeargs
*
args
)
{
{
uint32_t
*
p
;
uint32_t
*
p
;
...
@@ -1310,8 +1259,7 @@ static int nfs4_xdr_enc_getattr(struct rpc_rqst *req, uint32_t *p, const struct
...
@@ -1310,8 +1259,7 @@ static int nfs4_xdr_enc_getattr(struct rpc_rqst *req, uint32_t *p, const struct
/*
/*
* Encode a CLOSE request
* Encode a CLOSE request
*/
*/
static
int
static
int
nfs4_xdr_enc_close
(
struct
rpc_rqst
*
req
,
uint32_t
*
p
,
struct
nfs_closeargs
*
args
)
nfs4_xdr_enc_close
(
struct
rpc_rqst
*
req
,
uint32_t
*
p
,
struct
nfs_closeargs
*
args
)
{
{
struct
xdr_stream
xdr
;
struct
xdr_stream
xdr
;
struct
compound_hdr
hdr
=
{
struct
compound_hdr
hdr
=
{
...
@@ -1332,36 +1280,26 @@ nfs4_xdr_enc_close(struct rpc_rqst *req, uint32_t *p, struct nfs_closeargs *args
...
@@ -1332,36 +1280,26 @@ nfs4_xdr_enc_close(struct rpc_rqst *req, uint32_t *p, struct nfs_closeargs *args
/*
/*
* Encode an OPEN request
* Encode an OPEN request
*/
*/
static
int
static
int
nfs4_xdr_enc_open
(
struct
rpc_rqst
*
req
,
uint32_t
*
p
,
struct
nfs_openargs
*
args
)
nfs4_xdr_enc_open
(
struct
rpc_rqst
*
req
,
uint32_t
*
p
,
struct
nfs_openargs
*
args
)
{
{
struct
xdr_stream
xdr
;
struct
xdr_stream
xdr
;
struct
compound_hdr
hdr
=
{
struct
compound_hdr
hdr
=
{
.
nops
=
7
,
.
nops
=
4
,
};
};
int
status
;
int
status
;
xdr_init_encode
(
&
xdr
,
&
req
->
rq_snd_buf
,
p
);
xdr_init_encode
(
&
xdr
,
&
req
->
rq_snd_buf
,
p
);
encode_compound_hdr
(
&
xdr
,
&
hdr
);
encode_compound_hdr
(
&
xdr
,
&
hdr
);
status
=
encode_putfh
(
&
xdr
,
args
->
fh
);
status
=
encode_putfh
(
&
xdr
,
args
->
fh
);
if
(
status
)
goto
out
;
status
=
encode_savefh
(
&
xdr
);
if
(
status
)
if
(
status
)
goto
out
;
goto
out
;
status
=
encode_open
(
&
xdr
,
args
);
status
=
encode_open
(
&
xdr
,
args
);
if
(
status
)
if
(
status
)
goto
out
;
goto
out
;
status
=
encode_get
attr
(
&
xdr
,
args
->
f_getattr
);
status
=
encode_get
fattr
(
&
xdr
,
args
->
bitmask
);
if
(
status
)
if
(
status
)
goto
out
;
goto
out
;
status
=
encode_getfh
(
&
xdr
);
status
=
encode_getfh
(
&
xdr
);
if
(
status
)
goto
out
;
status
=
encode_restorefh
(
&
xdr
);
if
(
status
)
goto
out
;
status
=
encode_getattr
(
&
xdr
,
args
->
d_getattr
);
out:
out:
return
status
;
return
status
;
}
}
...
@@ -1369,8 +1307,7 @@ nfs4_xdr_enc_open(struct rpc_rqst *req, uint32_t *p, struct nfs_openargs *args)
...
@@ -1369,8 +1307,7 @@ nfs4_xdr_enc_open(struct rpc_rqst *req, uint32_t *p, struct nfs_openargs *args)
/*
/*
* Encode an OPEN_CONFIRM request
* Encode an OPEN_CONFIRM request
*/
*/
static
int
static
int
nfs4_xdr_enc_open_confirm
(
struct
rpc_rqst
*
req
,
uint32_t
*
p
,
struct
nfs_open_confirmargs
*
args
)
nfs4_xdr_enc_open_confirm
(
struct
rpc_rqst
*
req
,
uint32_t
*
p
,
struct
nfs_open_confirmargs
*
args
)
{
{
struct
xdr_stream
xdr
;
struct
xdr_stream
xdr
;
struct
compound_hdr
hdr
=
{
struct
compound_hdr
hdr
=
{
...
@@ -1391,9 +1328,7 @@ nfs4_xdr_enc_open_confirm(struct rpc_rqst *req, uint32_t *p, struct nfs_open_con
...
@@ -1391,9 +1328,7 @@ nfs4_xdr_enc_open_confirm(struct rpc_rqst *req, uint32_t *p, struct nfs_open_con
/*
/*
* Encode an OPEN request
* Encode an OPEN request
*/
*/
static
int
static
int
nfs4_xdr_enc_open_reclaim
(
struct
rpc_rqst
*
req
,
uint32_t
*
p
,
struct
nfs_open_reclaimargs
*
args
)
nfs4_xdr_enc_open_reclaim
(
struct
rpc_rqst
*
req
,
uint32_t
*
p
,
struct
nfs_open_reclaimargs
*
args
)
{
{
struct
xdr_stream
xdr
;
struct
xdr_stream
xdr
;
struct
compound_hdr
hdr
=
{
struct
compound_hdr
hdr
=
{
...
@@ -1409,7 +1344,7 @@ nfs4_xdr_enc_open_reclaim(struct rpc_rqst *req, uint32_t *p,
...
@@ -1409,7 +1344,7 @@ nfs4_xdr_enc_open_reclaim(struct rpc_rqst *req, uint32_t *p,
status
=
encode_open_reclaim
(
&
xdr
,
args
);
status
=
encode_open_reclaim
(
&
xdr
,
args
);
if
(
status
)
if
(
status
)
goto
out
;
goto
out
;
status
=
encode_get
attr
(
&
xdr
,
args
->
f_getattr
);
status
=
encode_get
fattr
(
&
xdr
,
args
->
bitmask
);
out:
out:
return
status
;
return
status
;
}
}
...
@@ -1417,8 +1352,7 @@ nfs4_xdr_enc_open_reclaim(struct rpc_rqst *req, uint32_t *p,
...
@@ -1417,8 +1352,7 @@ nfs4_xdr_enc_open_reclaim(struct rpc_rqst *req, uint32_t *p,
/*
/*
* Encode an OPEN_DOWNGRADE request
* Encode an OPEN_DOWNGRADE request
*/
*/
static
int
static
int
nfs4_xdr_enc_open_downgrade
(
struct
rpc_rqst
*
req
,
uint32_t
*
p
,
struct
nfs_closeargs
*
args
)
nfs4_xdr_enc_open_downgrade
(
struct
rpc_rqst
*
req
,
uint32_t
*
p
,
struct
nfs_closeargs
*
args
)
{
{
struct
xdr_stream
xdr
;
struct
xdr_stream
xdr
;
struct
compound_hdr
hdr
=
{
struct
compound_hdr
hdr
=
{
...
@@ -1439,8 +1373,7 @@ nfs4_xdr_enc_open_downgrade(struct rpc_rqst *req, uint32_t *p, struct nfs_closea
...
@@ -1439,8 +1373,7 @@ nfs4_xdr_enc_open_downgrade(struct rpc_rqst *req, uint32_t *p, struct nfs_closea
/*
/*
* Encode a LOCK request
* Encode a LOCK request
*/
*/
static
int
static
int
nfs4_xdr_enc_lock
(
struct
rpc_rqst
*
req
,
uint32_t
*
p
,
struct
nfs_lockargs
*
args
)
nfs4_xdr_enc_lock
(
struct
rpc_rqst
*
req
,
uint32_t
*
p
,
struct
nfs_lockargs
*
args
)
{
{
struct
xdr_stream
xdr
;
struct
xdr_stream
xdr
;
struct
compound_hdr
hdr
=
{
struct
compound_hdr
hdr
=
{
...
@@ -1461,8 +1394,7 @@ nfs4_xdr_enc_lock(struct rpc_rqst *req, uint32_t *p, struct nfs_lockargs *args)
...
@@ -1461,8 +1394,7 @@ nfs4_xdr_enc_lock(struct rpc_rqst *req, uint32_t *p, struct nfs_lockargs *args)
/*
/*
* Encode a LOCKT request
* Encode a LOCKT request
*/
*/
static
int
static
int
nfs4_xdr_enc_lockt
(
struct
rpc_rqst
*
req
,
uint32_t
*
p
,
struct
nfs_lockargs
*
args
)
nfs4_xdr_enc_lockt
(
struct
rpc_rqst
*
req
,
uint32_t
*
p
,
struct
nfs_lockargs
*
args
)
{
{
struct
xdr_stream
xdr
;
struct
xdr_stream
xdr
;
struct
compound_hdr
hdr
=
{
struct
compound_hdr
hdr
=
{
...
@@ -1483,8 +1415,7 @@ nfs4_xdr_enc_lockt(struct rpc_rqst *req, uint32_t *p, struct nfs_lockargs *args)
...
@@ -1483,8 +1415,7 @@ nfs4_xdr_enc_lockt(struct rpc_rqst *req, uint32_t *p, struct nfs_lockargs *args)
/*
/*
* Encode a LOCKU request
* Encode a LOCKU request
*/
*/
static
int
static
int
nfs4_xdr_enc_locku
(
struct
rpc_rqst
*
req
,
uint32_t
*
p
,
struct
nfs_lockargs
*
args
)
nfs4_xdr_enc_locku
(
struct
rpc_rqst
*
req
,
uint32_t
*
p
,
struct
nfs_lockargs
*
args
)
{
{
struct
xdr_stream
xdr
;
struct
xdr_stream
xdr
;
struct
compound_hdr
hdr
=
{
struct
compound_hdr
hdr
=
{
...
@@ -1547,8 +1478,7 @@ static int nfs4_xdr_enc_readdir(struct rpc_rqst *req, uint32_t *p, const struct
...
@@ -1547,8 +1478,7 @@ static int nfs4_xdr_enc_readdir(struct rpc_rqst *req, uint32_t *p, const struct
/*
/*
* Encode a READ request
* Encode a READ request
*/
*/
static
int
static
int
nfs4_xdr_enc_read
(
struct
rpc_rqst
*
req
,
uint32_t
*
p
,
struct
nfs_readargs
*
args
)
nfs4_xdr_enc_read
(
struct
rpc_rqst
*
req
,
uint32_t
*
p
,
struct
nfs_readargs
*
args
)
{
{
struct
rpc_auth
*
auth
=
req
->
rq_task
->
tk_auth
;
struct
rpc_auth
*
auth
=
req
->
rq_task
->
tk_auth
;
struct
xdr_stream
xdr
;
struct
xdr_stream
xdr
;
...
@@ -1580,8 +1510,7 @@ nfs4_xdr_enc_read(struct rpc_rqst *req, uint32_t *p, struct nfs_readargs *args)
...
@@ -1580,8 +1510,7 @@ nfs4_xdr_enc_read(struct rpc_rqst *req, uint32_t *p, struct nfs_readargs *args)
/*
/*
* Encode an SETATTR request
* Encode an SETATTR request
*/
*/
static
int
static
int
nfs4_xdr_enc_setattr
(
struct
rpc_rqst
*
req
,
uint32_t
*
p
,
struct
nfs_setattrargs
*
args
)
nfs4_xdr_enc_setattr
(
struct
rpc_rqst
*
req
,
uint32_t
*
p
,
struct
nfs_setattrargs
*
args
)
{
{
struct
xdr_stream
xdr
;
struct
xdr_stream
xdr
;
...
@@ -1598,7 +1527,7 @@ nfs4_xdr_enc_setattr(struct rpc_rqst *req, uint32_t *p, struct nfs_setattrargs *
...
@@ -1598,7 +1527,7 @@ nfs4_xdr_enc_setattr(struct rpc_rqst *req, uint32_t *p, struct nfs_setattrargs *
status
=
encode_setattr
(
&
xdr
,
args
,
args
->
server
);
status
=
encode_setattr
(
&
xdr
,
args
,
args
->
server
);
if
(
status
)
if
(
status
)
goto
out
;
goto
out
;
status
=
encode_getattr
(
&
xdr
,
args
->
attr
);
status
=
encode_getfattr
(
&
xdr
,
args
->
bitmask
);
out:
out:
return
status
;
return
status
;
}
}
...
@@ -1606,8 +1535,7 @@ nfs4_xdr_enc_setattr(struct rpc_rqst *req, uint32_t *p, struct nfs_setattrargs *
...
@@ -1606,8 +1535,7 @@ nfs4_xdr_enc_setattr(struct rpc_rqst *req, uint32_t *p, struct nfs_setattrargs *
/*
/*
* Encode a WRITE request
* Encode a WRITE request
*/
*/
static
int
static
int
nfs4_xdr_enc_write
(
struct
rpc_rqst
*
req
,
uint32_t
*
p
,
struct
nfs_writeargs
*
args
)
nfs4_xdr_enc_write
(
struct
rpc_rqst
*
req
,
uint32_t
*
p
,
struct
nfs_writeargs
*
args
)
{
{
struct
xdr_stream
xdr
;
struct
xdr_stream
xdr
;
struct
compound_hdr
hdr
=
{
struct
compound_hdr
hdr
=
{
...
@@ -1628,8 +1556,7 @@ nfs4_xdr_enc_write(struct rpc_rqst *req, uint32_t *p, struct nfs_writeargs *args
...
@@ -1628,8 +1556,7 @@ nfs4_xdr_enc_write(struct rpc_rqst *req, uint32_t *p, struct nfs_writeargs *args
/*
/*
* a COMMIT request
* a COMMIT request
*/
*/
static
int
static
int
nfs4_xdr_enc_commit
(
struct
rpc_rqst
*
req
,
uint32_t
*
p
,
struct
nfs_writeargs
*
args
)
nfs4_xdr_enc_commit
(
struct
rpc_rqst
*
req
,
uint32_t
*
p
,
struct
nfs_writeargs
*
args
)
{
{
struct
xdr_stream
xdr
;
struct
xdr_stream
xdr
;
struct
compound_hdr
hdr
=
{
struct
compound_hdr
hdr
=
{
...
@@ -1650,8 +1577,7 @@ nfs4_xdr_enc_commit(struct rpc_rqst *req, uint32_t *p, struct nfs_writeargs *arg
...
@@ -1650,8 +1577,7 @@ nfs4_xdr_enc_commit(struct rpc_rqst *req, uint32_t *p, struct nfs_writeargs *arg
/*
/*
* FSINFO request
* FSINFO request
*/
*/
static
int
static
int
nfs4_xdr_enc_fsinfo
(
struct
rpc_rqst
*
req
,
uint32_t
*
p
,
void
*
fhandle
)
nfs4_xdr_enc_fsinfo
(
struct
rpc_rqst
*
req
,
uint32_t
*
p
,
void
*
fhandle
)
{
{
struct
xdr_stream
xdr
;
struct
xdr_stream
xdr
;
struct
compound_hdr
hdr
=
{
struct
compound_hdr
hdr
=
{
...
@@ -1713,8 +1639,7 @@ static int nfs4_xdr_enc_statfs(struct rpc_rqst *req, uint32_t *p, const struct n
...
@@ -1713,8 +1639,7 @@ static int nfs4_xdr_enc_statfs(struct rpc_rqst *req, uint32_t *p, const struct n
/*
/*
* a RENEW request
* a RENEW request
*/
*/
static
int
static
int
nfs4_xdr_enc_renew
(
struct
rpc_rqst
*
req
,
uint32_t
*
p
,
struct
nfs4_client
*
clp
)
nfs4_xdr_enc_renew
(
struct
rpc_rqst
*
req
,
uint32_t
*
p
,
struct
nfs4_client
*
clp
)
{
{
struct
xdr_stream
xdr
;
struct
xdr_stream
xdr
;
struct
compound_hdr
hdr
=
{
struct
compound_hdr
hdr
=
{
...
@@ -1729,9 +1654,7 @@ nfs4_xdr_enc_renew(struct rpc_rqst *req, uint32_t *p, struct nfs4_client *clp)
...
@@ -1729,9 +1654,7 @@ nfs4_xdr_enc_renew(struct rpc_rqst *req, uint32_t *p, struct nfs4_client *clp)
/*
/*
* a SETCLIENTID request
* a SETCLIENTID request
*/
*/
static
int
static
int
nfs4_xdr_enc_setclientid
(
struct
rpc_rqst
*
req
,
uint32_t
*
p
,
struct
nfs4_setclientid
*
sc
)
nfs4_xdr_enc_setclientid
(
struct
rpc_rqst
*
req
,
uint32_t
*
p
,
struct
nfs4_setclientid
*
sc
)
{
{
struct
xdr_stream
xdr
;
struct
xdr_stream
xdr
;
struct
compound_hdr
hdr
=
{
struct
compound_hdr
hdr
=
{
...
@@ -1746,9 +1669,7 @@ nfs4_xdr_enc_setclientid(struct rpc_rqst *req, uint32_t *p,
...
@@ -1746,9 +1669,7 @@ nfs4_xdr_enc_setclientid(struct rpc_rqst *req, uint32_t *p,
/*
/*
* a SETCLIENTID_CONFIRM request
* a SETCLIENTID_CONFIRM request
*/
*/
static
int
static
int
nfs4_xdr_enc_setclientid_confirm
(
struct
rpc_rqst
*
req
,
uint32_t
*
p
,
struct
nfs4_client
*
clp
)
nfs4_xdr_enc_setclientid_confirm
(
struct
rpc_rqst
*
req
,
uint32_t
*
p
,
struct
nfs4_client
*
clp
)
{
{
struct
xdr_stream
xdr
;
struct
xdr_stream
xdr
;
struct
compound_hdr
hdr
=
{
struct
compound_hdr
hdr
=
{
...
@@ -1776,15 +1697,6 @@ nfs4_xdr_enc_setclientid_confirm(struct rpc_rqst *req, uint32_t *p,
...
@@ -1776,15 +1697,6 @@ nfs4_xdr_enc_setclientid_confirm(struct rpc_rqst *req, uint32_t *p,
* task to translate them into Linux-specific versions which are more
* task to translate them into Linux-specific versions which are more
* consistent with the style used in NFSv2/v3...
* consistent with the style used in NFSv2/v3...
*/
*/
#define DECODE_TAIL \
status = 0; \
out: \
return status; \
xdr_error: \
printk(KERN_NOTICE "xdr error! (%s:%d)\n", __FILE__, __LINE__); \
status = -EIO; \
goto out
#define READ32(x) (x) = ntohl(*p++)
#define READ32(x) (x) = ntohl(*p++)
#define READ64(x) do { \
#define READ64(x) do { \
(x) = (u64)ntohl(*p++) << 32; \
(x) = (u64)ntohl(*p++) << 32; \
...
@@ -1809,8 +1721,7 @@ xdr_error: \
...
@@ -1809,8 +1721,7 @@ xdr_error: \
} \
} \
} while (0)
} while (0)
static
int
static
int
decode_compound_hdr
(
struct
xdr_stream
*
xdr
,
struct
compound_hdr
*
hdr
)
decode_compound_hdr
(
struct
xdr_stream
*
xdr
,
struct
compound_hdr
*
hdr
)
{
{
uint32_t
*
p
;
uint32_t
*
p
;
...
@@ -1825,8 +1736,7 @@ decode_compound_hdr(struct xdr_stream *xdr, struct compound_hdr *hdr)
...
@@ -1825,8 +1736,7 @@ decode_compound_hdr(struct xdr_stream *xdr, struct compound_hdr *hdr)
return
0
;
return
0
;
}
}
static
int
static
int
decode_op_hdr
(
struct
xdr_stream
*
xdr
,
enum
nfs_opnum4
expected
)
decode_op_hdr
(
struct
xdr_stream
*
xdr
,
enum
nfs_opnum4
expected
)
{
{
uint32_t
*
p
;
uint32_t
*
p
;
uint32_t
opnum
;
uint32_t
opnum
;
...
@@ -2297,8 +2207,7 @@ static int verify_attr_len(struct xdr_stream *xdr, uint32_t *savep, uint32_t att
...
@@ -2297,8 +2207,7 @@ static int verify_attr_len(struct xdr_stream *xdr, uint32_t *savep, uint32_t att
return
0
;
return
0
;
}
}
static
int
static
int
decode_change_info
(
struct
xdr_stream
*
xdr
,
struct
nfs4_change_info
*
cinfo
)
decode_change_info
(
struct
xdr_stream
*
xdr
,
struct
nfs4_change_info
*
cinfo
)
{
{
uint32_t
*
p
;
uint32_t
*
p
;
...
@@ -2326,8 +2235,7 @@ static int decode_access(struct xdr_stream *xdr, struct nfs4_accessres *access)
...
@@ -2326,8 +2235,7 @@ static int decode_access(struct xdr_stream *xdr, struct nfs4_accessres *access)
return
0
;
return
0
;
}
}
static
int
static
int
decode_close
(
struct
xdr_stream
*
xdr
,
struct
nfs_closeres
*
res
)
decode_close
(
struct
xdr_stream
*
xdr
,
struct
nfs_closeres
*
res
)
{
{
uint32_t
*
p
;
uint32_t
*
p
;
int
status
;
int
status
;
...
@@ -2340,8 +2248,7 @@ decode_close(struct xdr_stream *xdr, struct nfs_closeres *res)
...
@@ -2340,8 +2248,7 @@ decode_close(struct xdr_stream *xdr, struct nfs_closeres *res)
return
0
;
return
0
;
}
}
static
int
static
int
decode_commit
(
struct
xdr_stream
*
xdr
,
struct
nfs_writeres
*
res
)
decode_commit
(
struct
xdr_stream
*
xdr
,
struct
nfs_writeres
*
res
)
{
{
uint32_t
*
p
;
uint32_t
*
p
;
int
status
;
int
status
;
...
@@ -2371,184 +2278,6 @@ static int decode_create(struct xdr_stream *xdr, struct nfs4_change_info *cinfo)
...
@@ -2371,184 +2278,6 @@ static int decode_create(struct xdr_stream *xdr, struct nfs4_change_info *cinfo)
return
0
;
return
0
;
}
}
static
int
decode_getattr
(
struct
xdr_stream
*
xdr
,
struct
nfs4_getattr
*
getattr
,
struct
nfs_server
*
server
)
{
struct
nfs_fattr
*
nfp
=
getattr
->
gt_attrs
;
uint32_t
attrlen
,
dummy32
,
bmlen
,
bmval0
=
0
,
bmval1
=
0
,
len
=
0
;
uint32_t
*
p
;
unsigned
int
type
;
int
fmode
=
0
;
int
status
;
status
=
decode_op_hdr
(
xdr
,
OP_GETATTR
);
if
(
status
)
return
status
;
READ_BUF
(
4
);
READ32
(
bmlen
);
if
(
bmlen
>
2
)
goto
xdr_error
;
READ_BUF
((
bmlen
<<
2
)
+
4
);
if
(
bmlen
>
0
)
READ32
(
bmval0
);
if
(
bmlen
>
1
)
READ32
(
bmval1
);
READ32
(
attrlen
);
if
((
bmval0
&
~
getattr
->
gt_bmval
[
0
])
||
(
bmval1
&
~
getattr
->
gt_bmval
[
1
]))
{
dprintk
(
"read_attrs: server returned bad attributes!
\n
"
);
goto
xdr_error
;
}
if
(
nfp
)
{
nfp
->
bitmap
[
0
]
=
bmval0
;
nfp
->
bitmap
[
1
]
=
bmval1
;
}
/*
* In case the server doesn't return some attributes,
* we initialize them here to some nominal values..
*/
if
(
nfp
)
{
nfp
->
valid
=
NFS_ATTR_FATTR
|
NFS_ATTR_FATTR_V3
|
NFS_ATTR_FATTR_V4
;
nfp
->
nlink
=
1
;
nfp
->
timestamp
=
jiffies
;
}
if
(
bmval0
&
FATTR4_WORD0_TYPE
)
{
READ_BUF
(
4
);
len
+=
4
;
READ32
(
type
);
if
(
type
<
NF4REG
||
type
>
NF4NAMEDATTR
)
{
dprintk
(
"read_attrs: bad type %d
\n
"
,
type
);
goto
xdr_error
;
}
nfp
->
type
=
nfs_type2fmt
[
type
].
nfs2type
;
fmode
=
nfs_type2fmt
[
type
].
mode
;
dprintk
(
"read_attrs: type=%d
\n
"
,
(
uint32_t
)
nfp
->
type
);
}
if
(
bmval0
&
FATTR4_WORD0_CHANGE
)
{
READ_BUF
(
8
);
len
+=
8
;
READ64
(
nfp
->
change_attr
);
dprintk
(
"read_attrs: changeid=%Ld
\n
"
,
(
long
long
)
nfp
->
change_attr
);
}
if
(
bmval0
&
FATTR4_WORD0_SIZE
)
{
READ_BUF
(
8
);
len
+=
8
;
READ64
(
nfp
->
size
);
dprintk
(
"read_attrs: size=%Ld
\n
"
,
(
long
long
)
nfp
->
size
);
}
if
(
bmval0
&
FATTR4_WORD0_FSID
)
{
READ_BUF
(
16
);
len
+=
16
;
READ64
(
nfp
->
fsid_u
.
nfs4
.
major
);
READ64
(
nfp
->
fsid_u
.
nfs4
.
minor
);
dprintk
(
"read_attrs: fsid=0x%Lx/0x%Lx
\n
"
,
(
long
long
)
nfp
->
fsid_u
.
nfs4
.
major
,
(
long
long
)
nfp
->
fsid_u
.
nfs4
.
minor
);
}
if
(
bmval0
&
FATTR4_WORD0_FILEID
)
{
READ_BUF
(
8
);
len
+=
8
;
READ64
(
nfp
->
fileid
);
dprintk
(
"read_attrs: fileid=%Ld
\n
"
,
(
long
long
)
nfp
->
fileid
);
}
if
(
bmval1
&
FATTR4_WORD1_MODE
)
{
READ_BUF
(
4
);
len
+=
4
;
READ32
(
dummy32
);
nfp
->
mode
=
(
dummy32
&
~
S_IFMT
)
|
fmode
;
dprintk
(
"read_attrs: mode=0%o
\n
"
,
nfp
->
mode
);
}
if
(
bmval1
&
FATTR4_WORD1_NUMLINKS
)
{
READ_BUF
(
4
);
len
+=
4
;
READ32
(
nfp
->
nlink
);
dprintk
(
"read_attrs: nlinks=0%o
\n
"
,
nfp
->
nlink
);
}
if
(
bmval1
&
FATTR4_WORD1_OWNER
)
{
READ_BUF
(
4
);
len
+=
4
;
READ32
(
dummy32
);
/* name length */
if
(
dummy32
>
XDR_MAX_NETOBJ
)
{
dprintk
(
"read_attrs: name too long!
\n
"
);
goto
xdr_error
;
}
READ_BUF
(
dummy32
);
len
+=
(
XDR_QUADLEN
(
dummy32
)
<<
2
);
if
((
status
=
nfs_map_name_to_uid
(
server
->
nfs4_state
,
(
char
*
)
p
,
dummy32
,
&
nfp
->
uid
))
<
0
)
{
dprintk
(
"read_attrs: name-to-uid mapping failed!
\n
"
);
nfp
->
uid
=
-
2
;
}
dprintk
(
"read_attrs: uid=%d
\n
"
,
(
int
)
nfp
->
uid
);
}
if
(
bmval1
&
FATTR4_WORD1_OWNER_GROUP
)
{
READ_BUF
(
4
);
len
+=
4
;
READ32
(
dummy32
);
if
(
dummy32
>
XDR_MAX_NETOBJ
)
{
dprintk
(
"read_attrs: name too long!
\n
"
);
goto
xdr_error
;
}
READ_BUF
(
dummy32
);
len
+=
(
XDR_QUADLEN
(
dummy32
)
<<
2
);
if
((
status
=
nfs_map_group_to_gid
(
server
->
nfs4_state
,
(
char
*
)
p
,
dummy32
,
&
nfp
->
gid
))
<
0
)
{
dprintk
(
"read_attrs: group-to-gid mapping failed!
\n
"
);
nfp
->
gid
=
-
2
;
}
dprintk
(
"read_attrs: gid=%d
\n
"
,
(
int
)
nfp
->
gid
);
}
if
(
bmval1
&
FATTR4_WORD1_RAWDEV
)
{
uint32_t
major
,
minor
;
READ_BUF
(
8
);
len
+=
8
;
READ32
(
major
);
READ32
(
minor
);
nfp
->
rdev
=
MKDEV
(
major
,
minor
);
if
(
MAJOR
(
nfp
->
rdev
)
!=
major
||
MINOR
(
nfp
->
rdev
)
!=
minor
)
nfp
->
rdev
=
0
;
dprintk
(
"read_attrs: rdev=%u:%u
\n
"
,
major
,
minor
);
}
if
(
bmval1
&
FATTR4_WORD1_SPACE_USED
)
{
READ_BUF
(
8
);
len
+=
8
;
READ64
(
nfp
->
du
.
nfs3
.
used
);
dprintk
(
"read_attrs: sused=0x%Lx
\n
"
,
(
long
long
)
nfp
->
du
.
nfs3
.
used
);
}
if
(
bmval1
&
FATTR4_WORD1_TIME_ACCESS
)
{
READ_BUF
(
12
);
len
+=
12
;
READTIME
(
nfp
->
atime
);
dprintk
(
"read_attrs: atime=%ld
\n
"
,
(
long
)
nfp
->
atime
.
tv_sec
);
}
if
(
bmval1
&
FATTR4_WORD1_TIME_METADATA
)
{
READ_BUF
(
12
);
len
+=
12
;
READTIME
(
nfp
->
ctime
);
dprintk
(
"read_attrs: ctime=%ld
\n
"
,
(
long
)
nfp
->
ctime
.
tv_sec
);
}
if
(
bmval1
&
FATTR4_WORD1_TIME_MODIFY
)
{
READ_BUF
(
12
);
len
+=
12
;
READTIME
(
nfp
->
mtime
);
dprintk
(
"read_attrs: mtime=%ld
\n
"
,
(
long
)
nfp
->
mtime
.
tv_sec
);
}
if
(
len
!=
attrlen
)
goto
xdr_error
;
DECODE_TAIL
;
}
static
int
decode_statfs
(
struct
xdr_stream
*
xdr
,
struct
nfs_fsstat
*
fsstat
)
static
int
decode_statfs
(
struct
xdr_stream
*
xdr
,
struct
nfs_fsstat
*
fsstat
)
{
{
uint32_t
*
savep
;
uint32_t
*
savep
;
...
@@ -2672,8 +2401,7 @@ static int decode_getfattr(struct xdr_stream *xdr, struct nfs_fattr *fattr, cons
...
@@ -2672,8 +2401,7 @@ static int decode_getfattr(struct xdr_stream *xdr, struct nfs_fattr *fattr, cons
}
}
static
int
static
int
decode_fsinfo
(
struct
xdr_stream
*
xdr
,
struct
nfs_fsinfo
*
fsinfo
)
decode_fsinfo
(
struct
xdr_stream
*
xdr
,
struct
nfs_fsinfo
*
fsinfo
)
{
{
uint32_t
*
p
;
uint32_t
*
p
;
uint32_t
len
,
attrlen
,
bmlen
,
bmval0
=
0
,
bmval1
=
0
;
uint32_t
len
,
attrlen
,
bmlen
,
bmval0
=
0
,
bmval1
=
0
;
...
@@ -2775,8 +2503,7 @@ static int decode_link(struct xdr_stream *xdr, struct nfs4_change_info *cinfo)
...
@@ -2775,8 +2503,7 @@ static int decode_link(struct xdr_stream *xdr, struct nfs4_change_info *cinfo)
/*
/*
* We create the owner, so we know a proper owner.id length is 4.
* We create the owner, so we know a proper owner.id length is 4.
*/
*/
static
int
static
int
decode_lock_denied
(
struct
xdr_stream
*
xdr
,
struct
nfs_lock_denied
*
denied
)
decode_lock_denied
(
struct
xdr_stream
*
xdr
,
struct
nfs_lock_denied
*
denied
)
{
{
uint32_t
*
p
;
uint32_t
*
p
;
uint32_t
namelen
;
uint32_t
namelen
;
...
@@ -2793,8 +2520,7 @@ decode_lock_denied (struct xdr_stream *xdr, struct nfs_lock_denied *denied)
...
@@ -2793,8 +2520,7 @@ decode_lock_denied (struct xdr_stream *xdr, struct nfs_lock_denied *denied)
return
-
NFS4ERR_DENIED
;
return
-
NFS4ERR_DENIED
;
}
}
static
int
static
int
decode_lock
(
struct
xdr_stream
*
xdr
,
struct
nfs_lockres
*
res
)
decode_lock
(
struct
xdr_stream
*
xdr
,
struct
nfs_lockres
*
res
)
{
{
uint32_t
*
p
;
uint32_t
*
p
;
int
status
;
int
status
;
...
@@ -2808,8 +2534,7 @@ decode_lock(struct xdr_stream *xdr, struct nfs_lockres *res)
...
@@ -2808,8 +2534,7 @@ decode_lock(struct xdr_stream *xdr, struct nfs_lockres *res)
return
status
;
return
status
;
}
}
static
int
static
int
decode_lockt
(
struct
xdr_stream
*
xdr
,
struct
nfs_lockres
*
res
)
decode_lockt
(
struct
xdr_stream
*
xdr
,
struct
nfs_lockres
*
res
)
{
{
int
status
;
int
status
;
status
=
decode_op_hdr
(
xdr
,
OP_LOCKT
);
status
=
decode_op_hdr
(
xdr
,
OP_LOCKT
);
...
@@ -2818,8 +2543,7 @@ decode_lockt(struct xdr_stream *xdr, struct nfs_lockres *res)
...
@@ -2818,8 +2543,7 @@ decode_lockt(struct xdr_stream *xdr, struct nfs_lockres *res)
return
status
;
return
status
;
}
}
static
int
static
int
decode_locku
(
struct
xdr_stream
*
xdr
,
struct
nfs_lockres
*
res
)
decode_locku
(
struct
xdr_stream
*
xdr
,
struct
nfs_lockres
*
res
)
{
{
uint32_t
*
p
;
uint32_t
*
p
;
int
status
;
int
status
;
...
@@ -2832,14 +2556,12 @@ decode_locku(struct xdr_stream *xdr, struct nfs_lockres *res)
...
@@ -2832,14 +2556,12 @@ decode_locku(struct xdr_stream *xdr, struct nfs_lockres *res)
return
status
;
return
status
;
}
}
static
int
static
int
decode_lookup
(
struct
xdr_stream
*
xdr
)
decode_lookup
(
struct
xdr_stream
*
xdr
)
{
{
return
decode_op_hdr
(
xdr
,
OP_LOOKUP
);
return
decode_op_hdr
(
xdr
,
OP_LOOKUP
);
}
}
static
int
static
int
decode_open
(
struct
xdr_stream
*
xdr
,
struct
nfs_openres
*
res
)
decode_open
(
struct
xdr_stream
*
xdr
,
struct
nfs_openres
*
res
)
{
{
uint32_t
*
p
;
uint32_t
*
p
;
uint32_t
bmlen
,
delegation_type
;
uint32_t
bmlen
,
delegation_type
;
...
@@ -2851,7 +2573,7 @@ decode_open(struct xdr_stream *xdr, struct nfs_openres *res)
...
@@ -2851,7 +2573,7 @@ decode_open(struct xdr_stream *xdr, struct nfs_openres *res)
READ_BUF
(
sizeof
(
res
->
stateid
.
data
));
READ_BUF
(
sizeof
(
res
->
stateid
.
data
));
COPYMEM
(
res
->
stateid
.
data
,
sizeof
(
res
->
stateid
.
data
));
COPYMEM
(
res
->
stateid
.
data
,
sizeof
(
res
->
stateid
.
data
));
decode_change_info
(
xdr
,
res
->
cinfo
);
decode_change_info
(
xdr
,
&
res
->
cinfo
);
READ_BUF
(
8
);
READ_BUF
(
8
);
READ32
(
res
->
rflags
);
READ32
(
res
->
rflags
);
...
@@ -2862,14 +2584,14 @@ decode_open(struct xdr_stream *xdr, struct nfs_openres *res)
...
@@ -2862,14 +2584,14 @@ decode_open(struct xdr_stream *xdr, struct nfs_openres *res)
READ_BUF
((
bmlen
<<
2
)
+
4
);
READ_BUF
((
bmlen
<<
2
)
+
4
);
p
+=
bmlen
;
p
+=
bmlen
;
READ32
(
delegation_type
);
READ32
(
delegation_type
);
if
(
delegation_type
!=
NFS4_OPEN_DELEGATE_NONE
)
if
(
delegation_type
==
NFS4_OPEN_DELEGATE_NONE
)
goto
xdr_error
;
return
0
;
xdr_error:
DECODE_TAIL
;
printk
(
KERN_NOTICE
"%s: xdr error!
\n
"
,
__FUNCTION__
);
return
-
EIO
;
}
}
static
int
static
int
decode_open_confirm
(
struct
xdr_stream
*
xdr
,
struct
nfs_open_confirmres
*
res
)
decode_open_confirm
(
struct
xdr_stream
*
xdr
,
struct
nfs_open_confirmres
*
res
)
{
{
uint32_t
*
p
;
uint32_t
*
p
;
int
status
;
int
status
;
...
@@ -2882,8 +2604,7 @@ decode_open_confirm(struct xdr_stream *xdr, struct nfs_open_confirmres *res)
...
@@ -2882,8 +2604,7 @@ decode_open_confirm(struct xdr_stream *xdr, struct nfs_open_confirmres *res)
return
0
;
return
0
;
}
}
static
int
static
int
decode_open_downgrade
(
struct
xdr_stream
*
xdr
,
struct
nfs_closeres
*
res
)
decode_open_downgrade
(
struct
xdr_stream
*
xdr
,
struct
nfs_closeres
*
res
)
{
{
uint32_t
*
p
;
uint32_t
*
p
;
int
status
;
int
status
;
...
@@ -2896,20 +2617,17 @@ decode_open_downgrade(struct xdr_stream *xdr, struct nfs_closeres *res)
...
@@ -2896,20 +2617,17 @@ decode_open_downgrade(struct xdr_stream *xdr, struct nfs_closeres *res)
return
0
;
return
0
;
}
}
static
int
static
int
decode_putfh
(
struct
xdr_stream
*
xdr
)
decode_putfh
(
struct
xdr_stream
*
xdr
)
{
{
return
decode_op_hdr
(
xdr
,
OP_PUTFH
);
return
decode_op_hdr
(
xdr
,
OP_PUTFH
);
}
}
static
int
static
int
decode_putrootfh
(
struct
xdr_stream
*
xdr
)
decode_putrootfh
(
struct
xdr_stream
*
xdr
)
{
{
return
decode_op_hdr
(
xdr
,
OP_PUTROOTFH
);
return
decode_op_hdr
(
xdr
,
OP_PUTROOTFH
);
}
}
static
int
static
int
decode_read
(
struct
xdr_stream
*
xdr
,
struct
rpc_rqst
*
req
,
struct
nfs_readres
*
res
)
decode_read
(
struct
xdr_stream
*
xdr
,
struct
rpc_rqst
*
req
,
struct
nfs_readres
*
res
)
{
{
struct
iovec
*
iov
=
req
->
rq_rvec
;
struct
iovec
*
iov
=
req
->
rq_rvec
;
uint32_t
*
p
;
uint32_t
*
p
;
...
@@ -3061,12 +2779,6 @@ static int decode_readlink(struct xdr_stream *xdr, struct rpc_rqst *req)
...
@@ -3061,12 +2779,6 @@ static int decode_readlink(struct xdr_stream *xdr, struct rpc_rqst *req)
return
0
;
return
0
;
}
}
static
int
decode_restorefh
(
struct
xdr_stream
*
xdr
)
{
return
decode_op_hdr
(
xdr
,
OP_RESTOREFH
);
}
static
int
decode_remove
(
struct
xdr_stream
*
xdr
,
struct
nfs4_change_info
*
cinfo
)
static
int
decode_remove
(
struct
xdr_stream
*
xdr
,
struct
nfs4_change_info
*
cinfo
)
{
{
int
status
;
int
status
;
...
@@ -3094,8 +2806,7 @@ static int decode_rename(struct xdr_stream *xdr, struct nfs4_change_info *old_ci
...
@@ -3094,8 +2806,7 @@ static int decode_rename(struct xdr_stream *xdr, struct nfs4_change_info *old_ci
return
status
;
return
status
;
}
}
static
int
static
int
decode_renew
(
struct
xdr_stream
*
xdr
)
decode_renew
(
struct
xdr_stream
*
xdr
)
{
{
return
decode_op_hdr
(
xdr
,
OP_RENEW
);
return
decode_op_hdr
(
xdr
,
OP_RENEW
);
}
}
...
@@ -3106,8 +2817,7 @@ decode_savefh(struct xdr_stream *xdr)
...
@@ -3106,8 +2817,7 @@ decode_savefh(struct xdr_stream *xdr)
return
decode_op_hdr
(
xdr
,
OP_SAVEFH
);
return
decode_op_hdr
(
xdr
,
OP_SAVEFH
);
}
}
static
int
static
int
decode_setattr
(
struct
xdr_stream
*
xdr
,
struct
nfs_setattrres
*
res
)
decode_setattr
(
struct
xdr_stream
*
xdr
,
struct
nfs_setattrres
*
res
)
{
{
uint32_t
*
p
;
uint32_t
*
p
;
uint32_t
bmlen
;
uint32_t
bmlen
;
...
@@ -3123,8 +2833,7 @@ decode_setattr(struct xdr_stream *xdr, struct nfs_setattrres *res)
...
@@ -3123,8 +2833,7 @@ decode_setattr(struct xdr_stream *xdr, struct nfs_setattrres *res)
return
0
;
return
0
;
}
}
static
int
static
int
decode_setclientid
(
struct
xdr_stream
*
xdr
,
struct
nfs4_client
*
clp
)
decode_setclientid
(
struct
xdr_stream
*
xdr
,
struct
nfs4_client
*
clp
)
{
{
uint32_t
*
p
;
uint32_t
*
p
;
uint32_t
opnum
;
uint32_t
opnum
;
...
@@ -3162,14 +2871,12 @@ decode_setclientid(struct xdr_stream *xdr, struct nfs4_client *clp)
...
@@ -3162,14 +2871,12 @@ decode_setclientid(struct xdr_stream *xdr, struct nfs4_client *clp)
return
0
;
return
0
;
}
}
static
int
static
int
decode_setclientid_confirm
(
struct
xdr_stream
*
xdr
)
decode_setclientid_confirm
(
struct
xdr_stream
*
xdr
)
{
{
return
decode_op_hdr
(
xdr
,
OP_SETCLIENTID_CONFIRM
);
return
decode_op_hdr
(
xdr
,
OP_SETCLIENTID_CONFIRM
);
}
}
static
int
static
int
decode_write
(
struct
xdr_stream
*
xdr
,
struct
nfs_writeres
*
res
)
decode_write
(
struct
xdr_stream
*
xdr
,
struct
nfs_writeres
*
res
)
{
{
uint32_t
*
p
;
uint32_t
*
p
;
int
status
;
int
status
;
...
@@ -3188,8 +2895,7 @@ decode_write(struct xdr_stream *xdr, struct nfs_writeres *res)
...
@@ -3188,8 +2895,7 @@ decode_write(struct xdr_stream *xdr, struct nfs_writeres *res)
/*
/*
* Decode OPEN_DOWNGRADE response
* Decode OPEN_DOWNGRADE response
*/
*/
static
int
static
int
nfs4_xdr_dec_open_downgrade
(
struct
rpc_rqst
*
rqstp
,
uint32_t
*
p
,
struct
nfs_closeres
*
res
)
nfs4_xdr_dec_open_downgrade
(
struct
rpc_rqst
*
rqstp
,
uint32_t
*
p
,
struct
nfs_closeres
*
res
)
{
{
struct
xdr_stream
xdr
;
struct
xdr_stream
xdr
;
struct
compound_hdr
hdr
;
struct
compound_hdr
hdr
;
...
@@ -3385,8 +3091,7 @@ static int nfs4_xdr_dec_getattr(struct rpc_rqst *rqstp, uint32_t *p, struct nfs4
...
@@ -3385,8 +3091,7 @@ static int nfs4_xdr_dec_getattr(struct rpc_rqst *rqstp, uint32_t *p, struct nfs4
/*
/*
* Decode CLOSE response
* Decode CLOSE response
*/
*/
static
int
static
int
nfs4_xdr_dec_close
(
struct
rpc_rqst
*
rqstp
,
uint32_t
*
p
,
struct
nfs_closeres
*
res
)
nfs4_xdr_dec_close
(
struct
rpc_rqst
*
rqstp
,
uint32_t
*
p
,
struct
nfs_closeres
*
res
)
{
{
struct
xdr_stream
xdr
;
struct
xdr_stream
xdr
;
struct
compound_hdr
hdr
;
struct
compound_hdr
hdr
;
...
@@ -3407,8 +3112,7 @@ nfs4_xdr_dec_close(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_closeres *res
...
@@ -3407,8 +3112,7 @@ nfs4_xdr_dec_close(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_closeres *res
/*
/*
* Decode OPEN response
* Decode OPEN response
*/
*/
static
int
static
int
nfs4_xdr_dec_open
(
struct
rpc_rqst
*
rqstp
,
uint32_t
*
p
,
struct
nfs_openres
*
res
)
nfs4_xdr_dec_open
(
struct
rpc_rqst
*
rqstp
,
uint32_t
*
p
,
struct
nfs_openres
*
res
)
{
{
struct
xdr_stream
xdr
;
struct
xdr_stream
xdr
;
struct
compound_hdr
hdr
;
struct
compound_hdr
hdr
;
...
@@ -3419,26 +3123,15 @@ nfs4_xdr_dec_open(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_openres *res)
...
@@ -3419,26 +3123,15 @@ nfs4_xdr_dec_open(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_openres *res)
if
(
status
)
if
(
status
)
goto
out
;
goto
out
;
status
=
decode_putfh
(
&
xdr
);
status
=
decode_putfh
(
&
xdr
);
if
(
status
)
goto
out
;
status
=
decode_savefh
(
&
xdr
);
if
(
status
)
if
(
status
)
goto
out
;
goto
out
;
status
=
decode_open
(
&
xdr
,
res
);
status
=
decode_open
(
&
xdr
,
res
);
if
(
status
)
if
(
status
)
goto
out
;
goto
out
;
status
=
decode_getattr
(
&
xdr
,
res
->
f_get
attr
,
res
->
server
);
status
=
decode_getfattr
(
&
xdr
,
res
->
f_
attr
,
res
->
server
);
if
(
status
)
if
(
status
)
goto
out
;
goto
out
;
status
=
decode_getfh
(
&
xdr
,
&
res
->
fh
);
status
=
decode_getfh
(
&
xdr
,
&
res
->
fh
);
if
(
status
)
goto
out
;
status
=
decode_restorefh
(
&
xdr
);
if
(
status
)
goto
out
;
status
=
decode_getattr
(
&
xdr
,
res
->
d_getattr
,
res
->
server
);
if
(
status
)
goto
out
;
out:
out:
return
status
;
return
status
;
}
}
...
@@ -3446,8 +3139,7 @@ nfs4_xdr_dec_open(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_openres *res)
...
@@ -3446,8 +3139,7 @@ nfs4_xdr_dec_open(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_openres *res)
/*
/*
* Decode OPEN_CONFIRM response
* Decode OPEN_CONFIRM response
*/
*/
static
int
static
int
nfs4_xdr_dec_open_confirm
(
struct
rpc_rqst
*
rqstp
,
uint32_t
*
p
,
struct
nfs_open_confirmres
*
res
)
nfs4_xdr_dec_open_confirm
(
struct
rpc_rqst
*
rqstp
,
uint32_t
*
p
,
struct
nfs_open_confirmres
*
res
)
{
{
struct
xdr_stream
xdr
;
struct
xdr_stream
xdr
;
struct
compound_hdr
hdr
;
struct
compound_hdr
hdr
;
...
@@ -3468,8 +3160,7 @@ nfs4_xdr_dec_open_confirm(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_open_c
...
@@ -3468,8 +3160,7 @@ nfs4_xdr_dec_open_confirm(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_open_c
/*
/*
* Decode OPEN_RECLAIM response
* Decode OPEN_RECLAIM response
*/
*/
static
int
static
int
nfs4_xdr_dec_open_reclaim
(
struct
rpc_rqst
*
rqstp
,
uint32_t
*
p
,
struct
nfs_openres
*
res
)
nfs4_xdr_dec_open_reclaim
(
struct
rpc_rqst
*
rqstp
,
uint32_t
*
p
,
struct
nfs_openres
*
res
)
{
{
struct
xdr_stream
xdr
;
struct
xdr_stream
xdr
;
struct
compound_hdr
hdr
;
struct
compound_hdr
hdr
;
...
@@ -3485,7 +3176,7 @@ nfs4_xdr_dec_open_reclaim(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_openre
...
@@ -3485,7 +3176,7 @@ nfs4_xdr_dec_open_reclaim(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_openre
status
=
decode_open
(
&
xdr
,
res
);
status
=
decode_open
(
&
xdr
,
res
);
if
(
status
)
if
(
status
)
goto
out
;
goto
out
;
status
=
decode_getattr
(
&
xdr
,
res
->
f_get
attr
,
res
->
server
);
status
=
decode_getfattr
(
&
xdr
,
res
->
f_
attr
,
res
->
server
);
out:
out:
return
status
;
return
status
;
}
}
...
@@ -3493,8 +3184,7 @@ nfs4_xdr_dec_open_reclaim(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_openre
...
@@ -3493,8 +3184,7 @@ nfs4_xdr_dec_open_reclaim(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_openre
/*
/*
* Decode SETATTR response
* Decode SETATTR response
*/
*/
static
int
static
int
nfs4_xdr_dec_setattr
(
struct
rpc_rqst
*
rqstp
,
uint32_t
*
p
,
struct
nfs_setattrres
*
res
)
nfs4_xdr_dec_setattr
(
struct
rpc_rqst
*
rqstp
,
uint32_t
*
p
,
struct
nfs_setattrres
*
res
)
{
{
struct
xdr_stream
xdr
;
struct
xdr_stream
xdr
;
struct
compound_hdr
hdr
;
struct
compound_hdr
hdr
;
...
@@ -3510,7 +3200,7 @@ nfs4_xdr_dec_setattr(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_setattrres
...
@@ -3510,7 +3200,7 @@ nfs4_xdr_dec_setattr(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_setattrres
status
=
decode_setattr
(
&
xdr
,
res
);
status
=
decode_setattr
(
&
xdr
,
res
);
if
(
status
)
if
(
status
)
goto
out
;
goto
out
;
status
=
decode_getattr
(
&
xdr
,
res
->
attr
,
res
->
server
);
status
=
decode_getfattr
(
&
xdr
,
res
->
f
attr
,
res
->
server
);
out:
out:
return
status
;
return
status
;
}
}
...
@@ -3518,8 +3208,7 @@ nfs4_xdr_dec_setattr(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_setattrres
...
@@ -3518,8 +3208,7 @@ nfs4_xdr_dec_setattr(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_setattrres
/*
/*
* Decode LOCK response
* Decode LOCK response
*/
*/
static
int
static
int
nfs4_xdr_dec_lock
(
struct
rpc_rqst
*
rqstp
,
uint32_t
*
p
,
struct
nfs_lockres
*
res
)
nfs4_xdr_dec_lock
(
struct
rpc_rqst
*
rqstp
,
uint32_t
*
p
,
struct
nfs_lockres
*
res
)
{
{
struct
xdr_stream
xdr
;
struct
xdr_stream
xdr
;
struct
compound_hdr
hdr
;
struct
compound_hdr
hdr
;
...
@@ -3540,8 +3229,7 @@ nfs4_xdr_dec_lock(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_lockres *res)
...
@@ -3540,8 +3229,7 @@ nfs4_xdr_dec_lock(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_lockres *res)
/*
/*
* Decode LOCKT response
* Decode LOCKT response
*/
*/
static
int
static
int
nfs4_xdr_dec_lockt
(
struct
rpc_rqst
*
rqstp
,
uint32_t
*
p
,
struct
nfs_lockres
*
res
)
nfs4_xdr_dec_lockt
(
struct
rpc_rqst
*
rqstp
,
uint32_t
*
p
,
struct
nfs_lockres
*
res
)
{
{
struct
xdr_stream
xdr
;
struct
xdr_stream
xdr
;
struct
compound_hdr
hdr
;
struct
compound_hdr
hdr
;
...
@@ -3562,8 +3250,7 @@ nfs4_xdr_dec_lockt(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_lockres *res)
...
@@ -3562,8 +3250,7 @@ nfs4_xdr_dec_lockt(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_lockres *res)
/*
/*
* Decode LOCKU response
* Decode LOCKU response
*/
*/
static
int
static
int
nfs4_xdr_dec_locku
(
struct
rpc_rqst
*
rqstp
,
uint32_t
*
p
,
struct
nfs_lockres
*
res
)
nfs4_xdr_dec_locku
(
struct
rpc_rqst
*
rqstp
,
uint32_t
*
p
,
struct
nfs_lockres
*
res
)
{
{
struct
xdr_stream
xdr
;
struct
xdr_stream
xdr
;
struct
compound_hdr
hdr
;
struct
compound_hdr
hdr
;
...
@@ -3626,8 +3313,7 @@ static int nfs4_xdr_dec_readdir(struct rpc_rqst *rqstp, uint32_t *p, struct nfs4
...
@@ -3626,8 +3313,7 @@ static int nfs4_xdr_dec_readdir(struct rpc_rqst *rqstp, uint32_t *p, struct nfs4
/*
/*
* Decode Read response
* Decode Read response
*/
*/
static
int
static
int
nfs4_xdr_dec_read
(
struct
rpc_rqst
*
rqstp
,
uint32_t
*
p
,
struct
nfs_readres
*
res
)
nfs4_xdr_dec_read
(
struct
rpc_rqst
*
rqstp
,
uint32_t
*
p
,
struct
nfs_readres
*
res
)
{
{
struct
xdr_stream
xdr
;
struct
xdr_stream
xdr
;
struct
compound_hdr
hdr
;
struct
compound_hdr
hdr
;
...
@@ -3650,8 +3336,7 @@ nfs4_xdr_dec_read(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_readres *res)
...
@@ -3650,8 +3336,7 @@ nfs4_xdr_dec_read(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_readres *res)
/*
/*
* Decode WRITE response
* Decode WRITE response
*/
*/
static
int
static
int
nfs4_xdr_dec_write
(
struct
rpc_rqst
*
rqstp
,
uint32_t
*
p
,
struct
nfs_writeres
*
res
)
nfs4_xdr_dec_write
(
struct
rpc_rqst
*
rqstp
,
uint32_t
*
p
,
struct
nfs_writeres
*
res
)
{
{
struct
xdr_stream
xdr
;
struct
xdr_stream
xdr
;
struct
compound_hdr
hdr
;
struct
compound_hdr
hdr
;
...
@@ -3674,8 +3359,7 @@ nfs4_xdr_dec_write(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_writeres *res
...
@@ -3674,8 +3359,7 @@ nfs4_xdr_dec_write(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_writeres *res
/*
/*
* Decode COMMIT response
* Decode COMMIT response
*/
*/
static
int
static
int
nfs4_xdr_dec_commit
(
struct
rpc_rqst
*
rqstp
,
uint32_t
*
p
,
struct
nfs_writeres
*
res
)
nfs4_xdr_dec_commit
(
struct
rpc_rqst
*
rqstp
,
uint32_t
*
p
,
struct
nfs_writeres
*
res
)
{
{
struct
xdr_stream
xdr
;
struct
xdr_stream
xdr
;
struct
compound_hdr
hdr
;
struct
compound_hdr
hdr
;
...
@@ -3696,8 +3380,7 @@ nfs4_xdr_dec_commit(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_writeres *re
...
@@ -3696,8 +3380,7 @@ nfs4_xdr_dec_commit(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_writeres *re
/*
/*
* FSINFO request
* FSINFO request
*/
*/
static
int
static
int
nfs4_xdr_dec_fsinfo
(
struct
rpc_rqst
*
req
,
uint32_t
*
p
,
struct
nfs_fsinfo
*
fsinfo
)
nfs4_xdr_dec_fsinfo
(
struct
rpc_rqst
*
req
,
uint32_t
*
p
,
struct
nfs_fsinfo
*
fsinfo
)
{
{
struct
xdr_stream
xdr
;
struct
xdr_stream
xdr
;
struct
compound_hdr
hdr
;
struct
compound_hdr
hdr
;
...
@@ -3753,8 +3436,7 @@ static int nfs4_xdr_dec_statfs(struct rpc_rqst *req, uint32_t *p, struct nfs_fss
...
@@ -3753,8 +3436,7 @@ static int nfs4_xdr_dec_statfs(struct rpc_rqst *req, uint32_t *p, struct nfs_fss
/*
/*
* Decode RENEW response
* Decode RENEW response
*/
*/
static
int
static
int
nfs4_xdr_dec_renew
(
struct
rpc_rqst
*
rqstp
,
uint32_t
*
p
,
void
*
dummy
)
nfs4_xdr_dec_renew
(
struct
rpc_rqst
*
rqstp
,
uint32_t
*
p
,
void
*
dummy
)
{
{
struct
xdr_stream
xdr
;
struct
xdr_stream
xdr
;
struct
compound_hdr
hdr
;
struct
compound_hdr
hdr
;
...
@@ -3770,8 +3452,7 @@ nfs4_xdr_dec_renew(struct rpc_rqst *rqstp, uint32_t *p, void *dummy)
...
@@ -3770,8 +3452,7 @@ nfs4_xdr_dec_renew(struct rpc_rqst *rqstp, uint32_t *p, void *dummy)
/*
/*
* a SETCLIENTID request
* a SETCLIENTID request
*/
*/
static
int
static
int
nfs4_xdr_dec_setclientid
(
struct
rpc_rqst
*
req
,
uint32_t
*
p
,
nfs4_xdr_dec_setclientid
(
struct
rpc_rqst
*
req
,
uint32_t
*
p
,
struct
nfs4_client
*
clp
)
struct
nfs4_client
*
clp
)
{
{
struct
xdr_stream
xdr
;
struct
xdr_stream
xdr
;
...
@@ -3790,8 +3471,7 @@ nfs4_xdr_dec_setclientid(struct rpc_rqst *req, uint32_t *p,
...
@@ -3790,8 +3471,7 @@ nfs4_xdr_dec_setclientid(struct rpc_rqst *req, uint32_t *p,
/*
/*
* a SETCLIENTID_CONFIRM request
* a SETCLIENTID_CONFIRM request
*/
*/
static
int
static
int
nfs4_xdr_dec_setclientid_confirm
(
struct
rpc_rqst
*
req
,
uint32_t
*
p
,
struct
nfs_fsinfo
*
fsinfo
)
nfs4_xdr_dec_setclientid_confirm
(
struct
rpc_rqst
*
req
,
uint32_t
*
p
,
struct
nfs_fsinfo
*
fsinfo
)
{
{
struct
xdr_stream
xdr
;
struct
xdr_stream
xdr
;
struct
compound_hdr
hdr
;
struct
compound_hdr
hdr
;
...
@@ -3810,8 +3490,7 @@ nfs4_xdr_dec_setclientid_confirm(struct rpc_rqst *req, uint32_t *p, struct nfs_f
...
@@ -3810,8 +3490,7 @@ nfs4_xdr_dec_setclientid_confirm(struct rpc_rqst *req, uint32_t *p, struct nfs_f
return
status
;
return
status
;
}
}
uint32_t
*
uint32_t
*
nfs4_decode_dirent
(
uint32_t
*
p
,
struct
nfs_entry
*
entry
,
int
plus
)
nfs4_decode_dirent
(
uint32_t
*
p
,
struct
nfs_entry
*
entry
,
int
plus
)
{
{
uint32_t
len
;
uint32_t
len
;
...
...
include/linux/nfs_xdr.h
View file @
ea6cacaf
...
@@ -89,6 +89,12 @@ struct nfs_pathconf {
...
@@ -89,6 +89,12 @@ struct nfs_pathconf {
__u32
max_namelen
;
/* max name length */
__u32
max_namelen
;
/* max name length */
};
};
struct
nfs4_change_info
{
u32
atomic
;
u64
before
;
u64
after
;
};
/*
/*
* Arguments to the open call.
* Arguments to the open call.
*/
*/
...
@@ -104,20 +110,18 @@ struct nfs_openargs {
...
@@ -104,20 +110,18 @@ struct nfs_openargs {
struct
iattr
*
attrs
;
/* UNCHECKED, GUARDED */
struct
iattr
*
attrs
;
/* UNCHECKED, GUARDED */
nfs4_verifier
verifier
;
/* EXCLUSIVE */
nfs4_verifier
verifier
;
/* EXCLUSIVE */
}
u
;
}
u
;
struct
qstr
*
name
;
const
struct
qstr
*
name
;
struct
nfs4_getattr
*
f_getattr
;
const
struct
nfs_server
*
server
;
/* Needed for ID mapping */
struct
nfs4_getattr
*
d_getattr
;
const
u32
*
bitmask
;
struct
nfs_server
*
server
;
/* Needed for ID mapping */
};
};
struct
nfs_openres
{
struct
nfs_openres
{
nfs4_stateid
stateid
;
nfs4_stateid
stateid
;
struct
nfs_fh
fh
;
struct
nfs_fh
fh
;
struct
nfs4_change_info
*
cinfo
;
struct
nfs4_change_info
cinfo
;
__u32
rflags
;
__u32
rflags
;
struct
nfs4_getattr
*
f_getattr
;
struct
nfs_fattr
*
f_attr
;
struct
nfs4_getattr
*
d_getattr
;
const
struct
nfs_server
*
server
;
struct
nfs_server
*
server
;
};
};
/*
/*
...
@@ -143,7 +147,7 @@ struct nfs_open_reclaimargs {
...
@@ -143,7 +147,7 @@ struct nfs_open_reclaimargs {
__u32
id
;
__u32
id
;
__u32
share_access
;
__u32
share_access
;
__u32
claim
;
__u32
claim
;
struct
nfs4_getattr
*
f_getattr
;
const
__u32
*
bitmask
;
};
};
/*
/*
...
@@ -217,7 +221,7 @@ struct nfs_lockres {
...
@@ -217,7 +221,7 @@ struct nfs_lockres {
nfs4_stateid
stateid
;
/* LOCK success, LOCKU */
nfs4_stateid
stateid
;
/* LOCK success, LOCKU */
struct
nfs_lock_denied
denied
;
/* LOCK failed, LOCKT success */
struct
nfs_lock_denied
denied
;
/* LOCK failed, LOCKT success */
}
u
;
}
u
;
struct
nfs_server
*
server
;
const
struct
nfs_server
*
server
;
};
};
/*
/*
...
@@ -323,13 +327,13 @@ struct nfs_setattrargs {
...
@@ -323,13 +327,13 @@ struct nfs_setattrargs {
struct
nfs_fh
*
fh
;
struct
nfs_fh
*
fh
;
nfs4_stateid
stateid
;
nfs4_stateid
stateid
;
struct
iattr
*
iap
;
struct
iattr
*
iap
;
struct
nfs4_getattr
*
attr
;
const
struct
nfs_server
*
server
;
/* Needed for name mapping */
struct
nfs_server
*
server
;
/* Needed for name mapping */
const
u32
*
bitmask
;
};
};
struct
nfs_setattrres
{
struct
nfs_setattrres
{
struct
nfs
4_getattr
*
attr
;
struct
nfs
_fattr
*
f
attr
;
struct
nfs_server
*
server
;
const
struct
nfs_server
*
server
;
};
};
struct
nfs_linkargs
{
struct
nfs_linkargs
{
...
@@ -480,12 +484,6 @@ struct nfs3_readdirres {
...
@@ -480,12 +484,6 @@ struct nfs3_readdirres {
typedef
u64
clientid4
;
typedef
u64
clientid4
;
struct
nfs4_change_info
{
u32
atomic
;
u64
before
;
u64
after
;
};
struct
nfs4_accessargs
{
struct
nfs4_accessargs
{
const
struct
nfs_fh
*
fh
;
const
struct
nfs_fh
*
fh
;
u32
access
;
u32
access
;
...
@@ -519,12 +517,6 @@ struct nfs4_create_res {
...
@@ -519,12 +517,6 @@ struct nfs4_create_res {
struct
nfs4_change_info
dir_cinfo
;
struct
nfs4_change_info
dir_cinfo
;
};
};
struct
nfs4_getattr
{
u32
*
gt_bmval
;
/* request */
struct
nfs_fattr
*
gt_attrs
;
/* response */
struct
nfs_fsstat
*
gt_fsstat
;
/* response */
};
struct
nfs4_getattr_arg
{
struct
nfs4_getattr_arg
{
const
struct
nfs_fh
*
fh
;
const
struct
nfs_fh
*
fh
;
const
u32
*
bitmask
;
const
u32
*
bitmask
;
...
...
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