NFSD: Optimize nfsd4_encode_operation()

[ Upstream commit 095a764b7a ]

write_bytes_to_xdr_buf() is a generic way to place a variable-length
data item in an already-reserved spot in the encoding buffer.
However, it is costly, and here, it is unnecessary because the
data item is fixed in size, the buffer destination address is
always word-aligned, and the destination location is already in
@p.

Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
This commit is contained in:
Chuck Lever 2022-07-22 16:08:38 -04:00 коммит произвёл Greg Kroah-Hartman
Родитель b9e6a5610b
Коммит 0d6c82286d
1 изменённых файлов: 1 добавлений и 2 удалений

Просмотреть файл

@ -5378,8 +5378,7 @@ nfsd4_encode_operation(struct nfsd4_compoundres *resp, struct nfsd4_op *op)
so->so_replay.rp_buf, len); so->so_replay.rp_buf, len);
} }
status: status:
/* Note that op->status is already in network byte order: */ *p = op->status;
write_bytes_to_xdr_buf(xdr->buf, post_err_offset - 4, &op->status, 4);
} }
/* /*