Re: [PATCH v2 3/6] generic/765: move common atomic write code to a library file

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

 



On Mon, May 19, 2025 at 06:33:57PM -0700, Catherine Hoang wrote:
> From: "Darrick J. Wong" <djwong@xxxxxxxxxx>
> 
> Move the common atomic writes code to common/atomic so we can share

s/atomic/atomicwrites/

> them.
> 
> Signed-off-by: "Darrick J. Wong" <djwong@xxxxxxxxxx>
> Signed-off-by: Catherine Hoang <catherine.hoang@xxxxxxxxxx>
> Reviewed-by: John Garry <john.g.garry@xxxxxxxxxx>
> Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@xxxxxxxxx>

Looks good:
Reviewed-by: Ojaswin Mujoo <ojaswin@xxxxxxxxxxxxx>

just a minor comment below:
<snip>

> ---
>  common/atomicwrites | 111 ++++++++++++++++++++++++++++++++++++++++++++
>  common/rc           |  47 -------------------
>  tests/generic/765   |  53 ++-------------------
>  3 files changed, 114 insertions(+), 97 deletions(-)
>  create mode 100644 common/atomicwrites
> 
> +
> +_test_atomic_file_writes()

Since we use this for mostly bound checks and single mapping checks,
maybe we can name this as _test_atomic_file_writes_sanity() or something
along those lines? Im okay either ways, just thought its a bit confusing
to call _test_atomic_file_writes() and then doing more tests after that.

Regards,
ojaswin

> +{
> +    local bsize="$1"
> +    local testfile="$2"
> +    local bytes_written
> +    local testfile_cp="$testfile.copy"
> +
> +    # Check that we can perform an atomic write of len = FS block size
> +    bytes_written=$($XFS_IO_PROG -dc "pwrite -A -D -V1 -b $bsize 0 $bsize" $testfile | \
> +        grep wrote | awk -F'[/ ]' '{print $2}')
> +    test $bytes_written -eq $bsize || echo "atomic write len=$bsize failed"




[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