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
nexedi
linux
Commits
16e42959
Commit
16e42959
authored
Oct 27, 2005
by
Trond Myklebust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NFSv4: Add post-op attributes to nfs4_proc_remove()
Signed-off-by:
Trond Myklebust
<
Trond.Myklebust@netapp.com
>
parent
6caf2c82
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
14 deletions
+45
-14
fs/nfs/nfs4proc.c
fs/nfs/nfs4proc.c
+21
-6
fs/nfs/nfs4xdr.c
fs/nfs/nfs4xdr.c
+17
-8
include/linux/nfs_xdr.h
include/linux/nfs_xdr.h
+7
-0
No files found.
fs/nfs/nfs4proc.c
View file @
16e42959
...
...
@@ -1614,11 +1614,17 @@ nfs4_proc_create(struct inode *dir, struct dentry *dentry, struct iattr *sattr,
static
int
_nfs4_proc_remove
(
struct
inode
*
dir
,
struct
qstr
*
name
)
{
struct
nfs_server
*
server
=
NFS_SERVER
(
dir
);
struct
nfs4_remove_arg
args
=
{
.
fh
=
NFS_FH
(
dir
),
.
name
=
name
,
.
bitmask
=
server
->
attr_bitmask
,
};
struct
nfs_fattr
dir_attr
;
struct
nfs4_remove_res
res
=
{
.
server
=
server
,
.
dir_attr
=
&
dir_attr
,
};
struct
nfs4_change_info
res
;
struct
rpc_message
msg
=
{
.
rpc_proc
=
&
nfs4_procedures
[
NFSPROC4_CLNT_REMOVE
],
.
rpc_argp
=
&
args
,
...
...
@@ -1626,9 +1632,12 @@ static int _nfs4_proc_remove(struct inode *dir, struct qstr *name)
};
int
status
;
status
=
rpc_call_sync
(
NFS_CLIENT
(
dir
),
&
msg
,
0
);
if
(
status
==
0
)
update_changeattr
(
dir
,
&
res
);
nfs_fattr_init
(
res
.
dir_attr
);
status
=
rpc_call_sync
(
server
->
client
,
&
msg
,
0
);
if
(
status
==
0
)
{
update_changeattr
(
dir
,
&
res
.
cinfo
);
nfs_post_op_update_inode
(
dir
,
res
.
dir_attr
);
}
return
status
;
}
...
...
@@ -1646,12 +1655,14 @@ static int nfs4_proc_remove(struct inode *dir, struct qstr *name)
struct
unlink_desc
{
struct
nfs4_remove_arg
args
;
struct
nfs4_change_info
res
;
struct
nfs4_remove_res
res
;
struct
nfs_fattr
dir_attr
;
};
static
int
nfs4_proc_unlink_setup
(
struct
rpc_message
*
msg
,
struct
dentry
*
dir
,
struct
qstr
*
name
)
{
struct
nfs_server
*
server
=
NFS_SERVER
(
dir
->
d_inode
);
struct
unlink_desc
*
up
;
up
=
(
struct
unlink_desc
*
)
kmalloc
(
sizeof
(
*
up
),
GFP_KERNEL
);
...
...
@@ -1660,6 +1671,9 @@ static int nfs4_proc_unlink_setup(struct rpc_message *msg, struct dentry *dir,
up
->
args
.
fh
=
NFS_FH
(
dir
->
d_inode
);
up
->
args
.
name
=
name
;
up
->
args
.
bitmask
=
server
->
attr_bitmask
;
up
->
res
.
server
=
server
;
up
->
res
.
dir_attr
=
&
up
->
dir_attr
;
msg
->
rpc_proc
=
&
nfs4_procedures
[
NFSPROC4_CLNT_REMOVE
];
msg
->
rpc_argp
=
&
up
->
args
;
...
...
@@ -1674,7 +1688,8 @@ static int nfs4_proc_unlink_done(struct dentry *dir, struct rpc_task *task)
if
(
msg
->
rpc_resp
!=
NULL
)
{
up
=
container_of
(
msg
->
rpc_resp
,
struct
unlink_desc
,
res
);
update_changeattr
(
dir
->
d_inode
,
&
up
->
res
);
update_changeattr
(
dir
->
d_inode
,
&
up
->
res
.
cinfo
);
nfs_post_op_update_inode
(
dir
->
d_inode
,
up
->
res
.
dir_attr
);
kfree
(
up
);
msg
->
rpc_resp
=
NULL
;
msg
->
rpc_argp
=
NULL
;
...
...
fs/nfs/nfs4xdr.c
View file @
16e42959
...
...
@@ -306,10 +306,12 @@ static int nfs_stat_to_errno(int);
decode_getfh_maxsz)
#define NFS4_enc_remove_sz (compound_encode_hdr_maxsz + \
encode_putfh_maxsz + \
encode_remove_maxsz)
encode_remove_maxsz + \
encode_getattr_maxsz)
#define NFS4_dec_remove_sz (compound_decode_hdr_maxsz + \
decode_putfh_maxsz + \
op_decode_hdr_maxsz + 5)
op_decode_hdr_maxsz + 5 + \
decode_getattr_maxsz)
#define NFS4_enc_rename_sz (compound_encode_hdr_maxsz + \
encode_putfh_maxsz + \
encode_savefh_maxsz + \
...
...
@@ -1327,14 +1329,18 @@ static int nfs4_xdr_enc_remove(struct rpc_rqst *req, uint32_t *p, const struct n
{
struct
xdr_stream
xdr
;
struct
compound_hdr
hdr
=
{
.
nops
=
2
,
.
nops
=
3
,
};
int
status
;
xdr_init_encode
(
&
xdr
,
&
req
->
rq_snd_buf
,
p
);
encode_compound_hdr
(
&
xdr
,
&
hdr
);
if
((
status
=
encode_putfh
(
&
xdr
,
args
->
fh
))
==
0
)
status
=
encode_remove
(
&
xdr
,
args
->
name
);
if
((
status
=
encode_putfh
(
&
xdr
,
args
->
fh
))
!=
0
)
goto
out
;
if
((
status
=
encode_remove
(
&
xdr
,
args
->
name
))
!=
0
)
goto
out
;
status
=
encode_getfattr
(
&
xdr
,
args
->
bitmask
);
out:
return
status
;
}
...
...
@@ -3512,7 +3518,7 @@ static int nfs4_xdr_dec_lookup_root(struct rpc_rqst *rqstp, uint32_t *p, struct
/*
* Decode REMOVE response
*/
static
int
nfs4_xdr_dec_remove
(
struct
rpc_rqst
*
rqstp
,
uint32_t
*
p
,
struct
nfs4_
change_info
*
cinfo
)
static
int
nfs4_xdr_dec_remove
(
struct
rpc_rqst
*
rqstp
,
uint32_t
*
p
,
struct
nfs4_
remove_res
*
res
)
{
struct
xdr_stream
xdr
;
struct
compound_hdr
hdr
;
...
...
@@ -3521,8 +3527,11 @@ static int nfs4_xdr_dec_remove(struct rpc_rqst *rqstp, uint32_t *p, struct nfs4_
xdr_init_decode
(
&
xdr
,
&
rqstp
->
rq_rcv_buf
,
p
);
if
((
status
=
decode_compound_hdr
(
&
xdr
,
&
hdr
))
!=
0
)
goto
out
;
if
((
status
=
decode_putfh
(
&
xdr
))
==
0
)
status
=
decode_remove
(
&
xdr
,
cinfo
);
if
((
status
=
decode_putfh
(
&
xdr
))
!=
0
)
goto
out
;
if
((
status
=
decode_remove
(
&
xdr
,
&
res
->
cinfo
))
!=
0
)
goto
out
;
decode_getfattr
(
&
xdr
,
res
->
dir_attr
,
res
->
server
);
out:
return
status
;
}
...
...
include/linux/nfs_xdr.h
View file @
16e42959
...
...
@@ -623,6 +623,13 @@ struct nfs4_readlink {
struct
nfs4_remove_arg
{
const
struct
nfs_fh
*
fh
;
const
struct
qstr
*
name
;
const
u32
*
bitmask
;
};
struct
nfs4_remove_res
{
const
struct
nfs_server
*
server
;
struct
nfs4_change_info
cinfo
;
struct
nfs_fattr
*
dir_attr
;
};
struct
nfs4_rename_arg
{
...
...
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