Whamcloud - gitweb
LU-17055 mdt: add fallocate(FALLOC_FL_ZERO_RANGE) for indirect 46/57246/22
authorKeguang Xu <squalfof@gmail.com>
Tue, 3 Dec 2024 03:41:32 +0000 (11:41 +0800)
committerOleg Drokin <green@whamcloud.com>
Sat, 7 Jun 2025 22:55:19 +0000 (22:55 +0000)
commit84889a19d18421354566c4d332f2193b40f09f7d
tree20b9e8fe0a8f124793f94d5904068d6f22a2f14c
parent83e0f28d3567863973ba8af4a7315666d52d8a52
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>
lustre/include/dt_object.h
lustre/llite/file.c
lustre/mdt/mdt_io.c
lustre/ofd/ofd_dev.c
lustre/ofd/ofd_objects.c
lustre/osc/osc_request.c
lustre/osd-ldiskfs/osd_io.c
lustre/tests/sanity-dom.sh
lustre/tests/sanity.sh