Whamcloud - gitweb
LU-17055 mdt: add fallocate(FALLOC_FL_ZERO_RANGE) for indirect
This patch implements fallocate(zero) operation on DoM (Data
on Metadata) components where files are mapped in indirect mode.
This functionality is not natively supported in the current
ldiskfs implementation.
We mimic the write procedure ourselves, to brw zero content
between user specified [start, end) range.
- in mdt_io.c::mdt_fallocate_hdl() we first try the default path
mdt_object_falloc(), where for this (ZERO & IND) case it returns
(-EOPNOTSUPP & DT_FALLOC_ERR_NEED_ZERO as a signal. We then
switch to mdt_object_falloc_zero(), there we iteratively call
dt_bufs_get() for brw preparation, and invokes mdt_commitrw_write()
executing the real write.
Signed-off-by: Keguang Xu <squalfof@gmail.com>
Change-Id: Ic7a9cb46eb94bdddff47795aaa2e4a4276dbe237
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/57246
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>