nfsv3: skip commit if the file has not changed

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
libnfs-4.0.0-vitalif
Ronnie Sahlberg 2019-01-05 06:53:33 +10:00
parent 9e63589591
commit 38b62bcf87
1 changed files with 6 additions and 0 deletions

View File

@ -4287,6 +4287,11 @@ nfs3_close_async(struct nfs_context *nfs, struct nfsfh *nfsfh, nfs_cb cb,
{
struct nfs_cb_data *data;
if (!nfsfh->is_dirty) {
cb(0, nfs, NULL, private_data);
return 0;
}
data = malloc(sizeof(struct nfs_cb_data));
if (data == NULL) {
nfs_set_error(nfs, "out of memory: failed to allocate "
@ -4459,6 +4464,7 @@ nfs3_pwrite_async_internal(struct nfs_context *nfs, struct nfsfh *nfsfh,
{
struct nfs_cb_data *data;
nfsfh->is_dirty = 1;
data = malloc(sizeof(struct nfs_cb_data));
if (data == NULL) {
nfs_set_error(nfs, "out of memory: failed to allocate "