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@xxxxxx> > --- > 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@xxxxxxxxxxxxx _______________________________________________ xfs mailing list xfs@xxxxxxxxxxx http://oss.sgi.com/mailman/listinfo/xfs