Return-Path: Received: from mx2.suse.de ([195.135.220.15]:39706 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932556AbeBULp0 (ORCPT ); Wed, 21 Feb 2018 06:45:26 -0500 Date: Wed, 21 Feb 2018 12:43:07 +0100 From: David Sterba To: Omar Sandoval Cc: 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() Message-ID: <20180221114307.GA1469@twin.jikos.cz> Reply-To: dsterba@suse.cz References: <72c661cf7dc5cd27373ff0d19eb77cea14ce391c.1518720598.git.osandov@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <72c661cf7dc5cd27373ff0d19eb77cea14ce391c.1518720598.git.osandov@fb.com> Sender: linux-btrfs-owner@vger.kernel.org List-ID: 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 . > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include 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? Ie. the #ifdef BTRFS_FLAT_INCLUDES way is not necessary for non-exported sources. > +#include > + > +#include "btrfsutil_internal.h" All the include magic could be easily hidden inside this internal header so we won't need to include anything from the linux/* namespace directly. I'll keep this patch merged and unmodified, as it works on my machine, so any fix shall be an incremental on top of devel.