Re: [PATCH v2] t_snapshot_deleted_subvolume: add check for BTRFS_IOC_SNAP_DESTROY_V2

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



On Tue, Feb 06, 2024 at 06:10:05PM +0800, Zorro Lang wrote:
> On Mon, Feb 05, 2024 at 04:49:07PM +0100, David Sterba wrote:
> > On Wed, Jan 31, 2024 at 11:23:48PM -0500, Yang Xu wrote:
> > > @@ -20,11 +20,6 @@
> > >  #define BTRFS_IOCTL_MAGIC 0x94
> > >  #endif
> > >  
> > > -#ifndef BTRFS_IOC_SNAP_DESTROY_V2
> > > -#define BTRFS_IOC_SNAP_DESTROY_V2 \
> > > -	_IOW(BTRFS_IOCTL_MAGIC, 63, struct btrfs_ioctl_vol_args_v2)
> > > -#endif
> > > -
> > >  #ifndef BTRFS_IOC_SNAP_CREATE_V2
> > >  #define BTRFS_IOC_SNAP_CREATE_V2 \
> > >  	_IOW(BTRFS_IOCTL_MAGIC, 23, struct btrfs_ioctl_vol_args_v2)
> > > @@ -58,6 +53,11 @@ struct btrfs_ioctl_vol_args_v2 {
> > >  };
> > >  #endif
> > >  
> > > +#if !HAVE_DECL_BTRFS_IOC_SNAP_DESTROY_V2
> > 
> > This is right for AC_CHECK_DECLS. Other macros like AC_CHECK_HEADERS do
> > not define the HAVE_... in case it's not found so the #if !HAVE_...
> > would be wrong. Slightly confusing.
> 
> Won't AC_CHECK_HEADERS define the HAVE_... ? But how do we get the ...
> 
>   /* Define to 1 if you have the <linux/falloc.h> header file. */
>   #define HAVE_LINUX_FALLOC_H 1
> 
> in include/config.h file?

Yes the HAVE_ macros are defined, just that it actually also defines

#define HAVE_LINUX_FALLOC_H 0

if not found, unlike other macros result in

/* #undef HAVE_SOME_FUNCTION */

What you did will work, the inconsistency is in the autoconf macros.




[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux