On Mon, Dec 23, 2024 at 10:12:32PM +0530, Sai Chaitanya Mitta wrote: > Hi Team, > Is there any method/tool available to explicitly mark XFS > file extents as written? One approach I > am aware is explicitly zeroing the entire file (this file may be even > in hundreds of GB in size) through > synchronous/asynchronous(aio/io_uring) mechanism but it is time taking > process for large files, > is there any optimization/approach we can do to explicitly zeroing > file/mark extents as written? Why do you need to mark them written? --D > > Synchronous Approach: > while offset < size { > let bytes_written = img_file > .write_at(&buf, offset) > .map_err(|e| { > error!("Failed to zero out file: {} > error: {:?}", vol_name, e); > })?; > if offset == size { > break; > } > offset = offset + bytes_written as u64; > } > img_file.sync_all(); > > Asynchronous approach: > Currently used fio with libaio as ioengine but > results are almost same. > > -- > Thanks& Regards, > M.Sai Chaithanya. >