From: Dave Chinner <david@fromorbit.com>
To: Christoph Hellwig <hch@lst.de>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 10/13] xfsprogs: include libxfs.h in libxfs_priv.h
Date: Sat, 4 Jul 2015 09:42:48 +1000 [thread overview]
Message-ID: <20150703234248.GO7943@dastard> (raw)
In-Reply-To: <1435918341-10128-11-git-send-email-hch@lst.de>
On Fri, Jul 03, 2015 at 12:12:18PM +0200, Christoph Hellwig wrote:
> libxfs_priv.h duplicates large parts of libxfs.h.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> include/libxfs.h | 4 ----
> libxfs/libxfs_priv.h | 37 +------------------------------------
> 2 files changed, 1 insertion(+), 40 deletions(-)
This is the opposite of what I've been trying to get to, which is to
make libxfs compilation not be reliant on the external definitions
used by the rest of xfsprogs. i.e. libxfs_priv.h contains all the
bits that are need to compile the kernel code, libxfs_api_defs.h
contain all the swizzling needed to namespace all the externally
used libxfs code correctly, and libxfs_io.h contains all the buffer
IO interfaces.
In the end, there should be no duplication between the two files,
except for infrastructure includes like platform defs, lists, trees,
etc. This isnt quite complete yet, which is why there is some
duplication in the code right now.
> diff --git a/include/libxfs.h b/include/libxfs.h
> index 1fb2d6d..62553f0 100644
> --- a/include/libxfs.h
> +++ b/include/libxfs.h
> @@ -163,12 +163,8 @@ extern int libxfs_bmap_finish(xfs_trans_t **, xfs_bmap_free_t *, int *);
> extern void libxfs_fs_repair_cmn_err(int, struct xfs_mount *, char *, ...);
> extern void libxfs_fs_cmn_err(int, struct xfs_mount *, char *, ...);
>
> -/* XXX: this is messy and needs fixing */
> -#ifndef __LIBXFS_INTERNAL_XFS_H__
> extern void cmn_err(int, char *, ...);
> enum ce { CE_DEBUG, CE_CONT, CE_NOTE, CE_WARN, CE_ALERT, CE_PANIC };
> -#endif
> -
cmn_err needs to be removed from all the external utilities. This is
only a small amount of work, cmn_err is only used in the repair AVL
code and a single call in the logprint code. Both libxfs_fs_cmn_err
and xfs_fs_repair_cmn_err are completely unused, so cmn_err() should
become a libxfs internal function, and eventually be rewritten to
have native xfs_alert() style interfaces...
> -
> -/* CRC stuff, buffer API dependent on it */
> -extern uint32_t crc32_le(uint32_t crc, unsigned char const *p, size_t len);
> -extern uint32_t crc32c_le(uint32_t crc, unsigned char const *p, size_t len);
> -
> -#define crc32(c,p,l) crc32_le((c),(unsigned char const *)(p),(l))
> -#define crc32c(c,p,l) crc32c_le((c),(unsigned char const *)(p),(l))
I was planning to move this to libxfs_api_defs.h, as it's swizlling
needed to allow xfs_cksum.h be included in external code.
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2015-07-03 23:42 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-03 10:12 xfsprogs: clean up installed headers Christoph Hellwig
2015-07-03 10:12 ` [PATCH 01/13] xfsprogs: don't install internal header files Christoph Hellwig
2015-07-03 10:12 ` [PATCH 02/13] xfsprogs: remove unused macros from xfs_arch.h Christoph Hellwig
2015-07-03 10:12 ` [PATCH 03/13] xfsprogs: remove swab.h Christoph Hellwig
2015-07-03 10:12 ` [PATCH 04/13] xfsprogs: only install *format.h headers in install-qa Christoph Hellwig
2015-07-03 10:12 ` [PATCH 05/13] xfsprogs: remove install-qa target Christoph Hellwig
2015-07-03 10:12 ` [PATCH 06/13] xfsprogs: use <>-style includes in installed headers Christoph Hellwig
2015-07-03 10:12 ` [PATCH 07/13] xfsprogs: simplify internal includes Christoph Hellwig
2015-07-03 10:12 ` [PATCH 08/13] xfsprogs: move __be*/__le* types and __arch_pack to xfs_arch.h Christoph Hellwig
2015-07-03 10:12 ` [PATCH 09/13] xfsprogs: move __u*/__s* typedefs to per-port headers Christoph Hellwig
2015-07-03 10:12 ` [PATCH 10/13] xfsprogs: include libxfs.h in libxfs_priv.h Christoph Hellwig
2015-07-03 23:42 ` Dave Chinner [this message]
2015-07-03 10:12 ` [PATCH 11/13] xfsprogs: don't install platform_defs.h Christoph Hellwig
2015-07-03 10:12 ` [PATCH 12/13] xfsprogs: remove filldir_t typedef Christoph Hellwig
2015-07-03 10:12 ` [PATCH 13/13] xfsprogs: remove the constpp define Christoph Hellwig
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=20150703234248.GO7943@dastard \
--to=david@fromorbit.com \
--cc=hch@lst.de \
--cc=xfs@oss.sgi.com \
/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