blobfs: only delete the "removed" file when ref count == 0.
Change-Id: I7bbbed5e62715fbbec381ce4226c5273ebef1a0a Signed-off-by: Cunyin Chang <cunyin.chang@intel.com> Reviewed-on: https://review.gerrithub.io/393729 Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
This commit is contained in:
parent
ac17ab3da9
commit
cacfeef389
@ -2348,6 +2348,7 @@ __file_close_async_done(void *ctx, int bserrno)
|
||||
spdk_fs_delete_file_async(file->fs, file->name, blob_delete_cb, ctx);
|
||||
return;
|
||||
}
|
||||
|
||||
args->fn.file_op(args->arg, bserrno);
|
||||
free_fs_request(req);
|
||||
}
|
||||
@ -2367,7 +2368,8 @@ __file_close_async(struct spdk_file *file, struct spdk_fs_request *req)
|
||||
file->ref_count--;
|
||||
if (file->ref_count > 0) {
|
||||
pthread_spin_unlock(&file->lock);
|
||||
__file_close_async_done(req, 0);
|
||||
req->args.fn.file_op(req->args.arg, 0);
|
||||
free_fs_request(req);
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user