From: Omar Sandoval <osandov@osandov.com>
To: dsterba@suse.cz, linux-btrfs@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH v2 04/27] libbtrfsutil: add btrfs_util_is_subvolume() and btrfs_util_subvolume_id()
Date: Wed, 21 Feb 2018 10:13:03 -0800 [thread overview]
Message-ID: <20180221181303.GB29126@vader> (raw)
In-Reply-To: <20180221130202.GC1469@twin.jikos.cz>
On Wed, Feb 21, 2018 at 02:02:02PM +0100, David Sterba wrote:
> On Wed, Feb 21, 2018 at 12:43:07PM +0100, David Sterba wrote:
> > On Thu, Feb 15, 2018 at 11:04:49AM -0800, Omar Sandoval wrote:
> > > --- /dev/null
> > > +++ b/libbtrfsutil/subvolume.c
> > > @@ -0,0 +1,127 @@
> > > +/*
> > > + * Copyright (C) 2018 Facebook
> > > + *
> > > + * This file is part of libbtrfsutil.
> > > + *
> > > + * libbtrfsutil is free software: you can redistribute it and/or modify
> > > + * it under the terms of the GNU Lesser General Public License as published by
> > > + * the Free Software Foundation, either version 3 of the License, or
> > > + * (at your option) any later version.
> > > + *
> > > + * libbtrfsutil is distributed in the hope that it will be useful,
> > > + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> > > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> > > + * GNU Lesser General Public License for more details.
> > > + *
> > > + * You should have received a copy of the GNU Lesser General Public License
> > > + * along with libbtrfsutil. If not, see <http://www.gnu.org/licenses/>.
> > > + */
> > > +
> > > +#include <errno.h>
> > > +#include <fcntl.h>
> > > +#include <unistd.h>
> > > +#include <sys/ioctl.h>
> > > +#include <sys/stat.h>
> > > +#include <sys/types.h>
> > > +#include <sys/vfs.h>
> > > +#include <linux/btrfs.h>
> > > +#include <linux/btrfs_tree.h>
> >
> > How is this supposed to work? This pulls the system-wide includes, the
> > travis-ci environment has an old kernel and btrfs_tree.h does not exist
> > there. The missing defines are provided by libbtrfs' btrfs/ctree.h.
> >
> > We can add a configure-time check to detect the availability of the
> > headers, but I'm not sure if this is right. As libbtrfsutil/subvolume.c
> > is built internally it should use the includes from the btrfs-progs git
> > itself, no?
Dang it, yes, since the lib started out as its own repo I used the
system headers, but when I ported it to btrfs-progs I forgot to sort
this out.
> Oh yeah, the fun has begun. This will need to be sorted first. ctree.h
> unconditionally pulls kerncompat.h, so it cannot be used instead of the
> linux/btrfs*.h headers, there are warnings about redefined endianity
> conversion macros.
>
> We can split the headers by type, so ctree.h does not contain
> everything, or copy defines and types to libbtrfsutil header so it is
> completely independent of the git or system headers. Or something else.
>
> I can now make it compile without including btrfs_tree.h and copying
> parts of ctree.h until it compiles. The type u8 also has to be __u8.
I'll figure something out and send a patch, thanks.
next prev parent reply other threads:[~2018-02-21 18:13 UTC|newest]
Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-15 19:04 [PATCH v2 00/27] btrfs-progs: introduce libbtrfsutil, "btrfs-progs as a library" Omar Sandoval
2018-02-15 19:04 ` [PATCH v2 01/27] btrfs-progs: get rid of undocumented qgroup inheritance options Omar Sandoval
2018-02-15 19:04 ` [PATCH v2 02/27] Add libbtrfsutil Omar Sandoval
2018-02-20 17:32 ` Liu Bo
2018-02-20 18:34 ` David Sterba
2018-02-15 19:04 ` [PATCH v2 03/27] libbtrfsutil: add Python bindings Omar Sandoval
2018-02-21 13:47 ` David Sterba
2018-02-21 18:08 ` Omar Sandoval
2018-02-22 1:44 ` Misono, Tomohiro
2018-02-15 19:04 ` [PATCH v2 04/27] libbtrfsutil: add btrfs_util_is_subvolume() and btrfs_util_subvolume_id() Omar Sandoval
2018-02-21 11:43 ` David Sterba
2018-02-21 13:02 ` David Sterba
2018-02-21 18:13 ` Omar Sandoval [this message]
2018-02-15 19:04 ` [PATCH v2 05/27] libbtrfsutil: add qgroup inheritance helpers Omar Sandoval
2018-02-15 19:04 ` [PATCH v2 06/27] libbtrfsutil: add btrfs_util_create_subvolume() Omar Sandoval
2018-02-23 8:24 ` Misono, Tomohiro
2018-02-23 22:58 ` Omar Sandoval
2018-02-15 19:04 ` [PATCH v2 07/27] libbtrfsutil: add btrfs_util_subvolume_path() Omar Sandoval
2018-02-23 6:27 ` Misono, Tomohiro
2018-02-23 22:44 ` Omar Sandoval
2018-02-15 19:04 ` [PATCH v2 08/27] libbtrfsutil: add btrfs_util_subvolume_info() Omar Sandoval
2018-02-15 19:04 ` [PATCH v2 09/27] libbtrfsutil: add btrfs_util_[gs]et_read_only() Omar Sandoval
2018-02-15 19:04 ` [PATCH v2 10/27] libbtrfsutil: add btrfs_util_[gs]et_default_subvolume() Omar Sandoval
2018-02-22 1:55 ` Misono, Tomohiro
2018-02-23 22:40 ` Omar Sandoval
2018-02-15 19:04 ` [PATCH v2 11/27] libbtrfsutil: add subvolume iterator helpers Omar Sandoval
2018-02-23 7:40 ` Misono, Tomohiro
2018-02-23 22:49 ` Omar Sandoval
2018-02-15 19:04 ` [PATCH v2 12/27] libbtrfsutil: add btrfs_util_create_snapshot() Omar Sandoval
2018-02-15 19:04 ` [PATCH v2 13/27] libbtrfsutil: add btrfs_util_delete_subvolume() Omar Sandoval
2018-02-15 19:04 ` [PATCH v2 14/27] libbtrfsutil: add btrfs_util_deleted_subvolumes() Omar Sandoval
2018-02-23 2:12 ` Misono, Tomohiro
2018-02-23 23:33 ` Omar Sandoval
2018-02-28 4:11 ` Misono, Tomohiro
2018-02-15 19:05 ` [PATCH v2 15/27] libbtrfsutil: add filesystem sync helpers Omar Sandoval
2018-02-15 19:05 ` [PATCH v2 16/27] btrfs-progs: use libbtrfsutil for read-only property Omar Sandoval
2018-02-22 4:23 ` Misono, Tomohiro
2018-02-23 22:41 ` Omar Sandoval
2018-02-15 19:05 ` [PATCH v2 17/27] btrfs-progs: use libbtrfsutil for sync ioctls Omar Sandoval
2018-02-15 19:05 ` [PATCH v2 18/27] btrfs-progs: use libbtrfsutil for set-default Omar Sandoval
2018-02-15 19:05 ` [PATCH v2 19/27] btrfs-progs: use libbtrfsutil for get-default Omar Sandoval
2018-02-15 19:05 ` [PATCH v2 20/27] btrfs-progs: use libbtrfsutil for subvol create and snapshot Omar Sandoval
2018-02-15 19:05 ` [PATCH v2 21/27] btrfs-progs: use libbtrfsutil for subvol delete Omar Sandoval
2018-02-15 19:05 ` [PATCH v2 22/27] btrfs-progs: use libbtrfsutil for subvol show Omar Sandoval
2018-02-15 19:05 ` [PATCH v2 23/27] btrfs-progs: use libbtrfsutil for subvol sync Omar Sandoval
2018-02-22 2:03 ` Misono, Tomohiro
2018-02-23 22:41 ` Omar Sandoval
2018-02-23 23:22 ` David Sterba
2018-02-22 2:09 ` Misono, Tomohiro
2018-02-15 19:05 ` [PATCH v2 24/27] btrfs-progs: replace test_issubvolume() with btrfs_util_is_subvolume() Omar Sandoval
2018-02-15 19:05 ` [PATCH v2 25/27] btrfs-progs: add recursive snapshot/delete using libbtrfsutil Omar Sandoval
2018-02-15 19:05 ` [PATCH v2 26/27] btrfs-progs: use libbtrfsutil for subvolume list Omar Sandoval
2018-02-23 2:26 ` Misono, Tomohiro
2018-02-23 23:05 ` Omar Sandoval
2018-02-15 19:05 ` [PATCH v2 27/27] btrfs-progs: deprecate libbtrfs helpers Omar Sandoval
2018-02-21 15:04 ` David Sterba
2018-02-21 18:19 ` Omar Sandoval
2018-02-20 18:50 ` [PATCH v2 00/27] btrfs-progs: introduce libbtrfsutil, "btrfs-progs as a library" David Sterba
2018-02-21 15:13 ` David Sterba
2018-02-21 18:50 ` Omar Sandoval
2018-02-23 20:28 ` David Sterba
2018-02-26 23:36 ` Omar Sandoval
2018-02-27 15:04 ` David Sterba
2018-02-27 20:48 ` Omar Sandoval
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180221181303.GB29126@vader \
--to=osandov@osandov.com \
--cc=dsterba@suse.cz \
--cc=kernel-team@fb.com \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).