Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Mar 2024 20:52:17 +0200
From:      Konstantin Belousov <kib@freebsd.org>
To:        Rick Macklem <rick.macklem@gmail.com>
Cc:        mjg@freebsd.org, FreeBSD CURRENT <freebsd-current@freebsd.org>
Subject:   Re: RFC: should a va_bytes option be added to vn_getsize_locked()?
Message-ID:  <Ze4BYdWLtMc2Nc5Y@kib.kiev.ua>
In-Reply-To: <CAM5tNy6L4M-vsA1Kc44A3fvziDeJAMVxTK58US0B6MVesqbkhA@mail.gmail.com>
References:  <CAM5tNy6L4M-vsA1Kc44A3fvziDeJAMVxTK58US0B6MVesqbkhA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Mar 09, 2024 at 04:59:49PM -0800, Rick Macklem wrote:
> Hi,
> 
> I would like to compare va_size to va_bytes in vn_generic_copy_file_range(),
> as a heuristic to check for a sparse file (only works for non-compressed
> file systems).
> 
> The call to VOP_GETATTR(invp, ..) was replaced by vn_getsize_locked()
> in vn_generic_copy_file_range().
> 
> To get va_bytes I can either modify the code to again use VOP_GETATTR()
> or I could add an additional return argument to vn_getsize_locked().
> Since vn_getsize_locked() is descibed as a first step towards not using
> VOP_GETATTR() it sounds like adding an agument to vn_getsize_locked()
> is not the preferred alternative, but I thought I'd ask.

For me it sounds as very specific usage.  You might be better served by
directly using VOP_GETATTR() then IMO.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Ze4BYdWLtMc2Nc5Y>