mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-07 15:15:29 +00:00
NFSv42: Fallocate and clone should also request 'blocks used'
Both fallocate and clone can end up updating the blocks used attribute. Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
This commit is contained in:
parent
85847280b1
commit
34bf20ce98
1 changed files with 8 additions and 5 deletions
|
@ -46,7 +46,7 @@ static int _nfs42_proc_fallocate(struct rpc_message *msg, struct file *filep,
|
||||||
{
|
{
|
||||||
struct inode *inode = file_inode(filep);
|
struct inode *inode = file_inode(filep);
|
||||||
struct nfs_server *server = NFS_SERVER(inode);
|
struct nfs_server *server = NFS_SERVER(inode);
|
||||||
u32 bitmask[3];
|
u32 bitmask[NFS_BITMASK_SZ];
|
||||||
struct nfs42_falloc_args args = {
|
struct nfs42_falloc_args args = {
|
||||||
.falloc_fh = NFS_FH(inode),
|
.falloc_fh = NFS_FH(inode),
|
||||||
.falloc_offset = offset,
|
.falloc_offset = offset,
|
||||||
|
@ -69,9 +69,8 @@ static int _nfs42_proc_fallocate(struct rpc_message *msg, struct file *filep,
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(bitmask, server->cache_consistency_bitmask, sizeof(bitmask));
|
nfs4_bitmask_set(bitmask, server->cache_consistency_bitmask, inode,
|
||||||
if (server->attr_bitmask[1] & FATTR4_WORD1_SPACE_USED)
|
NFS_INO_INVALID_BLOCKS);
|
||||||
bitmask[1] |= FATTR4_WORD1_SPACE_USED;
|
|
||||||
|
|
||||||
res.falloc_fattr = nfs_alloc_fattr();
|
res.falloc_fattr = nfs_alloc_fattr();
|
||||||
if (!res.falloc_fattr)
|
if (!res.falloc_fattr)
|
||||||
|
@ -1044,13 +1043,14 @@ static int _nfs42_proc_clone(struct rpc_message *msg, struct file *src_f,
|
||||||
struct inode *src_inode = file_inode(src_f);
|
struct inode *src_inode = file_inode(src_f);
|
||||||
struct inode *dst_inode = file_inode(dst_f);
|
struct inode *dst_inode = file_inode(dst_f);
|
||||||
struct nfs_server *server = NFS_SERVER(dst_inode);
|
struct nfs_server *server = NFS_SERVER(dst_inode);
|
||||||
|
__u32 dst_bitmask[NFS_BITMASK_SZ];
|
||||||
struct nfs42_clone_args args = {
|
struct nfs42_clone_args args = {
|
||||||
.src_fh = NFS_FH(src_inode),
|
.src_fh = NFS_FH(src_inode),
|
||||||
.dst_fh = NFS_FH(dst_inode),
|
.dst_fh = NFS_FH(dst_inode),
|
||||||
.src_offset = src_offset,
|
.src_offset = src_offset,
|
||||||
.dst_offset = dst_offset,
|
.dst_offset = dst_offset,
|
||||||
.count = count,
|
.count = count,
|
||||||
.dst_bitmask = server->cache_consistency_bitmask,
|
.dst_bitmask = dst_bitmask,
|
||||||
};
|
};
|
||||||
struct nfs42_clone_res res = {
|
struct nfs42_clone_res res = {
|
||||||
.server = server,
|
.server = server,
|
||||||
|
@ -1079,6 +1079,9 @@ static int _nfs42_proc_clone(struct rpc_message *msg, struct file *src_f,
|
||||||
if (!res.dst_fattr)
|
if (!res.dst_fattr)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
|
nfs4_bitmask_set(dst_bitmask, server->cache_consistency_bitmask,
|
||||||
|
dst_inode, NFS_INO_INVALID_BLOCKS);
|
||||||
|
|
||||||
status = nfs4_call_sync(server->client, server, msg,
|
status = nfs4_call_sync(server->client, server, msg,
|
||||||
&args.seq_args, &res.seq_res, 0);
|
&args.seq_args, &res.seq_res, 0);
|
||||||
trace_nfs4_clone(src_inode, dst_inode, &args, status);
|
trace_nfs4_clone(src_inode, dst_inode, &args, status);
|
||||||
|
|
Loading…
Add table
Reference in a new issue