Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Nov 2023 12:23:56 -0800
From:      Rick Macklem <rick.macklem@gmail.com>
To:        Martin Matuska <mm@freebsd.org>, Alexander Motin <mav@freebsd.org>,  FreeBSD CURRENT <freebsd-current@freebsd.org>, Garrett Wollman <wollman@bimajority.org>,  Mike Karels <mike@karels.net>
Subject:   RFC: #f FreeBSD_version of #ifdef <feature> for OpenZFS pull request
Message-ID:  <CAM5tNy7rJfEzMBoHe6UGLAZfpgpE-0KMsRjOkJhg1UaiAWt_vw@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Hi,

I have a patch currently under review at D42672 that fixes visibility
of snapshots under .zfs/snapshot for NFS clients.
It adds a new function called vfs_exjail_clone(), which the ZFS
code needs to use to fill in the mnt_exjail field.

Since the OpenZFS code is supposed to build for 12.2 or later,
I can see two ways of doing this:
(A) #if on the FreeBSD_versions, which will look something like:

#if (__FreeBSD_version >= 1300xxx && __FreeBSD_version < 1400000) ||
     (__FreeBSD_version >= 1400yyy && __FreeBSD_version < 1400500) ||
     (__FreeBSD_version >= 1400zzz && __FreeBSD_version < 1500000) ||
     __FreeBSD_version >= 1500wwww
         vfs_exjail_clone();
#endif

The problem with this one is I do not know what www, xxx, yyy and zzz are
until I have MFC'd the patch and bumped __FreeBSD_version.
--> I cannot generate the OpenZFS pull request until after that and,
     since I am headed to Florida for a few weeks, it would be late December
     at the earliest.
OR
(B) add a line like
#define VFS_SUPPORTS_EXJAIL_CLONE    1
to mount.h in the patch and then:

#ifdef VFS_SUPPORTS_EXJAIL_CLONE
         vfs_exjail_clone();
#endif

The adavntage of (B) is that I can do the pull request on OpenZFS
right away and commit the patch to main, etc as soon as possible,

So, which do you think is preferred? rick
ps: Unless D42672 gets reviewed soon, it won't really matter w.r.t. timing.



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