Approach to quickly zeroing large XFS file (or) tool to mark XFS file extents as written

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?


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.




[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux