Skip to contentSkip to conversation

xfsprogs: remove the libxfs_* API redirections

PATCH In review Christoph Hellwig 2 participants 3 messages Jul 10, 2020 – Jul 21, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfsprogs: remove the libxfs_* API redirections

For historical reasons xfsprogs tries to renamed xfs_* symbols used by tools (but not those used inside libxfs) to libxfs_. Remove this indirection to make it clear what function is being called, and to avoid having to keep the renaming header uptodate.

---
 copy/xfs_copy.c              |  10 +-
 db/agfl.c                    |   2 +-
 db/attrset.c                 |  28 +--
 db/bmap.c                    |   4 +-
 db/bmroot.c                  |   4 +-
 db/btdump.c                  |  18 +-
 db/btheight.c                |  14 +-
 db/check.c                   |  40 ++--
 db/dir2.c                    |  10 +-
 db/dir2sf.c                  |   8 +-
 db/frag.c                    |   2 +-
 db/freesp.c                  |   6 +-
 db/fsmap.c                   |  16 +-
 db/hash.c                    |   2 +-
 db/info.c                    |  12 +-
 db/init.c                    |   8 +-
 db/inode.c                   |   4 +-
 db/io.c                      |  12 +-
 db/logformat.c               |   2 +-
 db/metadump.c                |  34 ++--
 db/sb.c                      |  10 +-
 include/cache.h              |   2 +-
 include/libxfs.h             |   7 +-
 include/xfs_inode.h          |   8 +-
 include/xfs_trans.h          |  48 ++---
 io/open.c                    |   2 +-
 libxfs/Makefile              |   1 -
 libxfs/cache.c               |   2 +-
 libxfs/init.c                |  16 +-
 libxfs/libxfs_api_defs.h     | 191 ------------------
 libxfs/libxfs_io.h           |  30 +--
 libxfs/libxfs_priv.h         |   7 +-
 libxfs/rdwr.c                |  66 +++----
 libxfs/trans.c               |  78 ++++----
 libxfs/util.c                |   8 +-
 libxlog/xfs_log_recover.c    |  28 +--
 logprint/log_misc.c          |   4 +-
 logprint/log_print_all.c     |   2 +-
 logprint/logprint.c          |   2 +-
 mdrestore/xfs_mdrestore.c    |   4 +-
 mkfs/proto.c                 | 112 +++++------
 mkfs/xfs_mkfs.c              |  84 ++++----
 repair/agheader.c            |  10 +-
 repair/attr_repair.c         |  46 +++--
 repair/da_util.c             |  36 ++--
 repair/dino_chunks.c         |  20 +-
 repair/dinode.c              |  40 ++--
 repair/dir2.c                |  88 ++++-----
 repair/phase3.c              |   6 +-
 repair/phase4.c              |  12 +-
 repair/phase5.c              | 128 ++++++------
 repair/phase6.c              | 366 +++++++++++++++++------------------
 repair/phase7.c              |  10 +-
 repair/prefetch.c            |  18 +-
 repair/rmap.c                |  72 +++----
 repair/rt.c                  |  10 +-
 repair/sb.c                  |  10 +-
 repair/scan.c                |  46 ++---
 repair/xfs_repair.c          |  18 +-
 tools/find-api-violations.sh |  38 +---
 60 files changed, 846 insertions(+), 1076 deletions(-)
 delete mode 100644 libxfs/libxfs_api_defs.h
copy/xfs_copy.c +5 -5
index 2d087f71..1dacb35a 100644
@@ -711,7 +711,7 @@ main(int argc, char **argv)
 
 	/* We don't yet know the sector size, so read maximal size */
 	libxfs_buftarg_init(&mbuf, xargs.ddev, xargs.logdev, xargs.rtdev);
-	error = -libxfs_buf_read_uncached(mbuf.m_ddev_targp, XFS_SB_DADDR,
+	error = -xfs_buf_read_uncached(mbuf.m_ddev_targp, XFS_SB_DADDR,
 			1 << (XFS_MAX_SECTORSIZE_LOG - BBSHIFT), 0, &sbp, NULL);
 	if (error) {
 		do_log(_("%s: couldn't read superblock, error=%d\n"),
@@ -720,12 +720,12 @@ main(int argc, char **argv)
 	}
 
 	sb = &mbuf.m_sb;
-	libxfs_sb_from_disk(sb, sbp->b_addr);
+	xfs_sb_from_disk(sb, sbp->b_addr);
 
 	/* Do it again, now with proper length and verifier */
-	libxfs_buf_relse(sbp);
+	xfs_buf_relse(sbp);
 
-	error = -libxfs_buf_read(mbuf.m_ddev_targp, XFS_SB_DADDR,
+	error = -xfs_buf_read(mbuf.m_ddev_targp, XFS_SB_DADDR,
 			1 << (sb->sb_sectlog - BBSHIFT), 0, &sbp,
 			&xfs_sb_buf_ops);
 	if (error) {
@@ -733,7 +733,7 @@ main(int argc, char **argv)
 				progname, error);
 		exit(1);
 	}
-	libxfs_buf_relse(sbp);
+	xfs_buf_relse(sbp);
 
 	mp = libxfs_mount(&mbuf, sb, xargs.ddev, xargs.logdev, xargs.rtdev, 0);
 	if (mp == NULL) {
db/agfl.c +1 -1
index f0f3f21a..2b9bff2a 100644
@@ -58,7 +58,7 @@ agfl_bno_size(
 	void	*obj,
 	int	startoff)
 {
-	return libxfs_agfl_size(mp);
+	return xfs_agfl_size(mp);
 }
 
 static void
db/attrset.c +14 -14
index b86ecec7..f7e50720 100644
@@ -84,16 +84,16 @@ attr_set_f(
 		switch (c) {
 		/* namespaces */
 		case 'r':
-			args.attr_filter |= LIBXFS_ATTR_ROOT;
-			args.attr_filter &= ~LIBXFS_ATTR_SECURE;
+			args.attr_filter |= XFS_ATTR_ROOT;
+			args.attr_filter &= ~XFS_ATTR_SECURE;
 			break;
 		case 'u':
-			args.attr_filter &= ~(LIBXFS_ATTR_ROOT |
-					      LIBXFS_ATTR_SECURE);
+			args.attr_filter &= ~(XFS_ATTR_ROOT |
+					      XFS_ATTR_SECURE);
 			break;
 		case 's':
-			args.attr_filter |= LIBXFS_ATTR_SECURE;
-			args.attr_filter &= ~LIBXFS_ATTR_ROOT;
+			args.attr_filter |= XFS_ATTR_SECURE;
+			args.attr_filter &= ~XFS_ATTR_ROOT;
 			break;
 
 		/* modifiers */
@@ -160,7 +160,7 @@ attr_set_f(
 		goto out;
 	}
 
-	if (libxfs_attr_set(&args)) {
+	if (xfs_attr_set(&args)) {
 		dbprintf(_("failed to set attr %s on inode %llu\n"),
 			args.name, (unsigned long long)iocur_top->ino);
 		goto out;
@@ -199,16 +199,16 @@ attr_remove_f(
 		switch (c) {
 		/* namespaces */
 		case 'r':
-			args.attr_filter |= LIBXFS_ATTR_ROOT;
-			args.attr_filter &= ~LIBXFS_ATTR_SECURE;
+			args.attr_filter |= XFS_ATTR_ROOT;
+			args.attr_filter &= ~XFS_ATTR_SECURE;
 			break;
 		case 'u':
-			args.attr_filter &= ~(LIBXFS_ATTR_ROOT |
-					      LIBXFS_ATTR_SECURE);
+			args.attr_filter &= ~(XFS_ATTR_ROOT |
+					      XFS_ATTR_SECURE);
 			break;
 		case 's':
-			args.attr_filter |= LIBXFS_ATTR_SECURE;
-			args.attr_filter &= ~LIBXFS_ATTR_ROOT;
+			args.attr_filter |= XFS_ATTR_SECURE;
+			args.attr_filter &= ~XFS_ATTR_ROOT;
 			break;
 
 		case 'n':
@@ -245,7 +245,7 @@ attr_remove_f(
 		goto out;
 	}
 
-	if (libxfs_attr_set(&args)) {
+	if (xfs_attr_set(&args)) {
 		dbprintf(_("failed to remove attr %s from inode %llu\n"),
 			(unsigned char *)args.name,
 			(unsigned long long)iocur_top->ino);
db/bmap.c +2 -2
index fdc70e95..d028a786 100644
@@ -78,7 +78,7 @@ bmap(
 		push_cur();
 		rblock = (xfs_bmdr_block_t *)XFS_DFORK_PTR(dip, whichfork);
 		fsize = XFS_DFORK_SIZE(dip, mp, whichfork);
-		pp = XFS_BMDR_PTR_ADDR(rblock, 1, libxfs_bmdr_maxrecs(fsize, 0));
+		pp = XFS_BMDR_PTR_ADDR(rblock, 1, xfs_bmdr_maxrecs(fsize, 0));
 		kp = XFS_BMDR_KEY_ADDR(rblock, 1);
 		bno = select_child(curoffset, kp, pp,
 					be16_to_cpu(rblock->bb_numrecs));
@@ -89,7 +89,7 @@ bmap(
 			if (be16_to_cpu(block->bb_level) == 0)
 				break;
 			pp = XFS_BMBT_PTR_ADDR(mp, block, 1,
-				libxfs_bmbt_maxrecs(mp, mp->m_sb.sb_blocksize, 0));
+				xfs_bmbt_maxrecs(mp, mp->m_sb.sb_blocksize, 0));
 			kp = XFS_BMBT_KEY_ADDR(mp, block, 1);
 			bno = select_child(curoffset, kp, pp,
 					be16_to_cpu(block->bb_numrecs));
db/bmroot.c +2 -2
index 0db526c6..6bf87a43 100644
@@ -128,7 +128,7 @@ bmroota_ptr_offset(
 	ASSERT(XFS_DFORK_Q(dip) && (char *)block == XFS_DFORK_APTR(dip));
 	ASSERT(be16_to_cpu(block->bb_level) > 0);
 	pp = XFS_BMDR_PTR_ADDR(block, idx,
-		libxfs_bmdr_maxrecs(XFS_DFORK_ASIZE(dip, mp), 0));
+		xfs_bmdr_maxrecs(XFS_DFORK_ASIZE(dip, mp), 0));
 	return bitize((int)((char *)pp - (char *)block));
 }
 
@@ -223,7 +223,7 @@ bmrootd_ptr_offset(
 	block = (xfs_bmdr_block_t *)((char *)obj + byteize(startoff));
 	ASSERT(be16_to_cpu(block->bb_level) > 0);
 	pp = XFS_BMDR_PTR_ADDR(block, idx,
-		libxfs_bmdr_maxrecs(XFS_DFORK_DSIZE(dip, mp), 0));
+		xfs_bmdr_maxrecs(XFS_DFORK_DSIZE(dip, mp), 0));
 	return bitize((int)((char *)pp - (char *)block));
 }
 
db/btdump.c +9 -9
index 920f595b..b9947c18 100644
@@ -212,10 +212,10 @@ dir_has_rightsib(
 	struct xfs_da3_icnode_hdr	nhdr;
 
 	if (level > 0) {
-		libxfs_da3_node_hdr_from_disk(mp, &nhdr, block);
+		xfs_da3_node_hdr_from_disk(mp, &nhdr, block);
 		return nhdr.forw != 0;
 	}
-	libxfs_dir2_leaf_hdr_from_disk(mp, &lhdr, block);
+	xfs_dir2_leaf_hdr_from_disk(mp, &lhdr, block);
 	return lhdr.forw != 0;
 }
 
@@ -229,10 +229,10 @@ dir_level(
 	switch (((struct xfs_da_intnode *)block)->hdr.info.magic) {
 	case cpu_to_be16(XFS_DIR2_LEAF1_MAGIC):
 	case cpu_to_be16(XFS_DIR2_LEAFN_MAGIC):
-		libxfs_dir2_leaf_hdr_from_disk(mp, &lhdr, block);
+		xfs_dir2_leaf_hdr_from_disk(mp, &lhdr, block);
 		return 0;
 	case cpu_to_be16(XFS_DA_NODE_MAGIC):
-		libxfs_da3_node_hdr_from_disk(mp, &nhdr, block);
+		xfs_da3_node_hdr_from_disk(mp, &nhdr, block);
 		return nhdr.level;
 	default:
 		return -1;
@@ -249,10 +249,10 @@ dir3_level(
 	switch (((struct xfs_da_intnode *)block)->hdr.info.magic) {
 	case cpu_to_be16(XFS_DIR3_LEAF1_MAGIC):
 	case cpu_to_be16(XFS_DIR3_LEAFN_MAGIC):
-		libxfs_dir2_leaf_hdr_from_disk(mp, &lhdr, block);
+		xfs_dir2_leaf_hdr_from_disk(mp, &lhdr, block);
 		return 0;
 	case cpu_to_be16(XFS_DA3_NODE_MAGIC):
-		libxfs_da3_node_hdr_from_disk(mp, &nhdr, block);
+		xfs_da3_node_hdr_from_disk(mp, &nhdr, block);
 		return nhdr.level;
 	default:
 		return -1;
@@ -268,7 +268,7 @@ attr_has_rightsib(
 	struct xfs_da3_icnode_hdr	nhdr;
 
 	if (level > 0) {
-		libxfs_da3_node_hdr_from_disk(mp, &nhdr, block);
+		xfs_da3_node_hdr_from_disk(mp, &nhdr, block);
 		return nhdr.forw != 0;
 	}
 	xfs_attr3_leaf_hdr_to_disk(mp->m_attr_geo, &lhdr, block);
@@ -287,7 +287,7 @@ attr_level(
 		xfs_attr3_leaf_hdr_to_disk(mp->m_attr_geo, &lhdr, block);
 		return 0;
 	case cpu_to_be16(XFS_DA_NODE_MAGIC):
-		libxfs_da3_node_hdr_from_disk(mp, &nhdr, block);
+		xfs_da3_node_hdr_from_disk(mp, &nhdr, block);
 		return nhdr.level;
 	default:
 		return -1;
@@ -306,7 +306,7 @@ attr3_level(
 		xfs_attr3_leaf_hdr_to_disk(mp->m_attr_geo, &lhdr, block);
 		return 0;
 	case cpu_to_be16(XFS_DA3_NODE_MAGIC):
-		libxfs_da3_node_hdr_from_disk(mp, &nhdr, block);
+		xfs_da3_node_hdr_from_disk(mp, &nhdr, block);
 		return nhdr.level;
 	default:
 		return -1;
db/btheight.c +7 -7
index 8aa17c89..5d4aa685 100644
@@ -14,12 +14,12 @@
 
 static int refc_maxrecs(struct xfs_mount *mp, int blocklen, int leaf)
 {
-	return libxfs_refcountbt_maxrecs(blocklen, leaf != 0);
+	return xfs_refcountbt_maxrecs(blocklen, leaf != 0);
 }
 
 static int rmap_maxrecs(struct xfs_mount *mp, int blocklen, int leaf)
 {
-	return libxfs_rmapbt_maxrecs(blocklen, leaf);
+	return xfs_rmapbt_maxrecs(blocklen, leaf);
 }
 
 struct btmap {
@@ -27,11 +27,11 @@ struct btmap {
 	int		(*maxrecs)(struct xfs_mount *mp, int blocklen,
 				   int leaf);
 } maps[] = {
-	{"bnobt", libxfs_allocbt_maxrecs},
-	{"cntbt", libxfs_allocbt_maxrecs},
-	{"inobt", libxfs_inobt_maxrecs},
-	{"finobt", libxfs_inobt_maxrecs},
-	{"bmapbt", libxfs_bmbt_maxrecs},
+	{"bnobt", xfs_allocbt_maxrecs},
+	{"cntbt", xfs_allocbt_maxrecs},
+	{"inobt", xfs_inobt_maxrecs},
+	{"finobt", xfs_inobt_maxrecs},
+	{"bmapbt", xfs_bmbt_maxrecs},
 	{"refcountbt", refc_maxrecs},
 	{"rmapbt", rmap_maxrecs},
 };
db/check.c +20 -20
index 12c03b6d..bc3c3e2a 100644
@@ -2269,7 +2269,7 @@ process_btinode(
 		return;
 	}
 	if (be16_to_cpu(dib->bb_numrecs) >
-			libxfs_bmdr_maxrecs(XFS_DFORK_SIZE(dip, mp, whichfork),
+			xfs_bmdr_maxrecs(XFS_DFORK_SIZE(dip, mp, whichfork),
 			be16_to_cpu(dib->bb_level) == 0)) {
 		if (!sflag || id->ilist)
 			dbprintf(_("numrecs for ino %lld %s fork bmap root too "
@@ -2287,7 +2287,7 @@ process_btinode(
 		*nex += be16_to_cpu(dib->bb_numrecs);
 		return;
 	} else {
-		pp = XFS_BMDR_PTR_ADDR(dib, 1, libxfs_bmdr_maxrecs(
+		pp = XFS_BMDR_PTR_ADDR(dib, 1, xfs_bmdr_maxrecs(
 				XFS_DFORK_SIZE(dip, mp, whichfork), 0));
 		for (i = 0; i < be16_to_cpu(dib->bb_numrecs); i++)
 			scan_lbtree(get_unaligned_be64(&pp[i]),
@@ -2358,7 +2358,7 @@ process_data_dir_v2(
 		return NULLFSINO;
 	}
 	db = xfs_dir2_da_to_db(mp->m_dir_geo, dabno);
-	bf = libxfs_dir2_data_bestfree_p(mp, data);
+	bf = xfs_dir2_data_bestfree_p(mp, data);
 	ptr = (char *)data + mp->m_dir_geo->data_entry_offset;
 	if (be32_to_cpu(block->magic) == XFS_DIR2_BLOCK_MAGIC ||
 	    be32_to_cpu(block->magic) == XFS_DIR3_BLOCK_MAGIC) {
@@ -2444,7 +2444,7 @@ process_data_dir_v2(
 					(int)((char *)dep - (char *)data));
 			error++;
 		}
-		tagp = libxfs_dir2_data_entry_tag_p(mp, dep);
+		tagp = xfs_dir2_data_entry_tag_p(mp, dep);
 		if ((char *)tagp >= endptr) {
 			if (!sflag || v)
 				dbprintf(_("dir %lld block %d bad entry at %d\n"),
@@ -2458,8 +2458,8 @@ process_data_dir_v2(
 			(char *)dep - (char *)data);
 		xname.name = dep->name;
 		xname.len = dep->namelen;
-		dir_hash_add(libxfs_dir2_hashname(mp, &xname), addr);
-		ptr += libxfs_dir2_data_entsize(mp, dep->namelen);
+		dir_hash_add(xfs_dir2_hashname(mp, &xname), addr);
+		ptr += xfs_dir2_data_entsize(mp, dep->namelen);
 		count++;
 		lastfree = 0;
 		lino = be64_to_cpu(dep->inumber);
@@ -2584,7 +2584,7 @@ process_data_dir_v2_freefind(
 	xfs_dir2_data_aoff_t	off;
 
 	off = (xfs_dir2_data_aoff_t)((char *)dup - (char *)data);
-	bf = libxfs_dir2_data_bestfree_p(mp, data);
+	bf = xfs_dir2_data_bestfree_p(mp, data);
 	if (be16_to_cpu(dup->length) <
 			be16_to_cpu(bf[XFS_DIR2_DATA_FD_COUNT - 1].length))
 		return NULL;
@@ -2752,7 +2752,7 @@ process_inode(
 
 	/* xfs_inode_from_disk expects to have an mp to work with */
 	xino.i_mount = mp;
-	libxfs_inode_from_disk(&xino, dip);
+	xfs_inode_from_disk(&xino, dip);
 
 	ino = XFS_AGINO_TO_INO(mp, be32_to_cpu(agf->agf_seqno), agino);
 	if (!isfree) {
@@ -2768,7 +2768,7 @@ process_inode(
 		error++;
 		return;
 	}
-	if (!libxfs_dinode_good_version(&mp->m_sb, dip->di_version)) {
+	if (!xfs_dinode_good_version(&mp->m_sb, dip->di_version)) {
 		if (isfree || v)
 			dbprintf(_("bad version number %#x for inode %lld\n"),
 				dip->di_version, ino);
@@ -3306,7 +3306,7 @@ process_leaf_node_dir_v2_int(
 	struct xfs_dir3_icleaf_hdr leafhdr;
 
 	leaf = iocur_top->data;
-	libxfs_dir2_leaf_hdr_from_disk(mp, &leafhdr, leaf);
+	xfs_dir2_leaf_hdr_from_disk(mp, &leafhdr, leaf);
 
 	switch (be16_to_cpu(leaf->hdr.info.magic)) {
 	case XFS_DIR3_LEAF1_MAGIC:
@@ -3364,7 +3364,7 @@ process_leaf_node_dir_v2_int(
 	case XFS_DA_NODE_MAGIC:
 	case XFS_DA3_NODE_MAGIC:
 		node = iocur_top->data;
-		libxfs_da3_node_hdr_from_disk(mp, &nodehdr, node);
+		xfs_da3_node_hdr_from_disk(mp, &nodehdr, node);
 		if (nodehdr.level < 1 || nodehdr.level > XFS_DA_NODE_MAXDEPTH) {
 			if (!sflag || v)
 				dbprintf(_("bad node block level %d for dir ino "
@@ -3671,7 +3671,7 @@ process_sf_dir_v2(
 	offset = mp->m_dir_geo->data_first_offset;
 	for (i = sf->count - 1, i8 = 0; i >= 0; i--) {
 		if ((intptr_t)sfe +
-		    libxfs_dir2_sf_entsize(mp, sf, sfe->namelen) -
+		    xfs_dir2_sf_entsize(mp, sf, sfe->namelen) -
 		    (intptr_t)sf > be64_to_cpu(dip->di_size)) {
 			if (!sflag)
 				dbprintf(_("dir %llu bad size in entry at %d\n"),
@@ -3680,7 +3680,7 @@ process_sf_dir_v2(
 			error++;
 			break;
 		}
-		lino = libxfs_dir2_sf_get_ino(mp, sf, sfe);
+		lino = xfs_dir2_sf_get_ino(mp, sf, sfe);
 		if (lino > XFS_DIR2_MAX_SHORT_INUM)
 			i8++;
 		cid = find_inode(lino, 1);
@@ -3710,8 +3710,8 @@ process_sf_dir_v2(
 		}
 		offset =
 			xfs_dir2_sf_get_offset(sfe) +
-			libxfs_dir2_sf_entsize(mp, sf, sfe->namelen);
-		sfe = libxfs_dir2_sf_nextentry(mp, sf, sfe);
+			xfs_dir2_sf_entsize(mp, sf, sfe->namelen);
+		sfe = xfs_dir2_sf_nextentry(mp, sf, sfe);
 	}
 	if (i < 0 && (intptr_t)sfe - (intptr_t)sf !=
 					be64_to_cpu(dip->di_size)) {
@@ -3727,7 +3727,7 @@ process_sf_dir_v2(
 			dbprintf(_("dir %llu offsets too high\n"), id->ino);
 		error++;
 	}
-	lino = libxfs_dir2_sf_get_parent_ino(sf);
+	lino = xfs_dir2_sf_get_parent_ino(sf);
 	if (lino > XFS_DIR2_MAX_SHORT_INUM)
 		i8++;
 	cid = find_inode(lino, 1);
@@ -3897,7 +3897,7 @@ scan_ag(
 		goto pop1_out;
 	}
 
-	libxfs_sb_from_disk(sb, iocur_top->data);
+	xfs_sb_from_disk(sb, iocur_top->data);
 
 	if (sb->sb_magicnum != XFS_SB_MAGIC) {
 		if (!sflag)
@@ -4110,8 +4110,8 @@ scan_freelist(
 	}
 
 	/* verify agf values before proceeding */
-	if (be32_to_cpu(agf->agf_flfirst) >= libxfs_agfl_size(mp) ||
-	    be32_to_cpu(agf->agf_fllast) >= libxfs_agfl_size(mp)) {
+	if (be32_to_cpu(agf->agf_flfirst) >= xfs_agfl_size(mp) ||
+	    be32_to_cpu(agf->agf_fllast) >= xfs_agfl_size(mp)) {
 		dbprintf(_("agf %d freelist blocks bad, skipping "
 			  "freelist scan\n"), seqno);
 		pop_cur();
@@ -4121,7 +4121,7 @@ scan_freelist(
 	/* open coded xfs_buf_to_agfl_bno */
 	state.count = 0;
 	state.agno = seqno;
-	libxfs_agfl_walk(mp, agf, iocur_top->bp, scan_agfl, &state);
+	xfs_agfl_walk(mp, agf, iocur_top->bp, scan_agfl, &state);
 	if (state.count != be32_to_cpu(agf->agf_flcount)) {
 		if (!sflag)
 			dbprintf(_("freeblk count %u != flcount %u in ag %u\n"),
db/dir2.c +5 -5
index 503dcdfe..beb104a0 100644
@@ -211,7 +211,7 @@ __dir2_data_entries_count(
 			ptr += be16_to_cpu(dup->length);
 		else {
 			dep = (xfs_dir2_data_entry_t *)ptr;
-			ptr += libxfs_dir2_data_entsize(mp, dep->namelen);
+			ptr += xfs_dir2_data_entsize(mp, dep->namelen);
 		}
 	}
 	return i;
@@ -235,7 +235,7 @@ __dir2_data_entry_offset(
 			ptr += be16_to_cpu(dup->length);
 		else {
 			dep = (xfs_dir2_data_entry_t *)ptr;
-			ptr += libxfs_dir2_data_entsize(mp, dep->namelen);
+			ptr += xfs_dir2_data_entsize(mp, dep->namelen);
 		}
 	}
 	return ptr;
@@ -486,7 +486,7 @@ dir2_data_union_tag_count(
 		end = (char *)&dep->namelen + sizeof(dep->namelen);
 		if (end > (char *)obj + mp->m_dir_geo->blksize)
 			return 0;
-		tagp = libxfs_dir2_data_entry_tag_p(mp, dep);
+		tagp = xfs_dir2_data_entry_tag_p(mp, dep);
 	}
 	end = (char *)tagp + sizeof(*tagp);
 	return end <= (char *)obj + mp->m_dir_geo->blksize;
@@ -508,7 +508,7 @@ dir2_data_union_tag_offset(
 		return bitize((int)((char *)xfs_dir2_data_unused_tag_p(dup) -
 				    (char *)dup));
 	dep = (xfs_dir2_data_entry_t *)dup;
-	return bitize((int)((char *)libxfs_dir2_data_entry_tag_p(mp, dep) -
+	return bitize((int)((char *)xfs_dir2_data_entry_tag_p(mp, dep) -
 			    (char *)dep));
 }
 
@@ -585,7 +585,7 @@ dir2_data_union_size(
 		return bitize(be16_to_cpu(dup->length));
 	else {
 		dep = (xfs_dir2_data_entry_t *)dup;
-		return bitize(libxfs_dir2_data_entsize(mp, dep->namelen));
+		return bitize(xfs_dir2_data_entsize(mp, dep->namelen));
 	}
 }
 
db/dir2sf.c +4 -4
index 8165b79b..e2b5354c 100644
@@ -167,8 +167,8 @@ dir2_sf_entry_size(
 	sf = (struct xfs_dir2_sf_hdr *)((char *)obj + byteize(startoff));
 	e = xfs_dir2_sf_firstentry(sf);
 	for (i = 0; i < idx; i++)
-		e = libxfs_dir2_sf_nextentry(mp, sf, e);
-	return bitize((int)libxfs_dir2_sf_entsize(mp, sf, e->namelen));
+		e = xfs_dir2_sf_nextentry(mp, sf, e);
+	return bitize((int)xfs_dir2_sf_entsize(mp, sf, e->namelen));
 }
 
 /*ARGSUSED*/
@@ -212,7 +212,7 @@ dir2_sf_list_offset(
 	sf = (struct xfs_dir2_sf_hdr *)((char *)obj + byteize(startoff));
 	e = xfs_dir2_sf_firstentry(sf);
 	for (i = 0; i < idx; i++)
-		e = libxfs_dir2_sf_nextentry(mp, sf, e);
+		e = xfs_dir2_sf_nextentry(mp, sf, e);
 	return bitize((int)((char *)e - (char *)sf));
 }
 
@@ -232,7 +232,7 @@ dir2sf_size(
 	sf = (struct xfs_dir2_sf_hdr *)((char *)obj + byteize(startoff));
 	e = xfs_dir2_sf_firstentry(sf);
 	for (i = 0; i < sf->count; i++)
-		e = libxfs_dir2_sf_nextentry(mp, sf, e);
+		e = xfs_dir2_sf_nextentry(mp, sf, e);
 	return bitize((int)((char *)e - (char *)sf));
 }
 
db/frag.c +1 -1
index 1cfc6c2c..ead1bc94 100644
@@ -248,7 +248,7 @@ process_btinode(
 		return;
 	}
 	pp = XFS_BMDR_PTR_ADDR(dib, 1,
-		libxfs_bmdr_maxrecs(XFS_DFORK_SIZE(dip, mp, whichfork), 0));
+		xfs_bmdr_maxrecs(XFS_DFORK_SIZE(dip, mp, whichfork), 0));
 	for (i = 0; i < be16_to_cpu(dib->bb_numrecs); i++)
 		scan_lbtree(get_unaligned_be64(&pp[i]),
 			 be16_to_cpu(dib->bb_level), scanfunc_bmap, extmapp,
db/freesp.c +3 -3
index 6f234666..ef22fd6f 100644
@@ -242,15 +242,15 @@ scan_freelist(
 				XFS_FSS_TO_BB(mp, 1), DB_RING_IGN, NULL);
 
 	/* verify agf values before proceeding */
-	if (be32_to_cpu(agf->agf_flfirst) >= libxfs_agfl_size(mp) ||
-	    be32_to_cpu(agf->agf_fllast) >= libxfs_agfl_size(mp)) {
+	if (be32_to_cpu(agf->agf_flfirst) >= xfs_agfl_size(mp) ||
+	    be32_to_cpu(agf->agf_fllast) >= xfs_agfl_size(mp)) {
 		dbprintf(_("agf %d freelist blocks bad, skipping "
 			  "freelist scan\n"), seqno);
 		pop_cur();
 		return;
 	}
 
-	libxfs_agfl_walk(mp, agf, iocur_top->bp, scan_agfl, &seqno);
+	xfs_agfl_walk(mp, agf, iocur_top->bp, scan_agfl, &seqno);
 	pop_cur();
 }
 
db/fsmap.c +8 -8
index a6e61962..e1e206ce 100644
@@ -67,32 +67,32 @@ fsmap(
 		if (agno == end_ag)
 			high.rm_startblock = XFS_FSB_TO_AGBNO(mp, end_fsb);
 
-		error = -libxfs_alloc_read_agf(mp, NULL, agno, 0, &agbp);
+		error = -xfs_alloc_read_agf(mp, NULL, agno, 0, &agbp);
 		if (error) {
 			dbprintf(_("Error %d while reading AGF.\n"), error);
 			return;
 		}
 
-		bt_cur = libxfs_rmapbt_init_cursor(mp, NULL, agbp, agno);
+		bt_cur = xfs_rmapbt_init_cursor(mp, NULL, agbp, agno);
 		if (!bt_cur) {
-			libxfs_buf_relse(agbp);
+			xfs_buf_relse(agbp);
 			dbprintf(_("Not enough memory.\n"));
 			return;
 		}
 
 		info.agno = agno;
-		error = -libxfs_rmap_query_range(bt_cur, &low, &high,
+		error = -xfs_rmap_query_range(bt_cur, &low, &high,
 				fsmap_fn, &info);
 		if (error) {
-			libxfs_btree_del_cursor(bt_cur, XFS_BTREE_ERROR);
-			libxfs_buf_relse(agbp);
+			xfs_btree_del_cursor(bt_cur, XFS_BTREE_ERROR);
+			xfs_buf_relse(agbp);
 			dbprintf(_("Error %d while querying fsmap btree.\n"),
 				error);
 			return;
 		}
 
-		libxfs_btree_del_cursor(bt_cur, XFS_BTREE_NOERROR);
-		libxfs_buf_relse(agbp);
+		xfs_btree_del_cursor(bt_cur, XFS_BTREE_NOERROR);
+		xfs_buf_relse(agbp);
 
 		if (agno == start_ag)
 			low.rm_startblock = 0;
db/hash.c +1 -1
index 68c53e7f..2a5d71f8 100644
@@ -41,7 +41,7 @@ hash_f(
 {
 	xfs_dahash_t	hashval;
 
-	hashval = libxfs_da_hashname((unsigned char *)argv[1], (int)strlen(argv[1]));
+	hashval = xfs_da_hashname((unsigned char *)argv[1], (int)strlen(argv[1]));
 	dbprintf("0x%x\n", hashval);
 	return 0;
 }
db/info.c +6 -6
index 2731446d..6f50f6f6 100644
@@ -29,7 +29,7 @@ info_f(
 {
 	struct xfs_fsop_geom	geo;
 
-	libxfs_fs_geometry(&mp->m_sb, &geo, XFS_FS_GEOM_MAX_STRUCT_VER);
+	xfs_fs_geometry(&mp->m_sb, &geo, XFS_FS_GEOM_MAX_STRUCT_VER);
 	xfs_report_geom(&geo, fsdevice, x.logname, x.rtname);
 	return 0;
 }
@@ -72,24 +72,24 @@ print_agresv_info(
 	xfs_extlen_t	length = 0;
 	int		error;
 
-	error = -libxfs_refcountbt_calc_reserves(mp, NULL, agno, &ask, &used);
+	error = -xfs_refcountbt_calc_reserves(mp, NULL, agno, &ask, &used);
 	if (error)
 		xfrog_perror(error, "refcountbt");
-	error = -libxfs_finobt_calc_reserves(mp, NULL, agno, &ask, &used);
+	error = -xfs_finobt_calc_reserves(mp, NULL, agno, &ask, &used);
 	if (error)
 		xfrog_perror(error, "finobt");
-	error = -libxfs_rmapbt_calc_reserves(mp, NULL, agno, &ask, &used);
+	error = -xfs_rmapbt_calc_reserves(mp, NULL, agno, &ask, &used);
 	if (error)
 		xfrog_perror(error, "rmapbt");
 
-	error = -libxfs_read_agf(mp, NULL, agno, 0, &bp);
+	error = -xfs_read_agf(mp, NULL, agno, 0, &bp);
 	if (error)
 		xfrog_perror(error, "AGF");
 	agf = bp->b_addr;
 	length = be32_to_cpu(agf->agf_length);
 	free = be32_to_cpu(agf->agf_freeblks) +
 	       be32_to_cpu(agf->agf_flcount);
-	libxfs_buf_relse(bp);
+	xfs_buf_relse(bp);
 
 	printf("AG %d: length: %u free: %u reserved: %u used: %u",
 			agno, length, free, ask, used);
db/init.c +4 -4
index 19f0900a..927669d6 100644
@@ -110,7 +110,7 @@ init(
 	 */
 	memset(&xmount, 0, sizeof(struct xfs_mount));
 	libxfs_buftarg_init(&xmount, x.ddev, x.logdev, x.rtdev);
-	error = -libxfs_buf_read_uncached(xmount.m_ddev_targp, XFS_SB_DADDR,
+	error = -xfs_buf_read_uncached(xmount.m_ddev_targp, XFS_SB_DADDR,
 			1 << (XFS_MAX_SECTORSIZE_LOG - BBSHIFT), 0, &bp, NULL);
 	if (error) {
 		fprintf(stderr, _("%s: %s is invalid (cannot read first 512 "
@@ -119,8 +119,8 @@ init(
 	}
 
 	/* copy SB from buffer to in-core, converting architecture as we go */
-	libxfs_sb_from_disk(&xmount.m_sb, bp->b_addr);
-	libxfs_buf_relse(bp);
+	xfs_sb_from_disk(&xmount.m_sb, bp->b_addr);
+	xfs_buf_relse(bp);
 
 	sbp = &xmount.m_sb;
 	if (sbp->sb_magicnum != XFS_SB_MAGIC) {
@@ -153,7 +153,7 @@ init(
 	 */
 	if (sbp->sb_rootino != NULLFSINO &&
 	    xfs_sb_version_haslazysbcount(&mp->m_sb)) {
-		int error = -libxfs_initialize_perag_data(mp, sbp->sb_agcount);
+		int error = -xfs_initialize_perag_data(mp, sbp->sb_agcount);
 		if (error) {
 			fprintf(stderr,
 	_("%s: cannot init perag data (%d). Continuing anyway.\n"),
db/inode.c +2 -2
index 0cff9d63..804be77e 100644
@@ -688,7 +688,7 @@ set_cur_inode(
 		iocur_top->dirino = ino;
 
 	if (xfs_sb_version_hascrc(&mp->m_sb)) {
-		iocur_top->ino_crc_ok = libxfs_verify_cksum((char *)dip,
+		iocur_top->ino_crc_ok = xfs_verify_cksum((char *)dip,
 						    mp->m_sb.sb_inodesize,
 						    XFS_DINODE_CRC_OFF);
 		if (!iocur_top->ino_crc_ok)
@@ -708,6 +708,6 @@ xfs_inode_set_crc(
 	ASSERT(iocur_top->ino_buf);
 	ASSERT(iocur_top->bp == bp);
 
-	libxfs_dinode_calc_crc(mp, iocur_top->data);
+	xfs_dinode_calc_crc(mp, iocur_top->data);
 	iocur_top->ino_crc_ok = 1;
 }
db/io.c +6 -6
index 6628d061..d5eecdb4 100644
@@ -96,7 +96,7 @@ pop_cur(void)
 		return;
 	}
 	if (iocur_top->bp) {
-		libxfs_buf_relse(iocur_top->bp);
+		xfs_buf_relse(iocur_top->bp);
 		iocur_top->bp = NULL;
 	}
 	if (iocur_top->bbmap) {
@@ -426,7 +426,7 @@ write_cur_buf(void)
 {
 	int ret;
 
-	ret = -libxfs_bwrite(iocur_top->bp);
+	ret = -xfs_bwrite(iocur_top->bp);
 	if (ret != 0)
 		dbprintf(_("write error: %s\n"), strerror(ret));
 
@@ -442,7 +442,7 @@ write_cur_bbs(void)
 {
 	int ret;
 
-	ret = -libxfs_bwrite(iocur_top->bp);
+	ret = -xfs_bwrite(iocur_top->bp);
 	if (ret != 0)
 		dbprintf(_("write error: %s\n"), strerror(ret));
 
@@ -496,7 +496,7 @@ write_cur(void)
 	/* If we didn't write the crc automatically, re-check inode validity */
 	if (xfs_sb_version_hascrc(&mp->m_sb) &&
 	    skip_crc && iocur_top->ino_buf) {
-		iocur_top->ino_crc_ok = libxfs_verify_cksum(iocur_top->data,
+		iocur_top->ino_crc_ok = xfs_verify_cksum(iocur_top->data,
 						mp->m_sb.sb_inodesize,
 						XFS_DINODE_CRC_OFF);
 	}
@@ -543,11 +543,11 @@ set_cur(
 		if (!iocur_top->bbmap)
 			return;
 		memcpy(iocur_top->bbmap, bbmap, sizeof(struct bbmap));
-		error = -libxfs_buf_read_map(mp->m_ddev_targp, bbmap->b,
+		error = -xfs_buf_read_map(mp->m_ddev_targp, bbmap->b,
 				bbmap->nmaps, LIBXFS_READBUF_SALVAGE, &bp,
 				ops);
 	} else {
-		error = -libxfs_buf_read(mp->m_ddev_targp, blknum, len,
+		error = -xfs_buf_read(mp->m_ddev_targp, blknum, len,
 				LIBXFS_READBUF_SALVAGE, &bp, ops);
 		iocur_top->bbmap = NULL;
 	}
db/logformat.c +1 -1
index 3374c29b..53629f65 100644
@@ -160,7 +160,7 @@ logres_f(
 	end_res = (struct xfs_trans_res *)(M_RES(mp) + 1);
 	for (i = 0; res < end_res; i++, res++)
 		print_logres(i, res);
-	libxfs_log_get_max_trans_res(mp, &resv);
+	xfs_log_get_max_trans_res(mp, &resv);
 	print_logres(-1, &resv);
 
 	return 0;
db/metadump.c +17 -17
index e5cb3aa5..28d4841e 100644
@@ -882,7 +882,7 @@ obfuscate_name(
 		*first ^= 0x10;
 		ASSERT(!is_invalid_char(*first));
 	}
-	ASSERT(libxfs_da_hashname(name, name_len) == hash);
+	ASSERT(xfs_da_hashname(name, name_len) == hash);
 }
 
 /*
@@ -1206,7 +1206,7 @@ generate_obfuscated_name(
 
 	/* Obfuscate the name (if possible) */
 
-	hash = libxfs_da_hashname(name, namelen);
+	hash = xfs_da_hashname(name, namelen);
 	obfuscate_name(hash, namelen, name);
 
 	/*
@@ -1269,7 +1269,7 @@ process_sf_dir(
 			namelen = ino_dir_size - ((char *)&sfep->name[0] -
 					 (char *)sfp);
 		} else if ((char *)sfep - (char *)sfp +
-				libxfs_dir2_sf_entsize(mp, sfp, sfep->namelen) >
+				xfs_dir2_sf_entsize(mp, sfp, sfep->namelen) >
 				ino_dir_size) {
 			if (show_warnings)
 				print_warning("entry length in dir inode %llu "
@@ -1282,11 +1282,11 @@ process_sf_dir(
 
 		if (obfuscate)
 			generate_obfuscated_name(
-					 libxfs_dir2_sf_get_ino(mp, sfp, sfep),
+					 xfs_dir2_sf_get_ino(mp, sfp, sfep),
 					 namelen, &sfep->name[0]);
 
 		sfep = (xfs_dir2_sf_entry_t *)((char *)sfep +
-				libxfs_dir2_sf_entsize(mp, sfp, namelen));
+				xfs_dir2_sf_entsize(mp, sfp, namelen));
 	}
 
 	/* zero stale data in rest of space in data fork, if any */
@@ -1319,7 +1319,7 @@ obfuscate_path_components(
 		if (!slash) {
 			/* last (or single) component */
 			namelen = strnlen((char *)comp, len);
-			hash = libxfs_da_hashname(comp, namelen);
+			hash = xfs_da_hashname(comp, namelen);
 			obfuscate_name(hash, namelen, comp);
 			break;
 		}
@@ -1330,7 +1330,7 @@ obfuscate_path_components(
 			len--;
 			continue;
 		}
-		hash = libxfs_da_hashname(comp, namelen);
+		hash = xfs_da_hashname(comp, namelen);
 		obfuscate_name(hash, namelen, comp);
 		comp += namelen + 1;
 		len -= namelen + 1;
@@ -1433,7 +1433,7 @@ process_dir_free_block(
 		return;
 
 	free = (struct xfs_dir2_free *)block;
-	libxfs_dir2_free_hdr_from_disk(mp, &freehdr, free);
+	xfs_dir2_free_hdr_from_disk(mp, &freehdr, free);
 
 	switch (freehdr.magic) {
 	case XFS_DIR2_FREE_MAGIC:
@@ -1471,7 +1471,7 @@ process_dir_leaf_block(
 
 	/* Yes, this works for dir2 & dir3.  Difference is padding. */
 	leaf = (struct xfs_dir2_leaf *)block;
-	libxfs_dir2_leaf_hdr_from_disk(mp, &leafhdr, leaf);
+	xfs_dir2_leaf_hdr_from_disk(mp, &leafhdr, leaf);
 
 	switch (leafhdr.magic) {
 	case XFS_DIR2_LEAF1_MAGIC:
@@ -1602,7 +1602,7 @@ process_dir_data_block(
 		}
 
 		dep = (xfs_dir2_data_entry_t *)ptr;
-		length = libxfs_dir2_data_entsize(mp, dep->namelen);
+		length = xfs_dir2_data_entsize(mp, dep->namelen);
 
 		if (dir_offset + length > end_of_data ||
 		    ptr + length > endptr) {
@@ -1612,7 +1612,7 @@ process_dir_data_block(
 					(long long)cur_ino);
 			return;
 		}
-		if (be16_to_cpu(*libxfs_dir2_data_entry_tag_p(mp, dep)) !=
+		if (be16_to_cpu(*xfs_dir2_data_entry_tag_p(mp, dep)) !=
 				dir_offset)
 			return;
 
@@ -1625,7 +1625,7 @@ process_dir_data_block(
 		if (zero_stale_data) {
 			/* 1 byte for ftype; don't bother with conditional */
 			int zlen =
-				(char *)libxfs_dir2_data_entry_tag_p(mp, dep) -
+				(char *)xfs_dir2_data_entry_tag_p(mp, dep) -
 				(char *)&dep->name[dep->namelen] - 1;
 			if (zlen > 0) {
 				memset(&dep->name[dep->namelen] + 1, 0, zlen);
@@ -1877,7 +1877,7 @@ process_single_fsb_objects(
 				struct xfs_da3_icnode_hdr hdr;
 				int used;
 
-				libxfs_da3_node_hdr_from_disk(mp, &hdr, node);
+				xfs_da3_node_hdr_from_disk(mp, &hdr, node);
 				switch (btype) {
 				case TYP_DIR2:
 					used = mp->m_dir_geo->node_hdr_size;
@@ -2225,7 +2225,7 @@ process_btinode(
 					    nrecs, itype);
 	}
 
-	maxrecs = libxfs_bmdr_maxrecs(XFS_DFORK_SIZE(dip, mp, whichfork), 0);
+	maxrecs = xfs_bmdr_maxrecs(XFS_DFORK_SIZE(dip, mp, whichfork), 0);
 	if (nrecs > maxrecs) {
 		if (show_warnings)
 			print_warning("invalid numrecs (%u) in inode %lld %s "
@@ -2374,7 +2374,7 @@ process_inode(
 
 	/* we only care about crc recalculation if we will modify the inode. */
 	if (obfuscate || zero_stale_data) {
-		crc_was_ok = libxfs_verify_cksum((char *)dip,
+		crc_was_ok = xfs_verify_cksum((char *)dip,
 					mp->m_sb.sb_inodesize,
 					offsetof(struct xfs_dinode, di_crc));
 	}
@@ -2441,7 +2441,7 @@ done:
 		need_new_crc = 1;
 
 	if (crc_was_ok && need_new_crc)
-		libxfs_dinode_calc_crc(mp, dip);
+		xfs_dinode_calc_crc(mp, dip);
 	return success;
 }
 
@@ -2752,7 +2752,7 @@ scan_ag(
 			i = be32_to_cpu(agf->agf_fllast);
 
 			for (;;) {
-				if (++i == libxfs_agfl_size(mp))
+				if (++i == xfs_agfl_size(mp))
 					i = 0;
 				if (i == be32_to_cpu(agf->agf_flfirst))
 					break;
db/sb.c +5 -5
index 8a303422..9651a3b3 100644
@@ -189,7 +189,7 @@ get_sb(xfs_agnumber_t agno, xfs_sb_t *sb)
 		return 0;
 	}
 
-	libxfs_sb_from_disk(sb, iocur_top->data);
+	xfs_sb_from_disk(sb, iocur_top->data);
 
 	if (sb->sb_magicnum != XFS_SB_MAGIC) {
 		dbprintf(_("bad sb magic # %#x in AG %u\n"),
@@ -344,7 +344,7 @@ do_uuid(xfs_agnumber_t agno, uuid_t *uuid)
 		   uuid_equal(uuid, &mp->m_sb.sb_meta_uuid)) {
 		memset(&tsb.sb_meta_uuid, 0, sizeof(uuid_t));
 		/* Write those zeros now; it's ignored once we clear the flag */
-		libxfs_sb_to_disk(iocur_top->data, &tsb);
+		xfs_sb_to_disk(iocur_top->data, &tsb);
 		mp->m_sb.sb_features_incompat &=
 						~XFS_SB_FEAT_INCOMPAT_META_UUID;
 		tsb.sb_features_incompat &= ~XFS_SB_FEAT_INCOMPAT_META_UUID;
@@ -352,7 +352,7 @@ do_uuid(xfs_agnumber_t agno, uuid_t *uuid)
 
 write:
 	memcpy(&tsb.sb_uuid, uuid, sizeof(uuid_t));
-	libxfs_sb_to_disk(iocur_top->data, &tsb);
+	xfs_sb_to_disk(iocur_top->data, &tsb);
 	write_cur();
 	return uuid;
 }
@@ -516,7 +516,7 @@ do_label(xfs_agnumber_t agno, char *label)
 	memset(&tsb.sb_fname, 0, sizeof(tsb.sb_fname));
 	memcpy(&tsb.sb_fname, label, len);
 	memcpy(&lbl[0], &tsb.sb_fname, sizeof(tsb.sb_fname));
-	libxfs_sb_to_disk(iocur_top->data, &tsb);
+	xfs_sb_to_disk(iocur_top->data, &tsb);
 	write_cur();
 	return &lbl[0];
 }
@@ -615,7 +615,7 @@ do_version(xfs_agnumber_t agno, uint16_t version, uint32_t features)
 	tsb.sb_versionnum = version;
 	tsb.sb_features2 = features;
 	tsb.sb_bad_features2 = features;
-	libxfs_sb_to_disk(iocur_top->data, &tsb);
+	xfs_sb_to_disk(iocur_top->data, &tsb);
 	write_cur();
 	return 1;
 }
include/cache.h +1 -1
index 334ad263..bca9f6bb 100644
@@ -33,7 +33,7 @@ enum {
  * For prefetch support, the top half of the range starts at
  * CACHE_PREFETCH_PRIORITY and everytime the buffer is fetched and is at or
  * above this priority level, it is reduced to below this level (refer to
- * libxfs_buf_get).
+ * xfs_buf_get).
  *
  * If we have dirty nodes, we can't recycle them until they've been cleaned. To
  * keep these out of the reclaimable lists (as there can be lots of them) give
include/libxfs.h +3 -4
index 12447835..cfc5260d 100644
@@ -7,7 +7,6 @@
 #ifndef __LIBXFS_H__
 #define __LIBXFS_H__
 
-#include "libxfs_api_defs.h"
 #include "platform_defs.h"
 #include "xfs.h"
 
@@ -157,7 +156,7 @@ extern int	libxfs_log_header(char *, uuid_t *, int, int, int, xfs_lsn_t,
 
 /* Shared utility routines */
 
-extern int	libxfs_alloc_file_space (struct xfs_inode *, xfs_off_t,
+extern int	xfs_alloc_file_space (struct xfs_inode *, xfs_off_t,
 				xfs_off_t, int, int);
 
 /* XXX: this is messy and needs fixing */
@@ -210,8 +209,8 @@ libxfs_bmbt_disk_get_all(
 
 /* XXX: this is clearly a bug - a shared header needs to export this */
 /* xfs_rtalloc.c */
-int libxfs_rtfree_extent(struct xfs_trans *, xfs_rtblock_t, xfs_extlen_t);
-bool libxfs_verify_rtbno(struct xfs_mount *mp, xfs_rtblock_t rtbno);
+int xfs_rtfree_extent(struct xfs_trans *, xfs_rtblock_t, xfs_extlen_t);
+bool xfs_verify_rtbno(struct xfs_mount *mp, xfs_rtblock_t rtbno);
 
 #include "xfs_attr.h"
 
include/xfs_inode.h +4 -4
index 3caeeb39..5a34c681 100644
@@ -146,20 +146,20 @@ typedef struct cred {
 	gid_t	cr_gid;
 } cred_t;
 
-extern int	libxfs_inode_alloc (struct xfs_trans **, struct xfs_inode *,
+extern int	xfs_inode_alloc (struct xfs_trans **, struct xfs_inode *,
 				mode_t, nlink_t, xfs_dev_t, struct cred *,
 				struct fsxattr *, struct xfs_inode **);
-extern void	libxfs_trans_inode_alloc_buf (struct xfs_trans *,
+extern void	xfs_trans_inode_alloc_buf (struct xfs_trans *,
 				struct xfs_buf *);
 
-extern void	libxfs_trans_ichgtime(struct xfs_trans *,
+extern void	xfs_trans_ichgtime(struct xfs_trans *,
 				struct xfs_inode *, int);
 extern int	libxfs_iflush_int (struct xfs_inode *, struct xfs_buf *);
 
 extern struct timespec64 current_time(struct inode *inode);
 
 /* Inode Cache Interfaces */
-extern bool	libxfs_inode_verify_forks(struct xfs_inode *ip);
+extern bool	xfs_inode_verify_forks(struct xfs_inode *ip);
 extern int	libxfs_iget(struct xfs_mount *, struct xfs_trans *, xfs_ino_t,
 				uint, struct xfs_inode **,
 				struct xfs_ifork_ops *);
include/xfs_trans.h +24 -24

88 lines not on this page · raw message

io/open.c +1 -1
index 9a8b5e5c..bc94ca2b 100644
@@ -754,7 +754,7 @@ get_last_inode(void)
 
 	/* The last inode number in use */
 	last_ino = ireq->inumbers[lastgrp].xi_startino +
-		  libxfs_highbit64(ireq->inumbers[lastgrp].xi_allocmask);
+		  xfs_highbit64(ireq->inumbers[lastgrp].xi_allocmask);
 out:
 	free(ireq);
 
libxfs/Makefile +0 -1
index 44b23816..b7b6f770 100644
@@ -49,7 +49,6 @@ HFILES = \
 	xfs_trans_resv.h \
 	xfs_trans_space.h \
 	libxfs_io.h \
-	libxfs_api_defs.h \
 	init.h \
 	libxfs_priv.h \
 	xfs_dir2_priv.h
libxfs/cache.c +1 -1
index 139c7c1b..31a4438f 100644
@@ -53,7 +53,7 @@ cache_init(
 	cache->c_misses = 0;
 	cache->c_maxcount = maxcount;
 	cache->c_hashsize = hashsize;
-	cache->c_hashshift = libxfs_highbit32(hashsize);
+	cache->c_hashshift = xfs_highbit32(hashsize);
 	cache->hash = cache_operations->hash;
 	cache->alloc = cache_operations->alloc;
 	cache->flush = cache_operations->flush;
libxfs/init.c +8 -8
index cb8967bc..81dc8a9e 100644
@@ -456,14 +456,14 @@ rtmount_init(
 			(unsigned long long) mp->m_sb.sb_rblocks);
 		return -1;
 	}
-	error = libxfs_buf_read(mp->m_rtdev, d - XFS_FSB_TO_BB(mp, 1),
+	error = xfs_buf_read(mp->m_rtdev, d - XFS_FSB_TO_BB(mp, 1),
 			XFS_FSB_TO_BB(mp, 1), 0, &bp, NULL);
 	if (error) {
 		fprintf(stderr, _("%s: realtime size check failed\n"),
 			progname);
 		return -1;
 	}
-	libxfs_buf_relse(bp);
+	xfs_buf_relse(bp);
 	return 0;
 }
 
@@ -736,20 +736,20 @@ libxfs_mount(
 		return mp;
 
 	/* device size checks must pass unless we're a debugger. */
-	error = libxfs_buf_read(mp->m_dev, d - XFS_FSS_TO_BB(mp, 1),
+	error = xfs_buf_read(mp->m_dev, d - XFS_FSS_TO_BB(mp, 1),
 			XFS_FSS_TO_BB(mp, 1), 0, &bp, NULL);
 	if (error) {
 		fprintf(stderr, _("%s: data size check failed\n"), progname);
 		if (!debugger)
 			return NULL;
 	} else
-		libxfs_buf_relse(bp);
+		xfs_buf_relse(bp);
 
 	if (mp->m_logdev_targp->dev &&
 	    mp->m_logdev_targp->dev != mp->m_ddev_targp->dev) {
 		d = (xfs_daddr_t) XFS_FSB_TO_BB(mp, mp->m_sb.sb_logblocks);
 		if (XFS_BB_TO_FSB(mp, d) != mp->m_sb.sb_logblocks ||
-		    libxfs_buf_read(mp->m_logdev_targp,
+		    xfs_buf_read(mp->m_logdev_targp,
 				d - XFS_FSB_TO_BB(mp, 1), XFS_FSB_TO_BB(mp, 1),
 				0, &bp, NULL)) {
 			fprintf(stderr, _("%s: log size checks failed\n"),
@@ -758,7 +758,7 @@ libxfs_mount(
 				return NULL;
 		}
 		if (bp)
-			libxfs_buf_relse(bp);
+			xfs_buf_relse(bp);
 	}
 
 	/* Initialize realtime fields in the mount structure */
@@ -776,7 +776,7 @@ libxfs_mount(
 	 * read the first one and let the user know to check the geometry.
 	 */
 	if (sbp->sb_agcount > 1000000) {
-		error = libxfs_buf_read(mp->m_dev,
+		error = xfs_buf_read(mp->m_dev,
 				XFS_AG_DADDR(mp, sbp->sb_agcount - 1, 0), 1,
 				0, &bp, NULL);
 		if (error) {
@@ -788,7 +788,7 @@ libxfs_mount(
 								progname);
 			sbp->sb_agcount = 1;
 		} else
-			libxfs_buf_relse(bp);
+			xfs_buf_relse(bp);
 	}
 
 	error = libxfs_initialize_perag(mp, sbp->sb_agcount, &mp->m_maxagi);
libxfs/libxfs_api_defs.h deleted +0 -191

191 lines not on this page · raw message

libxfs/libxfs_io.h +15 -15
index 34462f78..e6d758f9 100644
@@ -130,22 +130,22 @@ extern struct cache_operations	libxfs_bcache_operations;
 
 #ifdef XFS_BUF_TRACING
 
-#define libxfs_buf_read(dev, daddr, len, flags, bpp, ops) \
+#define xfs_buf_read(dev, daddr, len, flags, bpp, ops) \
 	libxfs_trace_readbuf(__FUNCTION__, __FILE__, __LINE__, \
 			    (dev), (daddr), (len), (flags), (bpp), (ops))
-#define libxfs_buf_read_map(dev, map, nmaps, flags, bpp, ops) \
+#define xfs_buf_read_map(dev, map, nmaps, flags, bpp, ops) \
 	libxfs_trace_readbuf_map(__FUNCTION__, __FILE__, __LINE__, \
 			    (dev), (map), (nmaps), (flags), (bpp), (ops))
 #define libxfs_buf_mark_dirty(buf) \
 	libxfs_trace_dirtybuf(__FUNCTION__, __FILE__, __LINE__, \
 			      (buf))
-#define libxfs_buf_get(dev, daddr, len, bpp) \
+#define xfs_buf_get(dev, daddr, len, bpp) \
 	libxfs_trace_getbuf(__FUNCTION__, __FILE__, __LINE__, \
 			    (dev), (daddr), (len), (bpp))
-#define libxfs_buf_get_map(dev, map, nmaps, flags, bpp) \
+#define xfs_buf_get_map(dev, map, nmaps, flags, bpp) \
 	libxfs_trace_getbuf_map(__FUNCTION__, __FILE__, __LINE__, \
 			    (dev), (map), (nmaps), (flags), (bpp))
-#define libxfs_buf_relse(buf) \
+#define xfs_buf_relse(buf) \
 	libxfs_trace_putbuf(__FUNCTION__, __FILE__, __LINE__, (buf))
 
 int libxfs_trace_readbuf(const char *func, const char *file, int line,
@@ -169,16 +169,16 @@ extern void	libxfs_trace_putbuf (const char *, const char *, int,
 
 #else
 
-int libxfs_buf_read_map(struct xfs_buftarg *btp, struct xfs_buf_map *maps,
+int xfs_buf_read_map(struct xfs_buftarg *btp, struct xfs_buf_map *maps,
 			int nmaps, int flags, struct xfs_buf **bpp,
 			const struct xfs_buf_ops *ops);
 void libxfs_buf_mark_dirty(struct xfs_buf *bp);
-int libxfs_buf_get_map(struct xfs_buftarg *btp, struct xfs_buf_map *maps,
+int xfs_buf_get_map(struct xfs_buftarg *btp, struct xfs_buf_map *maps,
 			int nmaps, int flags, struct xfs_buf **bpp);
-void	libxfs_buf_relse(struct xfs_buf *bp);
+void	xfs_buf_relse(struct xfs_buf *bp);
 
 static inline int
-libxfs_buf_get(
+xfs_buf_get(
 	struct xfs_buftarg	*target,
 	xfs_daddr_t		blkno,
 	size_t			numblks,
@@ -186,11 +186,11 @@ libxfs_buf_get(
 {
 	DEFINE_SINGLE_BUF_MAP(map, blkno, numblks);
 
-	return libxfs_buf_get_map(target, &map, 1, 0, bpp);
+	return xfs_buf_get_map(target, &map, 1, 0, bpp);
 }
 
 static inline int
-libxfs_buf_read(
+xfs_buf_read(
 	struct xfs_buftarg	*target,
 	xfs_daddr_t		blkno,
 	size_t			numblks,
@@ -200,7 +200,7 @@ libxfs_buf_read(
 {
 	DEFINE_SINGLE_BUF_MAP(map, blkno, numblks);
 
-	return libxfs_buf_read_map(target, &map, 1, flags, bpp, ops);
+	return xfs_buf_read_map(target, &map, 1, flags, bpp, ops);
 }
 
 #endif /* XFS_BUF_TRACING */
@@ -213,7 +213,7 @@ extern void	libxfs_bcache_flush(void);
 extern int	libxfs_bcache_overflowed(void);
 
 /* Buffer (Raw) Interfaces */
-int		libxfs_bwrite(struct xfs_buf *bp);
+int		xfs_bwrite(struct xfs_buf *bp);
 extern int	libxfs_readbufr(struct xfs_buftarg *, xfs_daddr_t, xfs_buf_t *, int, int);
 extern int	libxfs_readbufr_map(struct xfs_buftarg *, struct xfs_buf *, int);
 
@@ -243,9 +243,9 @@ xfs_buf_associate_memory(struct xfs_buf *bp, void *mem, size_t len)
 	return 0;
 }
 
-int libxfs_buf_get_uncached(struct xfs_buftarg *targ, size_t bblen, int flags,
+int xfs_buf_get_uncached(struct xfs_buftarg *targ, size_t bblen, int flags,
 		struct xfs_buf **bpp);
-int libxfs_buf_read_uncached(struct xfs_buftarg *targ, xfs_daddr_t daddr,
+int xfs_buf_read_uncached(struct xfs_buftarg *targ, xfs_daddr_t daddr,
 		size_t bblen, int flags, struct xfs_buf **bpp,
 		const struct xfs_buf_ops *ops);
 
libxfs/libxfs_priv.h +3 -4
index 5688284d..0d05fb2f 100644
@@ -37,7 +37,6 @@
 #ifndef __LIBXFS_INTERNAL_XFS_H__
 #define __LIBXFS_INTERNAL_XFS_H__
 
-#include "libxfs_api_defs.h"
 #include "platform_defs.h"
 #include "xfs.h"
 
@@ -573,8 +572,8 @@ xfs_buf_corruption_error(struct xfs_buf *bp, xfs_failaddr_t fa);
 
 /* XXX: this is clearly a bug - a shared header needs to export this */
 /* xfs_rtalloc.c */
-int libxfs_rtfree_extent(struct xfs_trans *, xfs_rtblock_t, xfs_extlen_t);
-bool libxfs_verify_rtbno(struct xfs_mount *mp, xfs_rtblock_t rtbno);
+int xfs_rtfree_extent(struct xfs_trans *, xfs_rtblock_t, xfs_extlen_t);
+bool xfs_verify_rtbno(struct xfs_mount *mp, xfs_rtblock_t rtbno);
 
 struct xfs_rtalloc_rec {
 	xfs_rtblock_t		ar_startext;
@@ -586,7 +585,7 @@ typedef int (*xfs_rtalloc_query_range_fn)(
 	struct xfs_rtalloc_rec	*rec,
 	void			*priv);
 
-int libxfs_zero_extent(struct xfs_inode *ip, xfs_fsblock_t start_fsb,
+int xfs_zero_extent(struct xfs_inode *ip, xfs_fsblock_t start_fsb,
                         xfs_off_t count_fsb);
 
 
libxfs/rdwr.c +33 -33

238 lines not on this page · raw message

libxfs/trans.c +39 -39

298 lines not on this page · raw message

libxfs/util.c +4 -4
index 914e4ca5..523d5950 100644
@@ -383,7 +383,7 @@ libxfs_iflush_int(xfs_inode_t *ip, xfs_buf_t *bp)
 		VFS_I(ip)->i_version++;
 
 	/* Check the inline fork data before we write out. */
-	if (!libxfs_inode_verify_forks(ip))
+	if (!xfs_inode_verify_forks(ip))
 		return -EFSCORRUPTED;
 
 	/*
@@ -432,7 +432,7 @@ libxfs_mod_incore_sb(
  * Originally derived from xfs_alloc_file_space().
  */
 int
-libxfs_alloc_file_space(
+xfs_alloc_file_space(
 	xfs_inode_t	*ip,
 	xfs_off_t	offset,
 	xfs_off_t	len,
@@ -516,7 +516,7 @@ error0:	/* Cancel bmap, cancel trans */
  * other in repair - now there is just the one.
  */
 int
-libxfs_inode_alloc(
+xfs_inode_alloc(
 	xfs_trans_t	**tp,
 	xfs_inode_t	*pip,
 	mode_t		mode,
@@ -700,7 +700,7 @@ xfs_fsb_to_db(struct xfs_inode *ip, xfs_fsblock_t fsb)
 }
 
 int
-libxfs_zero_extent(
+xfs_zero_extent(
 	struct xfs_inode *ip,
 	xfs_fsblock_t	start_fsb,
 	xfs_off_t	count_fsb)
libxlog/xfs_log_recover.c +14 -14
index 78fbafab..7db0be47 100644
@@ -69,7 +69,7 @@ xlog_get_bp(
 		nbblks += log->l_sectBBsize;
 	nbblks = round_up(nbblks, log->l_sectBBsize);
 
-	libxfs_buf_get_uncached(log->l_dev, nbblks, 0, &bp);
+	xfs_buf_get_uncached(log->l_dev, nbblks, 0, &bp);
 	return bp;
 }
 
@@ -270,7 +270,7 @@ xlog_find_verify_cycle(
 	*new_blk = -1;
 
 out:
-	libxfs_buf_relse(bp);
+	xfs_buf_relse(bp);
 	return error;
 }
 
@@ -379,7 +379,7 @@ xlog_find_verify_log_record(
 		*last_blk = i;
 
 out:
-	libxfs_buf_relse(bp);
+	xfs_buf_relse(bp);
 	return error;
 }
 
@@ -630,7 +630,7 @@ validate_head:
 			goto bp_err;
 	}
 
-	libxfs_buf_relse(bp);
+	xfs_buf_relse(bp);
 	if (head_blk == log_bbnum)
 		*return_head_blk = 0;
 	else
@@ -644,7 +644,7 @@ validate_head:
 	return 0;
 
  bp_err:
-	libxfs_buf_relse(bp);
+	xfs_buf_relse(bp);
 
 	if (error)
 		xfs_warn(log->l_mp, "failed to find log head");
@@ -741,7 +741,7 @@ xlog_find_tail(
 	}
 	if (!found) {
 		xfs_warn(log->l_mp, "%s: couldn't find sync record", __func__);
-		libxfs_buf_relse(bp);
+		xfs_buf_relse(bp);
 		ASSERT(0);
 		return XFS_ERROR(EIO);
 	}
@@ -854,7 +854,7 @@ xlog_find_tail(
 		error = xlog_clear_stale_blocks(log, tail_lsn);
 
 done:
-	libxfs_buf_relse(bp);
+	xfs_buf_relse(bp);
 
 	if (error)
 		xfs_warn(log->l_mp, "failed to locate log tail");
@@ -902,7 +902,7 @@ xlog_find_zeroed(
 	first_cycle = xlog_get_cycle(offset);
 	if (first_cycle == 0) {		/* completely zeroed log */
 		*blk_no = 0;
-		libxfs_buf_relse(bp);
+		xfs_buf_relse(bp);
 		return -1;
 	}
 
@@ -913,7 +913,7 @@ xlog_find_zeroed(
 
 	last_cycle = xlog_get_cycle(offset);
 	if (last_cycle != 0) {		/* log completely written to */
-		libxfs_buf_relse(bp);
+		xfs_buf_relse(bp);
 		return 0;
 	} else if (first_cycle != 1) {
 		/*
@@ -970,7 +970,7 @@ xlog_find_zeroed(
 
 	*blk_no = last_blk;
 bp_err:
-	libxfs_buf_relse(bp);
+	xfs_buf_relse(bp);
 	if (error)
 		return error;
 	return -1;
@@ -1453,7 +1453,7 @@ xlog_do_recovery_pass(
 			hblks = h_size / XLOG_HEADER_CYCLE_SIZE;
 			if (h_size % XLOG_HEADER_CYCLE_SIZE)
 				hblks++;
-			libxfs_buf_relse(hbp);
+			xfs_buf_relse(hbp);
 			hbp = xlog_get_bp(log, hblks);
 		} else {
 			hblks = 1;
@@ -1469,7 +1469,7 @@ xlog_do_recovery_pass(
 		return ENOMEM;
 	dbp = xlog_get_bp(log, BTOBB(h_size));
 	if (!dbp) {
-		libxfs_buf_relse(hbp);
+		xfs_buf_relse(hbp);
 		return ENOMEM;
 	}
 
@@ -1653,8 +1653,8 @@ xlog_do_recovery_pass(
 	}
 
  bread_err2:
-	libxfs_buf_relse(dbp);
+	xfs_buf_relse(dbp);
  bread_err1:
-	libxfs_buf_relse(hbp);
+	xfs_buf_relse(hbp);
 	return error;
 }
logprint/log_misc.c +2 -2
index be889887..9cf8a3c0 100644
@@ -489,12 +489,12 @@ xlog_print_dir2_sf(
 	count = sfp->count;
 	sfep = xfs_dir2_sf_firstentry(sfp);
 	for (i = 0; i < count; i++) {
-		ino = libxfs_dir2_sf_get_ino(log->l_mp, sfp, sfep);
+		ino = xfs_dir2_sf_get_ino(log->l_mp, sfp, sfep);
 		memmove(namebuf, (sfep->name), sfep->namelen);
 		namebuf[sfep->namelen] = '\0';
 		printf(_("%s ino 0x%llx namelen %d\n"),
 		       namebuf, (unsigned long long)ino, sfep->namelen);
-		sfep = libxfs_dir2_sf_nextentry(log->l_mp, sfp, sfep);
+		sfep = xfs_dir2_sf_nextentry(log->l_mp, sfp, sfep);
 	}
 }
 
logprint/log_print_all.c +1 -1
index e2e28b9c..6ce09a51 100644
@@ -39,7 +39,7 @@ xlog_print_find_oldest(
 		error = xlog_find_cycle_start(log, bp, first_blk,
 					      last_blk, last_half_cycle);
 
-	libxfs_buf_relse(bp);
+	xfs_buf_relse(bp);
 	return error;
 }
 
logprint/logprint.c +1 -1
index e882c5d4..b86a2dac 100644
@@ -79,7 +79,7 @@ logstat(xfs_mount_t *mp)
 		 * Conjure up a mount structure
 		 */
 		sb = &mp->m_sb;
-		libxfs_sb_from_disk(sb, (xfs_dsb_t *)buf);
+		xfs_sb_from_disk(sb, (xfs_dsb_t *)buf);
 		mp->m_blkbb_log = sb->sb_blocklog - BBSHIFT;
 
 		x.logBBsize = XFS_FSB_TO_BB(mp, sb->sb_logblocks);
mdrestore/xfs_mdrestore.c +2 -2
index 1cd399db..665e63fc 100644
@@ -89,7 +89,7 @@ perform_restore(
 	if (fread(block_buffer, mb_count << mbp->mb_blocklog, 1, src_f) != 1)
 		fatal("error reading from metadump file\n");
 
-	libxfs_sb_from_disk(&sb, (xfs_dsb_t *)block_buffer);
+	xfs_sb_from_disk(&sb, (xfs_dsb_t *)block_buffer);
 
 	if (sb.sb_magicnum != XFS_SB_MAGIC)
 		fatal("bad magic number for primary superblock\n");
@@ -163,7 +163,7 @@ perform_restore(
 
 	memset(block_buffer, 0, sb.sb_sectsize);
 	sb.sb_inprogress = 0;
-	libxfs_sb_to_disk((xfs_dsb_t *)block_buffer, &sb);
+	xfs_sb_to_disk((xfs_dsb_t *)block_buffer, &sb);
 	if (xfs_sb_version_hascrc(&sb)) {
 		xfs_update_cksum(block_buffer, sb.sb_sectsize,
 				 offsetof(struct xfs_sb, sb_crc));
mkfs/proto.c +56 -56

339 lines not on this page · raw message

mkfs/xfs_mkfs.c +42 -42

295 lines not on this page · raw message

repair/agheader.c +5 -5
index f28d8a7b..ab9b1bba 100644
@@ -79,18 +79,18 @@ verify_set_agf(xfs_mount_t *mp, xfs_agf_t *agf, xfs_agnumber_t i)
 	 * check first/last AGF fields.  if need be, lose the free
 	 * space in the AGFL, we'll reclaim it later.
 	 */
-	if (be32_to_cpu(agf->agf_flfirst) >= libxfs_agfl_size(mp)) {
+	if (be32_to_cpu(agf->agf_flfirst) >= xfs_agfl_size(mp)) {
 		do_warn(_("flfirst %d in agf %d too large (max = %u)\n"),
 			be32_to_cpu(agf->agf_flfirst),
-			i, libxfs_agfl_size(mp) - 1);
+			i, xfs_agfl_size(mp) - 1);
 		if (!no_modify)
 			agf->agf_flfirst = cpu_to_be32(0);
 	}
 
-	if (be32_to_cpu(agf->agf_fllast) >= libxfs_agfl_size(mp)) {
+	if (be32_to_cpu(agf->agf_fllast) >= xfs_agfl_size(mp)) {
 		do_warn(_("fllast %d in agf %d too large (max = %u)\n"),
 			be32_to_cpu(agf->agf_fllast),
-			i, libxfs_agfl_size(mp) - 1);
+			i, xfs_agfl_size(mp) - 1);
 		if (!no_modify)
 			agf->agf_fllast = cpu_to_be32(0);
 	}
@@ -338,7 +338,7 @@ secondary_sb_whack(
 	 * secondaries.
 	 *
 	 * Also, the in-core inode flags now have different meaning to the
-	 * on-disk flags, and so libxfs_sb_to_disk cannot directly write the
+	 * on-disk flags, and so xfs_sb_to_disk cannot directly write the
 	 * sb_gquotino/sb_pquotino fields without specific sb_qflags being set.
 	 * Hence we need to zero those fields directly in the sb buffer here.
 	 */
repair/attr_repair.c +22 -24

169 lines not on this page · raw message

repair/da_util.c +18 -18
index 5061880f..5e2e6f59 100644
@@ -64,7 +64,7 @@ da_read_buf(
 		map[i].bm_bn = XFS_FSB_TO_DADDR(mp, bmp[i].startblock);
 		map[i].bm_len = XFS_FSB_TO_BB(mp, bmp[i].blockcount);
 	}
-	libxfs_buf_read_map(mp->m_dev, map, nex, LIBXFS_READBUF_SALVAGE,
+	xfs_buf_read_map(mp->m_dev, map, nex, LIBXFS_READBUF_SALVAGE,
 			&bp, ops);
 	if (map != map_array)
 		free(map);
@@ -135,7 +135,7 @@ _("can't read %s block %u for inode %" PRIu64 "\n"),
 		}
 
 		node = bp->b_addr;
-		libxfs_da3_node_hdr_from_disk(mp, &nodehdr, node);
+		xfs_da3_node_hdr_from_disk(mp, &nodehdr, node);
 
 		if (whichfork == XFS_DATA_FORK &&
 		    (nodehdr.magic == XFS_DIR2_LEAFN_MAGIC ||
@@ -146,7 +146,7 @@ _("found non-root LEAFN node in inode %" PRIu64 " bno = %u\n"),
 					da_cursor->ino, bno);
 			}
 			*rbno = 0;
-			libxfs_buf_relse(bp);
+			xfs_buf_relse(bp);
 			return 1;
 		}
 
@@ -156,13 +156,13 @@ _("found non-root LEAFN node in inode %" PRIu64 " bno = %u\n"),
 _("bad %s magic number 0x%x in inode %" PRIu64 " bno = %u\n"),
 					FORKNAME(whichfork), nodehdr.magic,
 					da_cursor->ino, bno);
-			libxfs_buf_relse(bp);
+			xfs_buf_relse(bp);
 			goto error_out;
 		}
 
 		/* corrupt node; rebuild the dir. */
 		if (bp->b_error == -EFSBADCRC || bp->b_error == -EFSCORRUPTED) {
-			libxfs_buf_relse(bp);
+			xfs_buf_relse(bp);
 			do_warn(
 _("corrupt %s tree block %u for inode %" PRIu64 "\n"),
 				FORKNAME(whichfork), bno, da_cursor->ino);
@@ -174,7 +174,7 @@ _("corrupt %s tree block %u for inode %" PRIu64 "\n"),
 _("bad %s record count in inode %" PRIu64 ", count = %d, max = %d\n"),
 				FORKNAME(whichfork), da_cursor->ino,
 				nodehdr.count, geo->node_ents);
-			libxfs_buf_relse(bp);
+			xfs_buf_relse(bp);
 			goto error_out;
 		}
 
@@ -187,7 +187,7 @@ _("bad %s record count in inode %" PRIu64 ", count = %d, max = %d\n"),
 				do_warn(
 _("bad header depth for directory inode %" PRIu64 "\n"),
 					da_cursor->ino);
-				libxfs_buf_relse(bp);
+				xfs_buf_relse(bp);
 				i = -1;
 				goto error_out;
 			}
@@ -198,7 +198,7 @@ _("bad header depth for directory inode %" PRIu64 "\n"),
 				do_warn(
 _("bad %s btree for inode %" PRIu64 "\n"),
 					FORKNAME(whichfork), da_cursor->ino);
-				libxfs_buf_relse(bp);
+				xfs_buf_relse(bp);
 				goto error_out;
 			}
 		}
@@ -223,7 +223,7 @@ _("bad %s btree for inode %" PRIu64 "\n"),
 
 error_out:
 	while (i > 1 && i <= da_cursor->active) {
-		libxfs_buf_relse(da_cursor->level[i].bp);
+		xfs_buf_relse(da_cursor->level[i].bp);
 		i++;
 	}
 
@@ -253,7 +253,7 @@ release_da_cursor_int(
 		}
 		ASSERT(error != 0);
 
-		libxfs_buf_relse(cursor->level[level].bp);
+		xfs_buf_relse(cursor->level[level].bp);
 		cursor->level[level].bp = NULL;
 	}
 
@@ -314,7 +314,7 @@ verify_final_da_path(
 	 */
 	entry = cursor->level[this_level].index;
 	node = cursor->level[this_level].bp->b_addr;
-	libxfs_da3_node_hdr_from_disk(mp, &nodehdr, node);
+	xfs_da3_node_hdr_from_disk(mp, &nodehdr, node);
 
 	/*
 	 * check internal block consistency on this level -- ensure
@@ -406,10 +406,10 @@ _("would correct bad hashval in non-leaf %s block\n"
 
 	if (cursor->level[this_level].dirty && !no_modify) {
 		libxfs_buf_mark_dirty(cursor->level[this_level].bp);
-		libxfs_buf_relse(cursor->level[this_level].bp);
+		xfs_buf_relse(cursor->level[this_level].bp);
 	}
 	else
-		libxfs_buf_relse(cursor->level[this_level].bp);
+		xfs_buf_relse(cursor->level[this_level].bp);
 
 	cursor->level[this_level].bp = NULL;
 
@@ -505,7 +505,7 @@ verify_da_path(
 	 */
 	entry = cursor->level[this_level].index;
 	node = cursor->level[this_level].bp->b_addr;
-	libxfs_da3_node_hdr_from_disk(mp, &nodehdr, node);
+	xfs_da3_node_hdr_from_disk(mp, &nodehdr, node);
 
 	/* No entries in this node?  Tree is corrupt. */
[… more lines in the raw message]

Lines of this file are not shown. View the raw message.

repair/dino_chunks.c +10 -10
index 6685a4d2..f58b7058 100644

Lines of this file are not shown. View the raw message.

repair/dinode.c +20 -20
index 1f1cc26b..4c05eb89 100644

Lines of this file are not shown. View the raw message.

repair/dir2.c +44 -44

88 lines not on this page · raw message

repair/phase3.c +3 -3
index ca4dbee4..c025b476 100644

Lines of this file are not shown. View the raw message.

repair/phase4.c +6 -6
index 8197db06..0fad2db5 100644

Lines of this file are not shown. View the raw message.

repair/phase5.c +64 -64

128 lines not on this page · raw message

repair/phase6.c +183 -183

366 lines not on this page · raw message

repair/phase7.c +5 -5
index c2996470..78df1ae0 100644

Lines of this file are not shown. View the raw message.

repair/prefetch.c +9 -9
index 3ac49db1..402fdb34 100644

Lines of this file are not shown. View the raw message.

repair/rmap.c +36 -36

72 lines not on this page · raw message

repair/rt.c +4 -6
index d901e751..cca654ae 100644

Lines of this file are not shown. View the raw message.

repair/sb.c +5 -5
index 91a36dd3..0936f5be 100644

Lines of this file are not shown. View the raw message.

repair/scan.c +23 -23

46 lines not on this page · raw message

repair/xfs_repair.c +9 -9
index 9d72fa8e..91f72670 100644

Lines of this file are not shown. View the raw message.

tools/find-api-violations.sh +3 -35
index c25fccca..01f5565f 100755

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.26.2

Part of the diff is not shown here. View the raw message.

#1 lore raw

Eric, any comments this time? Last time you wanted to delay it a bit, but I'd really like this gone for good before the next resync round..

Reviewed-by on v1 1/1
#2 lore raw
In reply to Christoph Hellwig
Quoted 61 lines · Christoph Hellwig

For historical reasons xfsprogs tries to renamed xfs_* symbols used by tools (but not those used inside libxfs) to libxfs_. Remove this indirection to make it clear what function is being called, and to avoid having to keep the renaming header uptodate.

---
 copy/xfs_copy.c              |  10 +-
 db/agfl.c                    |   2 +-
 db/attrset.c                 |  28 +--
 db/bmap.c                    |   4 +-
 db/bmroot.c                  |   4 +-
 db/btdump.c                  |  18 +-
 db/btheight.c                |  14 +-
 db/check.c                   |  40 ++--
 db/dir2.c                    |  10 +-
 db/dir2sf.c                  |   8 +-
 db/frag.c                    |   2 +-
 db/freesp.c                  |   6 +-
 db/fsmap.c                   |  16 +-
 db/hash.c                    |   2 +-
 db/info.c                    |  12 +-
 db/init.c                    |   8 +-
 db/inode.c                   |   4 +-
 db/io.c                      |  12 +-
 db/logformat.c               |   2 +-
 db/metadump.c                |  34 ++--
 db/sb.c                      |  10 +-
 include/cache.h              |   2 +-
 include/libxfs.h             |   7 +-
 include/xfs_inode.h          |   8 +-
 include/xfs_trans.h          |  48 ++---
 io/open.c                    |   2 +-
 libxfs/Makefile              |   1 -
 libxfs/cache.c               |   2 +-
 libxfs/init.c                |  16 +-
 libxfs/libxfs_api_defs.h     | 191 ------------------
 libxfs/libxfs_io.h           |  30 +--
 libxfs/libxfs_priv.h         |   7 +-
 libxfs/rdwr.c                |  66 +++----
 libxfs/trans.c               |  78 ++++----
 libxfs/util.c                |   8 +-
 libxlog/xfs_log_recover.c    |  28 +--
 logprint/log_misc.c          |   4 +-
 logprint/log_print_all.c     |   2 +-
 logprint/logprint.c          |   2 +-
 mdrestore/xfs_mdrestore.c    |   4 +-
 mkfs/proto.c                 | 112 +++++------
 mkfs/xfs_mkfs.c              |  84 ++++----
 repair/agheader.c            |  10 +-
 repair/attr_repair.c         |  46 +++--
 repair/da_util.c             |  36 ++--
 repair/dino_chunks.c         |  20 +-
 repair/dinode.c              |  40 ++--
 repair/dir2.c                |  88 ++++-----
 repair/phase3.c              |   6 +-
 repair/phase4.c              |  12 +-
 repair/phase5.c              | 128 ++++++------
 repair/phase6.c              | 366 +++++++++++++++++------------------
 repair/phase7.c              |  10 +-
 repair/prefetch.c            |  18 +-
Quoted 8 lines
 repair/rmap.c                |  72 +++----
 repair/rt.c                  |  10 +-
 repair/sb.c                  |  10 +-
 repair/scan.c                |  46 ++---
 repair/xfs_repair.c          |  18 +-
 tools/find-api-violations.sh |  38 +---
 60 files changed, 846 insertions(+), 1076 deletions(-)
 delete mode 100644 libxfs/libxfs_api_defs.h

Hee hee, treewide changes...

Insofar as I really only doomscrolled the entire patch and didn't see anything at all^W^Wobviously wrong.

--D

Quoted 6,633 lines
copy/xfs_copy.c +5 -5
index 2d087f71..1dacb35a 100644
@@ -711,7 +711,7 @@ main(int argc, char **argv)
 
 	/* We don't yet know the sector size, so read maximal size */
 	libxfs_buftarg_init(&mbuf, xargs.ddev, xargs.logdev, xargs.rtdev);
-	error = -libxfs_buf_read_uncached(mbuf.m_ddev_targp, XFS_SB_DADDR,
+	error = -xfs_buf_read_uncached(mbuf.m_ddev_targp, XFS_SB_DADDR,
 			1 << (XFS_MAX_SECTORSIZE_LOG - BBSHIFT), 0, &sbp, NULL);
 	if (error) {
 		do_log(_("%s: couldn't read superblock, error=%d\n"),
@@ -720,12 +720,12 @@ main(int argc, char **argv)
 	}
 
 	sb = &mbuf.m_sb;
-	libxfs_sb_from_disk(sb, sbp->b_addr);
+	xfs_sb_from_disk(sb, sbp->b_addr);
 
 	/* Do it again, now with proper length and verifier */
-	libxfs_buf_relse(sbp);
+	xfs_buf_relse(sbp);
 
-	error = -libxfs_buf_read(mbuf.m_ddev_targp, XFS_SB_DADDR,
+	error = -xfs_buf_read(mbuf.m_ddev_targp, XFS_SB_DADDR,
 			1 << (sb->sb_sectlog - BBSHIFT), 0, &sbp,
 			&xfs_sb_buf_ops);
 	if (error) {
@@ -733,7 +733,7 @@ main(int argc, char **argv)
 				progname, error);
 		exit(1);
 	}
-	libxfs_buf_relse(sbp);
+	xfs_buf_relse(sbp);
 
 	mp = libxfs_mount(&mbuf, sb, xargs.ddev, xargs.logdev, xargs.rtdev, 0);
 	if (mp == NULL) {
db/agfl.c +1 -1
index f0f3f21a..2b9bff2a 100644
@@ -58,7 +58,7 @@ agfl_bno_size(
 	void	*obj,
 	int	startoff)
 {
-	return libxfs_agfl_size(mp);
+	return xfs_agfl_size(mp);
 }
 
 static void
db/attrset.c +14 -14
index b86ecec7..f7e50720 100644
@@ -84,16 +84,16 @@ attr_set_f(
 		switch (c) {
 		/* namespaces */
 		case 'r':
-			args.attr_filter |= LIBXFS_ATTR_ROOT;
-			args.attr_filter &= ~LIBXFS_ATTR_SECURE;
+			args.attr_filter |= XFS_ATTR_ROOT;
+			args.attr_filter &= ~XFS_ATTR_SECURE;
 			break;
 		case 'u':
-			args.attr_filter &= ~(LIBXFS_ATTR_ROOT |
-					      LIBXFS_ATTR_SECURE);
+			args.attr_filter &= ~(XFS_ATTR_ROOT |
+					      XFS_ATTR_SECURE);
 			break;
 		case 's':
-			args.attr_filter |= LIBXFS_ATTR_SECURE;
-			args.attr_filter &= ~LIBXFS_ATTR_ROOT;
+			args.attr_filter |= XFS_ATTR_SECURE;
+			args.attr_filter &= ~XFS_ATTR_ROOT;
 			break;
 
 		/* modifiers */
@@ -160,7 +160,7 @@ attr_set_f(
 		goto out;
 	}
 
-	if (libxfs_attr_set(&args)) {
+	if (xfs_attr_set(&args)) {
 		dbprintf(_("failed to set attr %s on inode %llu\n"),
 			args.name, (unsigned long long)iocur_top->ino);
 		goto out;
@@ -199,16 +199,16 @@ attr_remove_f(
 		switch (c) {
 		/* namespaces */
 		case 'r':
-			args.attr_filter |= LIBXFS_ATTR_ROOT;
-			args.attr_filter &= ~LIBXFS_ATTR_SECURE;
+			args.attr_filter |= XFS_ATTR_ROOT;
+			args.attr_filter &= ~XFS_ATTR_SECURE;
 			break;
 		case 'u':
-			args.attr_filter &= ~(LIBXFS_ATTR_ROOT |
-					      LIBXFS_ATTR_SECURE);
+			args.attr_filter &= ~(XFS_ATTR_ROOT |
+					      XFS_ATTR_SECURE);
 			break;
 		case 's':
-			args.attr_filter |= LIBXFS_ATTR_SECURE;
-			args.attr_filter &= ~LIBXFS_ATTR_ROOT;
+			args.attr_filter |= XFS_ATTR_SECURE;
+			args.attr_filter &= ~XFS_ATTR_ROOT;
 			break;
 
 		case 'n':
@@ -245,7 +245,7 @@ attr_remove_f(
 		goto out;
 	}
 
-	if (libxfs_attr_set(&args)) {
+	if (xfs_attr_set(&args)) {
 		dbprintf(_("failed to remove attr %s from inode %llu\n"),
 			(unsigned char *)args.name,
 			(unsigned long long)iocur_top->ino);
db/bmap.c +2 -2
index fdc70e95..d028a786 100644
@@ -78,7 +78,7 @@ bmap(
 		push_cur();
 		rblock = (xfs_bmdr_block_t *)XFS_DFORK_PTR(dip, whichfork);
 		fsize = XFS_DFORK_SIZE(dip, mp, whichfork);
-		pp = XFS_BMDR_PTR_ADDR(rblock, 1, libxfs_bmdr_maxrecs(fsize, 0));
+		pp = XFS_BMDR_PTR_ADDR(rblock, 1, xfs_bmdr_maxrecs(fsize, 0));
 		kp = XFS_BMDR_KEY_ADDR(rblock, 1);
 		bno = select_child(curoffset, kp, pp,
 					be16_to_cpu(rblock->bb_numrecs));
@@ -89,7 +89,7 @@ bmap(
 			if (be16_to_cpu(block->bb_level) == 0)
 				break;
 			pp = XFS_BMBT_PTR_ADDR(mp, block, 1,
-				libxfs_bmbt_maxrecs(mp, mp->m_sb.sb_blocksize, 0));
+				xfs_bmbt_maxrecs(mp, mp->m_sb.sb_blocksize, 0));
 			kp = XFS_BMBT_KEY_ADDR(mp, block, 1);
 			bno = select_child(curoffset, kp, pp,
 					be16_to_cpu(block->bb_numrecs));
db/bmroot.c +2 -2
index 0db526c6..6bf87a43 100644
@@ -128,7 +128,7 @@ bmroota_ptr_offset(
 	ASSERT(XFS_DFORK_Q(dip) && (char *)block == XFS_DFORK_APTR(dip));
 	ASSERT(be16_to_cpu(block->bb_level) > 0);
 	pp = XFS_BMDR_PTR_ADDR(block, idx,
-		libxfs_bmdr_maxrecs(XFS_DFORK_ASIZE(dip, mp), 0));
+		xfs_bmdr_maxrecs(XFS_DFORK_ASIZE(dip, mp), 0));
 	return bitize((int)((char *)pp - (char *)block));
 }
 
@@ -223,7 +223,7 @@ bmrootd_ptr_offset(
 	block = (xfs_bmdr_block_t *)((char *)obj + byteize(startoff));
 	ASSERT(be16_to_cpu(block->bb_level) > 0);
 	pp = XFS_BMDR_PTR_ADDR(block, idx,
-		libxfs_bmdr_maxrecs(XFS_DFORK_DSIZE(dip, mp), 0));
+		xfs_bmdr_maxrecs(XFS_DFORK_DSIZE(dip, mp), 0));
 	return bitize((int)((char *)pp - (char *)block));
 }
 
db/btdump.c +9 -9
index 920f595b..b9947c18 100644
@@ -212,10 +212,10 @@ dir_has_rightsib(
 	struct xfs_da3_icnode_hdr	nhdr;
 
 	if (level > 0) {
-		libxfs_da3_node_hdr_from_disk(mp, &nhdr, block);
+		xfs_da3_node_hdr_from_disk(mp, &nhdr, block);
 		return nhdr.forw != 0;
 	}
-	libxfs_dir2_leaf_hdr_from_disk(mp, &lhdr, block);
+	xfs_dir2_leaf_hdr_from_disk(mp, &lhdr, block);
 	return lhdr.forw != 0;
 }
 
@@ -229,10 +229,10 @@ dir_level(
 	switch (((struct xfs_da_intnode *)block)->hdr.info.magic) {
 	case cpu_to_be16(XFS_DIR2_LEAF1_MAGIC):
 	case cpu_to_be16(XFS_DIR2_LEAFN_MAGIC):
-		libxfs_dir2_leaf_hdr_from_disk(mp, &lhdr, block);
+		xfs_dir2_leaf_hdr_from_disk(mp, &lhdr, block);
 		return 0;
 	case cpu_to_be16(XFS_DA_NODE_MAGIC):
-		libxfs_da3_node_hdr_from_disk(mp, &nhdr, block);
+		xfs_da3_node_hdr_from_disk(mp, &nhdr, block);
 		return nhdr.level;
 	default:
 		return -1;
@@ -249,10 +249,10 @@ dir3_level(
 	switch (((struct xfs_da_intnode *)block)->hdr.info.magic) {
 	case cpu_to_be16(XFS_DIR3_LEAF1_MAGIC):
 	case cpu_to_be16(XFS_DIR3_LEAFN_MAGIC):
-		libxfs_dir2_leaf_hdr_from_disk(mp, &lhdr, block);
+		xfs_dir2_leaf_hdr_from_disk(mp, &lhdr, block);
 		return 0;
 	case cpu_to_be16(XFS_DA3_NODE_MAGIC):
-		libxfs_da3_node_hdr_from_disk(mp, &nhdr, block);
+		xfs_da3_node_hdr_from_disk(mp, &nhdr, block);
 		return nhdr.level;
 	default:
 		return -1;
@@ -268,7 +268,7 @@ attr_has_rightsib(
 	struct xfs_da3_icnode_hdr	nhdr;
 
 	if (level > 0) {
-		libxfs_da3_node_hdr_from_disk(mp, &nhdr, block);
+		xfs_da3_node_hdr_from_disk(mp, &nhdr, block);
 		return nhdr.forw != 0;
 	}
 	xfs_attr3_leaf_hdr_to_disk(mp->m_attr_geo, &lhdr, block);
@@ -287,7 +287,7 @@ attr_level(
 		xfs_attr3_leaf_hdr_to_disk(mp->m_attr_geo, &lhdr, block);
 		return 0;
 	case cpu_to_be16(XFS_DA_NODE_MAGIC):
-		libxfs_da3_node_hdr_from_disk(mp, &nhdr, block);
+		xfs_da3_node_hdr_from_disk(mp, &nhdr, block);
 		return nhdr.level;
 	default:
 		return -1;
@@ -306,7 +306,7 @@ attr3_level(
 		xfs_attr3_leaf_hdr_to_disk(mp->m_attr_geo, &lhdr, block);
 		return 0;
 	case cpu_to_be16(XFS_DA3_NODE_MAGIC):
-		libxfs_da3_node_hdr_from_disk(mp, &nhdr, block);
+		xfs_da3_node_hdr_from_disk(mp, &nhdr, block);
 		return nhdr.level;
 	default:
 		return -1;
db/btheight.c +7 -7
index 8aa17c89..5d4aa685 100644
@@ -14,12 +14,12 @@
 
 static int refc_maxrecs(struct xfs_mount *mp, int blocklen, int leaf)
 {
-	return libxfs_refcountbt_maxrecs(blocklen, leaf != 0);
+	return xfs_refcountbt_maxrecs(blocklen, leaf != 0);
 }
 
 static int rmap_maxrecs(struct xfs_mount *mp, int blocklen, int leaf)
 {
-	return libxfs_rmapbt_maxrecs(blocklen, leaf);
+	return xfs_rmapbt_maxrecs(blocklen, leaf);
 }
 
 struct btmap {
@@ -27,11 +27,11 @@ struct btmap {
 	int		(*maxrecs)(struct xfs_mount *mp, int blocklen,
 				   int leaf);
 } maps[] = {
-	{"bnobt", libxfs_allocbt_maxrecs},
-	{"cntbt", libxfs_allocbt_maxrecs},
-	{"inobt", libxfs_inobt_maxrecs},
-	{"finobt", libxfs_inobt_maxrecs},
-	{"bmapbt", libxfs_bmbt_maxrecs},
+	{"bnobt", xfs_allocbt_maxrecs},
+	{"cntbt", xfs_allocbt_maxrecs},
+	{"inobt", xfs_inobt_maxrecs},
+	{"finobt", xfs_inobt_maxrecs},
+	{"bmapbt", xfs_bmbt_maxrecs},
 	{"refcountbt", refc_maxrecs},
 	{"rmapbt", rmap_maxrecs},
 };
db/check.c +20 -20
index 12c03b6d..bc3c3e2a 100644
@@ -2269,7 +2269,7 @@ process_btinode(
 		return;
 	}
 	if (be16_to_cpu(dib->bb_numrecs) >
-			libxfs_bmdr_maxrecs(XFS_DFORK_SIZE(dip, mp, whichfork),
+			xfs_bmdr_maxrecs(XFS_DFORK_SIZE(dip, mp, whichfork),
 			be16_to_cpu(dib->bb_level) == 0)) {
 		if (!sflag || id->ilist)
 			dbprintf(_("numrecs for ino %lld %s fork bmap root too "
@@ -2287,7 +2287,7 @@ process_btinode(
 		*nex += be16_to_cpu(dib->bb_numrecs);
 		return;
 	} else {
-		pp = XFS_BMDR_PTR_ADDR(dib, 1, libxfs_bmdr_maxrecs(
+		pp = XFS_BMDR_PTR_ADDR(dib, 1, xfs_bmdr_maxrecs(
 				XFS_DFORK_SIZE(dip, mp, whichfork), 0));
 		for (i = 0; i < be16_to_cpu(dib->bb_numrecs); i++)
 			scan_lbtree(get_unaligned_be64(&pp[i]),
@@ -2358,7 +2358,7 @@ process_data_dir_v2(
 		return NULLFSINO;
 	}
 	db = xfs_dir2_da_to_db(mp->m_dir_geo, dabno);
-	bf = libxfs_dir2_data_bestfree_p(mp, data);
+	bf = xfs_dir2_data_bestfree_p(mp, data);
 	ptr = (char *)data + mp->m_dir_geo->data_entry_offset;
 	if (be32_to_cpu(block->magic) == XFS_DIR2_BLOCK_MAGIC ||
 	    be32_to_cpu(block->magic) == XFS_DIR3_BLOCK_MAGIC) {
@@ -2444,7 +2444,7 @@ process_data_dir_v2(
 					(int)((char *)dep - (char *)data));
 			error++;
 		}
-		tagp = libxfs_dir2_data_entry_tag_p(mp, dep);
+		tagp = xfs_dir2_data_entry_tag_p(mp, dep);
 		if ((char *)tagp >= endptr) {
 			if (!sflag || v)
 				dbprintf(_("dir %lld block %d bad entry at %d\n"),
@@ -2458,8 +2458,8 @@ process_data_dir_v2(
 			(char *)dep - (char *)data);
 		xname.name = dep->name;
 		xname.len = dep->namelen;
-		dir_hash_add(libxfs_dir2_hashname(mp, &xname), addr);
-		ptr += libxfs_dir2_data_entsize(mp, dep->namelen);
+		dir_hash_add(xfs_dir2_hashname(mp, &xname), addr);
+		ptr += xfs_dir2_data_entsize(mp, dep->namelen);
 		count++;
 		lastfree = 0;
 		lino = be64_to_cpu(dep->inumber);
@@ -2584,7 +2584,7 @@ process_data_dir_v2_freefind(
 	xfs_dir2_data_aoff_t	off;
 
 	off = (xfs_dir2_data_aoff_t)((char *)dup - (char *)data);
-	bf = libxfs_dir2_data_bestfree_p(mp, data);
+	bf = xfs_dir2_data_bestfree_p(mp, data);
 	if (be16_to_cpu(dup->length) <
 			be16_to_cpu(bf[XFS_DIR2_DATA_FD_COUNT - 1].length))
 		return NULL;
@@ -2752,7 +2752,7 @@ process_inode(
 
 	/* xfs_inode_from_disk expects to have an mp to work with */
 	xino.i_mount = mp;
-	libxfs_inode_from_disk(&xino, dip);
+	xfs_inode_from_disk(&xino, dip);
 
 	ino = XFS_AGINO_TO_INO(mp, be32_to_cpu(agf->agf_seqno), agino);
 	if (!isfree) {
@@ -2768,7 +2768,7 @@ process_inode(
 		error++;
 		return;
 	}
-	if (!libxfs_dinode_good_version(&mp->m_sb, dip->di_version)) {
+	if (!xfs_dinode_good_version(&mp->m_sb, dip->di_version)) {
 		if (isfree || v)
 			dbprintf(_("bad version number %#x for inode %lld\n"),
 				dip->di_version, ino);
@@ -3306,7 +3306,7 @@ process_leaf_node_dir_v2_int(
 	struct xfs_dir3_icleaf_hdr leafhdr;
 
 	leaf = iocur_top->data;
-	libxfs_dir2_leaf_hdr_from_disk(mp, &leafhdr, leaf);
+	xfs_dir2_leaf_hdr_from_disk(mp, &leafhdr, leaf);
 
 	switch (be16_to_cpu(leaf->hdr.info.magic)) {
 	case XFS_DIR3_LEAF1_MAGIC:
@@ -3364,7 +3364,7 @@ process_leaf_node_dir_v2_int(
 	case XFS_DA_NODE_MAGIC:
 	case XFS_DA3_NODE_MAGIC:
 		node = iocur_top->data;
-		libxfs_da3_node_hdr_from_disk(mp, &nodehdr, node);
+		xfs_da3_node_hdr_from_disk(mp, &nodehdr, node);
 		if (nodehdr.level < 1 || nodehdr.level > XFS_DA_NODE_MAXDEPTH) {
 			if (!sflag || v)
 				dbprintf(_("bad node block level %d for dir ino "
@@ -3671,7 +3671,7 @@ process_sf_dir_v2(
 	offset = mp->m_dir_geo->data_first_offset;
 	for (i = sf->count - 1, i8 = 0; i >= 0; i--) {
 		if ((intptr_t)sfe +
-		    libxfs_dir2_sf_entsize(mp, sf, sfe->namelen) -
+		    xfs_dir2_sf_entsize(mp, sf, sfe->namelen) -
 		    (intptr_t)sf > be64_to_cpu(dip->di_size)) {
 			if (!sflag)
 				dbprintf(_("dir %llu bad size in entry at %d\n"),
@@ -3680,7 +3680,7 @@ process_sf_dir_v2(
 			error++;
 			break;
 		}
-		lino = libxfs_dir2_sf_get_ino(mp, sf, sfe);
+		lino = xfs_dir2_sf_get_ino(mp, sf, sfe);
 		if (lino > XFS_DIR2_MAX_SHORT_INUM)
 			i8++;
 		cid = find_inode(lino, 1);
@@ -3710,8 +3710,8 @@ process_sf_dir_v2(
 		}
 		offset =
 			xfs_dir2_sf_get_offset(sfe) +
-			libxfs_dir2_sf_entsize(mp, sf, sfe->namelen);
-		sfe = libxfs_dir2_sf_nextentry(mp, sf, sfe);
+			xfs_dir2_sf_entsize(mp, sf, sfe->namelen);
+		sfe = xfs_dir2_sf_nextentry(mp, sf, sfe);
 	}
 	if (i < 0 && (intptr_t)sfe - (intptr_t)sf !=
 					be64_to_cpu(dip->di_size)) {
@@ -3727,7 +3727,7 @@ process_sf_dir_v2(
 			dbprintf(_("dir %llu offsets too high\n"), id->ino);
 		error++;
 	}
-	lino = libxfs_dir2_sf_get_parent_ino(sf);
+	lino = xfs_dir2_sf_get_parent_ino(sf);
 	if (lino > XFS_DIR2_MAX_SHORT_INUM)
 		i8++;
 	cid = find_inode(lino, 1);
@@ -3897,7 +3897,7 @@ scan_ag(
 		goto pop1_out;
 	}
 
-	libxfs_sb_from_disk(sb, iocur_top->data);
+	xfs_sb_from_disk(sb, iocur_top->data);
 
 	if (sb->sb_magicnum != XFS_SB_MAGIC) {
 		if (!sflag)
@@ -4110,8 +4110,8 @@ scan_freelist(
 	}
 
 	/* verify agf values before proceeding */
-	if (be32_to_cpu(agf->agf_flfirst) >= libxfs_agfl_size(mp) ||
-	    be32_to_cpu(agf->agf_fllast) >= libxfs_agfl_size(mp)) {
+	if (be32_to_cpu(agf->agf_flfirst) >= xfs_agfl_size(mp) ||
+	    be32_to_cpu(agf->agf_fllast) >= xfs_agfl_size(mp)) {
 		dbprintf(_("agf %d freelist blocks bad, skipping "
 			  "freelist scan\n"), seqno);
 		pop_cur();
@@ -4121,7 +4121,7 @@ scan_freelist(
 	/* open coded xfs_buf_to_agfl_bno */
 	state.count = 0;
 	state.agno = seqno;
-	libxfs_agfl_walk(mp, agf, iocur_top->bp, scan_agfl, &state);
+	xfs_agfl_walk(mp, agf, iocur_top->bp, scan_agfl, &state);
 	if (state.count != be32_to_cpu(agf->agf_flcount)) {
 		if (!sflag)
 			dbprintf(_("freeblk count %u != flcount %u in ag %u\n"),
db/dir2.c +5 -5
index 503dcdfe..beb104a0 100644
@@ -211,7 +211,7 @@ __dir2_data_entries_count(
 			ptr += be16_to_cpu(dup->length);
 		else {
 			dep = (xfs_dir2_data_entry_t *)ptr;
-			ptr += libxfs_dir2_data_entsize(mp, dep->namelen);
+			ptr += xfs_dir2_data_entsize(mp, dep->namelen);
 		}
 	}
 	return i;
@@ -235,7 +235,7 @@ __dir2_data_entry_offset(
 			ptr += be16_to_cpu(dup->length);
 		else {
 			dep = (xfs_dir2_data_entry_t *)ptr;
-			ptr += libxfs_dir2_data_entsize(mp, dep->namelen);
+			ptr += xfs_dir2_data_entsize(mp, dep->namelen);
 		}
 	}
 	return ptr;
@@ -486,7 +486,7 @@ dir2_data_union_tag_count(
 		end = (char *)&dep->namelen + sizeof(dep->namelen);
 		if (end > (char *)obj + mp->m_dir_geo->blksize)
 			return 0;
-		tagp = libxfs_dir2_data_entry_tag_p(mp, dep);
+		tagp = xfs_dir2_data_entry_tag_p(mp, dep);
 	}
 	end = (char *)tagp + sizeof(*tagp);
 	return end <= (char *)obj + mp->m_dir_geo->blksize;
@@ -508,7 +508,7 @@ dir2_data_union_tag_offset(
 		return bitize((int)((char *)xfs_dir2_data_unused_tag_p(dup) -
 				    (char *)dup));
 	dep = (xfs_dir2_data_entry_t *)dup;
-	return bitize((int)((char *)libxfs_dir2_data_entry_tag_p(mp, dep) -
+	return bitize((int)((char *)xfs_dir2_data_entry_tag_p(mp, dep) -
 			    (char *)dep));
 }
 
@@ -585,7 +585,7 @@ dir2_data_union_size(
 		return bitize(be16_to_cpu(dup->length));
 	else {
 		dep = (xfs_dir2_data_entry_t *)dup;
-		return bitize(libxfs_dir2_data_entsize(mp, dep->namelen));
+		return bitize(xfs_dir2_data_entsize(mp, dep->namelen));
 	}
 }
 
db/dir2sf.c +4 -4
index 8165b79b..e2b5354c 100644
@@ -167,8 +167,8 @@ dir2_sf_entry_size(
 	sf = (struct xfs_dir2_sf_hdr *)((char *)obj + byteize(startoff));
 	e = xfs_dir2_sf_firstentry(sf);
 	for (i = 0; i < idx; i++)
-		e = libxfs_dir2_sf_nextentry(mp, sf, e);
-	return bitize((int)libxfs_dir2_sf_entsize(mp, sf, e->namelen));
+		e = xfs_dir2_sf_nextentry(mp, sf, e);
+	return bitize((int)xfs_dir2_sf_entsize(mp, sf, e->namelen));
 }
 
 /*ARGSUSED*/
@@ -212,7 +212,7 @@ dir2_sf_list_offset(
 	sf = (struct xfs_dir2_sf_hdr *)((char *)obj + byteize(startoff));
 	e = xfs_dir2_sf_firstentry(sf);
 	for (i = 0; i < idx; i++)
-		e = libxfs_dir2_sf_nextentry(mp, sf, e);
+		e = xfs_dir2_sf_nextentry(mp, sf, e);
 	return bitize((int)((char *)e - (char *)sf));
 }
 
@@ -232,7 +232,7 @@ dir2sf_size(
 	sf = (struct xfs_dir2_sf_hdr *)((char *)obj + byteize(startoff));
 	e = xfs_dir2_sf_firstentry(sf);
 	for (i = 0; i < sf->count; i++)
-		e = libxfs_dir2_sf_nextentry(mp, sf, e);
+		e = xfs_dir2_sf_nextentry(mp, sf, e);
 	return bitize((int)((char *)e - (char *)sf));
 }
 
db/frag.c +1 -1
index 1cfc6c2c..ead1bc94 100644
@@ -248,7 +248,7 @@ process_btinode(
 		return;
 	}
 	pp = XFS_BMDR_PTR_ADDR(dib, 1,
-		libxfs_bmdr_maxrecs(XFS_DFORK_SIZE(dip, mp, whichfork), 0));
+		xfs_bmdr_maxrecs(XFS_DFORK_SIZE(dip, mp, whichfork), 0));
 	for (i = 0; i < be16_to_cpu(dib->bb_numrecs); i++)
 		scan_lbtree(get_unaligned_be64(&pp[i]),
 			 be16_to_cpu(dib->bb_level), scanfunc_bmap, extmapp,
db/freesp.c +3 -3
index 6f234666..ef22fd6f 100644
@@ -242,15 +242,15 @@ scan_freelist(
 				XFS_FSS_TO_BB(mp, 1), DB_RING_IGN, NULL);
 
 	/* verify agf values before proceeding */
-	if (be32_to_cpu(agf->agf_flfirst) >= libxfs_agfl_size(mp) ||
-	    be32_to_cpu(agf->agf_fllast) >= libxfs_agfl_size(mp)) {
+	if (be32_to_cpu(agf->agf_flfirst) >= xfs_agfl_size(mp) ||
+	    be32_to_cpu(agf->agf_fllast) >= xfs_agfl_size(mp)) {
 		dbprintf(_("agf %d freelist blocks bad, skipping "
 			  "freelist scan\n"), seqno);
 		pop_cur();
 		return;
 	}
 
-	libxfs_agfl_walk(mp, agf, iocur_top->bp, scan_agfl, &seqno);
+	xfs_agfl_walk(mp, agf, iocur_top->bp, scan_agfl, &seqno);
 	pop_cur();
 }
 
db/fsmap.c +8 -8
index a6e61962..e1e206ce 100644
@@ -67,32 +67,32 @@ fsmap(
 		if (agno == end_ag)
 			high.rm_startblock = XFS_FSB_TO_AGBNO(mp, end_fsb);
 
-		error = -libxfs_alloc_read_agf(mp, NULL, agno, 0, &agbp);
+		error = -xfs_alloc_read_agf(mp, NULL, agno, 0, &agbp);
 		if (error) {
 			dbprintf(_("Error %d while reading AGF.\n"), error);
 			return;
 		}
 
-		bt_cur = libxfs_rmapbt_init_cursor(mp, NULL, agbp, agno);
+		bt_cur = xfs_rmapbt_init_cursor(mp, NULL, agbp, agno);
 		if (!bt_cur) {
-			libxfs_buf_relse(agbp);
+			xfs_buf_relse(agbp);
 			dbprintf(_("Not enough memory.\n"));
 			return;
 		}
 
 		info.agno = agno;
-		error = -libxfs_rmap_query_range(bt_cur, &low, &high,
+		error = -xfs_rmap_query_range(bt_cur, &low, &high,
 				fsmap_fn, &info);
 		if (error) {
-			libxfs_btree_del_cursor(bt_cur, XFS_BTREE_ERROR);
-			libxfs_buf_relse(agbp);
+			xfs_btree_del_cursor(bt_cur, XFS_BTREE_ERROR);
+			xfs_buf_relse(agbp);
 			dbprintf(_("Error %d while querying fsmap btree.\n"),
 				error);
 			return;
 		}
 
-		libxfs_btree_del_cursor(bt_cur, XFS_BTREE_NOERROR);
-		libxfs_buf_relse(agbp);
+		xfs_btree_del_cursor(bt_cur, XFS_BTREE_NOERROR);
+		xfs_buf_relse(agbp);
 
 		if (agno == start_ag)
 			low.rm_startblock = 0;
db/hash.c +1 -1
index 68c53e7f..2a5d71f8 100644
@@ -41,7 +41,7 @@ hash_f(
 {
 	xfs_dahash_t	hashval;
 
-	hashval = libxfs_da_hashname((unsigned char *)argv[1], (int)strlen(argv[1]));
+	hashval = xfs_da_hashname((unsigned char *)argv[1], (int)strlen(argv[1]));
 	dbprintf("0x%x\n", hashval);
 	return 0;
 }
db/info.c +6 -6
index 2731446d..6f50f6f6 100644
@@ -29,7 +29,7 @@ info_f(
 {
 	struct xfs_fsop_geom	geo;
 
-	libxfs_fs_geometry(&mp->m_sb, &geo, XFS_FS_GEOM_MAX_STRUCT_VER);
+	xfs_fs_geometry(&mp->m_sb, &geo, XFS_FS_GEOM_MAX_STRUCT_VER);
 	xfs_report_geom(&geo, fsdevice, x.logname, x.rtname);
 	return 0;
 }
@@ -72,24 +72,24 @@ print_agresv_info(
 	xfs_extlen_t	length = 0;
 	int		error;
 
-	error = -libxfs_refcountbt_calc_reserves(mp, NULL, agno, &ask, &used);
+	error = -xfs_refcountbt_calc_reserves(mp, NULL, agno, &ask, &used);
 	if (error)
 		xfrog_perror(error, "refcountbt");
-	error = -libxfs_finobt_calc_reserves(mp, NULL, agno, &ask, &used);
+	error = -xfs_finobt_calc_reserves(mp, NULL, agno, &ask, &used);
 	if (error)
 		xfrog_perror(error, "finobt");
-	error = -libxfs_rmapbt_calc_reserves(mp, NULL, agno, &ask, &used);
+	error = -xfs_rmapbt_calc_reserves(mp, NULL, agno, &ask, &used);
 	if (error)
 		xfrog_perror(error, "rmapbt");
 
-	error = -libxfs_read_agf(mp, NULL, agno, 0, &bp);
+	error = -xfs_read_agf(mp, NULL, agno, 0, &bp);
 	if (error)
 		xfrog_perror(error, "AGF");
 	agf = bp->b_addr;
 	length = be32_to_cpu(agf->agf_length);
 	free = be32_to_cpu(agf->agf_freeblks) +
 	       be32_to_cpu(agf->agf_flcount);
-	libxfs_buf_relse(bp);
+	xfs_buf_relse(bp);
 
 	printf("AG %d: length: %u free: %u reserved: %u used: %u",
 			agno, length, free, ask, used);
db/init.c +4 -4
index 19f0900a..927669d6 100644
@@ -110,7 +110,7 @@ init(
 	 */
 	memset(&xmount, 0, sizeof(struct xfs_mount));
 	libxfs_buftarg_init(&xmount, x.ddev, x.logdev, x.rtdev);
-	error = -libxfs_buf_read_uncached(xmount.m_ddev_targp, XFS_SB_DADDR,
+	error = -xfs_buf_read_uncached(xmount.m_ddev_targp, XFS_SB_DADDR,
 			1 << (XFS_MAX_SECTORSIZE_LOG - BBSHIFT), 0, &bp, NULL);
 	if (error) {
 		fprintf(stderr, _("%s: %s is invalid (cannot read first 512 "
@@ -119,8 +119,8 @@ init(
 	}
 
 	/* copy SB from buffer to in-core, converting architecture as we go */
-	libxfs_sb_from_disk(&xmount.m_sb, bp->b_addr);
-	libxfs_buf_relse(bp);
+	xfs_sb_from_disk(&xmount.m_sb, bp->b_addr);
+	xfs_buf_relse(bp);
 
 	sbp = &xmount.m_sb;
 	if (sbp->sb_magicnum != XFS_SB_MAGIC) {
@@ -153,7 +153,7 @@ init(
 	 */
 	if (sbp->sb_rootino != NULLFSINO &&
 	    xfs_sb_version_haslazysbcount(&mp->m_sb)) {
-		int error = -libxfs_initialize_perag_data(mp, sbp->sb_agcount);
+		int error = -xfs_initialize_perag_data(mp, sbp->sb_agcount);
 		if (error) {
 			fprintf(stderr,
 	_("%s: cannot init perag data (%d). Continuing anyway.\n"),
db/inode.c +2 -2
index 0cff9d63..804be77e 100644
@@ -688,7 +688,7 @@ set_cur_inode(
 		iocur_top->dirino = ino;
 
 	if (xfs_sb_version_hascrc(&mp->m_sb)) {
-		iocur_top->ino_crc_ok = libxfs_verify_cksum((char *)dip,
+		iocur_top->ino_crc_ok = xfs_verify_cksum((char *)dip,
 						    mp->m_sb.sb_inodesize,
 						    XFS_DINODE_CRC_OFF);
 		if (!iocur_top->ino_crc_ok)
@@ -708,6 +708,6 @@ xfs_inode_set_crc(
 	ASSERT(iocur_top->ino_buf);
 	ASSERT(iocur_top->bp == bp);
 
-	libxfs_dinode_calc_crc(mp, iocur_top->data);
+	xfs_dinode_calc_crc(mp, iocur_top->data);
 	iocur_top->ino_crc_ok = 1;
 }
db/io.c +6 -6
index 6628d061..d5eecdb4 100644
@@ -96,7 +96,7 @@ pop_cur(void)
 		return;
 	}
 	if (iocur_top->bp) {
-		libxfs_buf_relse(iocur_top->bp);
+		xfs_buf_relse(iocur_top->bp);
 		iocur_top->bp = NULL;
 	}
 	if (iocur_top->bbmap) {
@@ -426,7 +426,7 @@ write_cur_buf(void)
 {
 	int ret;
 
-	ret = -libxfs_bwrite(iocur_top->bp);
+	ret = -xfs_bwrite(iocur_top->bp);
 	if (ret != 0)
 		dbprintf(_("write error: %s\n"), strerror(ret));
 
@@ -442,7 +442,7 @@ write_cur_bbs(void)
 {
 	int ret;
 
-	ret = -libxfs_bwrite(iocur_top->bp);
+	ret = -xfs_bwrite(iocur_top->bp);
 	if (ret != 0)
 		dbprintf(_("write error: %s\n"), strerror(ret));
 
@@ -496,7 +496,7 @@ write_cur(void)
 	/* If we didn't write the crc automatically, re-check inode validity */
 	if (xfs_sb_version_hascrc(&mp->m_sb) &&
 	    skip_crc && iocur_top->ino_buf) {
-		iocur_top->ino_crc_ok = libxfs_verify_cksum(iocur_top->data,
+		iocur_top->ino_crc_ok = xfs_verify_cksum(iocur_top->data,
 						mp->m_sb.sb_inodesize,
 						XFS_DINODE_CRC_OFF);
 	}
@@ -543,11 +543,11 @@ set_cur(
 		if (!iocur_top->bbmap)
 			return;
 		memcpy(iocur_top->bbmap, bbmap, sizeof(struct bbmap));
-		error = -libxfs_buf_read_map(mp->m_ddev_targp, bbmap->b,
+		error = -xfs_buf_read_map(mp->m_ddev_targp, bbmap->b,
 				bbmap->nmaps, LIBXFS_READBUF_SALVAGE, &bp,
 				ops);
 	} else {
-		error = -libxfs_buf_read(mp->m_ddev_targp, blknum, len,
+		error = -xfs_buf_read(mp->m_ddev_targp, blknum, len,
 				LIBXFS_READBUF_SALVAGE, &bp, ops);
 		iocur_top->bbmap = NULL;
 	}
db/logformat.c +1 -1
index 3374c29b..53629f65 100644
@@ -160,7 +160,7 @@ logres_f(
 	end_res = (struct xfs_trans_res *)(M_RES(mp) + 1);
 	for (i = 0; res < end_res; i++, res++)
 		print_logres(i, res);
-	libxfs_log_get_max_trans_res(mp, &resv);
+	xfs_log_get_max_trans_res(mp, &resv);
 	print_logres(-1, &resv);
 
 	return 0;
db/metadump.c +17 -17
index e5cb3aa5..28d4841e 100644
@@ -882,7 +882,7 @@ obfuscate_name(
 		*first ^= 0x10;
 		ASSERT(!is_invalid_char(*first));
 	}
-	ASSERT(libxfs_da_hashname(name, name_len) == hash);
+	ASSERT(xfs_da_hashname(name, name_len) == hash);
 }
 
 /*
@@ -1206,7 +1206,7 @@ generate_obfuscated_name(
 
 	/* Obfuscate the name (if possible) */
 
-	hash = libxfs_da_hashname(name, namelen);
+	hash = xfs_da_hashname(name, namelen);
 	obfuscate_name(hash, namelen, name);
 
 	/*
@@ -1269,7 +1269,7 @@ process_sf_dir(
 			namelen = ino_dir_size - ((char *)&sfep->name[0] -
 					 (char *)sfp);
 		} else if ((char *)sfep - (char *)sfp +
-				libxfs_dir2_sf_entsize(mp, sfp, sfep->namelen) >
+				xfs_dir2_sf_entsize(mp, sfp, sfep->namelen) >
 				ino_dir_size) {
 			if (show_warnings)
 				print_warning("entry length in dir inode %llu "
@@ -1282,11 +1282,11 @@ process_sf_dir(
 
 		if (obfuscate)
 			generate_obfuscated_name(
-					 libxfs_dir2_sf_get_ino(mp, sfp, sfep),
+					 xfs_dir2_sf_get_ino(mp, sfp, sfep),
 					 namelen, &sfep->name[0]);
 
 		sfep = (xfs_dir2_sf_entry_t *)((char *)sfep +
-				libxfs_dir2_sf_entsize(mp, sfp, namelen));
+				xfs_dir2_sf_entsize(mp, sfp, namelen));
 	}
 
 	/* zero stale data in rest of space in data fork, if any */
@@ -1319,7 +1319,7 @@ obfuscate_path_components(
 		if (!slash) {
 			/* last (or single) component */
 			namelen = strnlen((char *)comp, len);
-			hash = libxfs_da_hashname(comp, namelen);
+			hash = xfs_da_hashname(comp, namelen);
 			obfuscate_name(hash, namelen, comp);
 			break;
 		}
@@ -1330,7 +1330,7 @@ obfuscate_path_components(
 			len--;
 			continue;
 		}
-		hash = libxfs_da_hashname(comp, namelen);
+		hash = xfs_da_hashname(comp, namelen);
 		obfuscate_name(hash, namelen, comp);
 		comp += namelen + 1;
 		len -= namelen + 1;
@@ -1433,7 +1433,7 @@ process_dir_free_block(
 		return;
 
 	free = (struct xfs_dir2_free *)block;
-	libxfs_dir2_free_hdr_from_disk(mp, &freehdr, free);
+	xfs_dir2_free_hdr_from_disk(mp, &freehdr, free);
 
 	switch (freehdr.magic) {
 	case XFS_DIR2_FREE_MAGIC:
@@ -1471,7 +1471,7 @@ process_dir_leaf_block(
 
 	/* Yes, this works for dir2 & dir3.  Difference is padding. */
 	leaf = (struct xfs_dir2_leaf *)block;
-	libxfs_dir2_leaf_hdr_from_disk(mp, &leafhdr, leaf);
+	xfs_dir2_leaf_hdr_from_disk(mp, &leafhdr, leaf);
 
 	switch (leafhdr.magic) {
 	case XFS_DIR2_LEAF1_MAGIC:
@@ -1602,7 +1602,7 @@ process_dir_data_block(
 		}
 
 		dep = (xfs_dir2_data_entry_t *)ptr;
-		length = libxfs_dir2_data_entsize(mp, dep->namelen);
+		length = xfs_dir2_data_entsize(mp, dep->namelen);
 
 		if (dir_offset + length > end_of_data ||
 		    ptr + length > endptr) {
@@ -1612,7 +1612,7 @@ process_dir_data_block(
 					(long long)cur_ino);
 			return;
 		}
-		if (be16_to_cpu(*libxfs_dir2_data_entry_tag_p(mp, dep)) !=
+		if (be16_to_cpu(*xfs_dir2_data_entry_tag_p(mp, dep)) !=
 				dir_offset)
 			return;
 
@@ -1625,7 +1625,7 @@ process_dir_data_block(
 		if (zero_stale_data) {
 			/* 1 byte for ftype; don't bother with conditional */
 			int zlen =
-				(char *)libxfs_dir2_data_entry_tag_p(mp, dep) -
+				(char *)xfs_dir2_data_entry_tag_p(mp, dep) -
 				(char *)&dep->name[dep->namelen] - 1;
 			if (zlen > 0) {
 				memset(&dep->name[dep->namelen] + 1, 0, zlen);
@@ -1877,7 +1877,7 @@ process_single_fsb_objects(
 				struct xfs_da3_icnode_hdr hdr;
 				int used;
 
-				libxfs_da3_node_hdr_from_disk(mp, &hdr, node);
+				xfs_da3_node_hdr_from_disk(mp, &hdr, node);
 				switch (btype) {
 				case TYP_DIR2:
 					used = mp->m_dir_geo->node_hdr_size;
@@ -2225,7 +2225,7 @@ process_btinode(
 					    nrecs, itype);
 	}
 
-	maxrecs = libxfs_bmdr_maxrecs(XFS_DFORK_SIZE(dip, mp, whichfork), 0);
+	maxrecs = xfs_bmdr_maxrecs(XFS_DFORK_SIZE(dip, mp, whichfork), 0);
 	if (nrecs > maxrecs) {
 		if (show_warnings)
 			print_warning("invalid numrecs (%u) in inode %lld %s "
@@ -2374,7 +2374,7 @@ process_inode(
 
 	/* we only care about crc recalculation if we will modify the inode. */
 	if (obfuscate || zero_stale_data) {
-		crc_was_ok = libxfs_verify_cksum((char *)dip,
+		crc_was_ok = xfs_verify_cksum((char *)dip,
 					mp->m_sb.sb_inodesize,
 					offsetof(struct xfs_dinode, di_crc));
 	}
@@ -2441,7 +2441,7 @@ done:
 		need_new_crc = 1;
 
 	if (crc_was_ok && need_new_crc)
-		libxfs_dinode_calc_crc(mp, dip);
+		xfs_dinode_calc_crc(mp, dip);
 	return success;
 }
 
@@ -2752,7 +2752,7 @@ scan_ag(
 			i = be32_to_cpu(agf->agf_fllast);
 
 			for (;;) {
-				if (++i == libxfs_agfl_size(mp))
+				if (++i == xfs_agfl_size(mp))
 					i = 0;
 				if (i == be32_to_cpu(agf->agf_flfirst))
 					break;
db/sb.c +5 -5
index 8a303422..9651a3b3 100644
@@ -189,7 +189,7 @@ get_sb(xfs_agnumber_t agno, xfs_sb_t *sb)
 		return 0;
 	}
 
-	libxfs_sb_from_disk(sb, iocur_top->data);
+	xfs_sb_from_disk(sb, iocur_top->data);
 
 	if (sb->sb_magicnum != XFS_SB_MAGIC) {
 		dbprintf(_("bad sb magic # %#x in AG %u\n"),
@@ -344,7 +344,7 @@ do_uuid(xfs_agnumber_t agno, uuid_t *uuid)
 		   uuid_equal(uuid, &mp->m_sb.sb_meta_uuid)) {
 		memset(&tsb.sb_meta_uuid, 0, sizeof(uuid_t));
 		/* Write those zeros now; it's ignored once we clear the flag */
-		libxfs_sb_to_disk(iocur_top->data, &tsb);
+		xfs_sb_to_disk(iocur_top->data, &tsb);
 		mp->m_sb.sb_features_incompat &=
 						~XFS_SB_FEAT_INCOMPAT_META_UUID;
 		tsb.sb_features_incompat &= ~XFS_SB_FEAT_INCOMPAT_META_UUID;
@@ -352,7 +352,7 @@ do_uuid(xfs_agnumber_t agno, uuid_t *uuid)
 
 write:
 	memcpy(&tsb.sb_uuid, uuid, sizeof(uuid_t));
-	libxfs_sb_to_disk(iocur_top->data, &tsb);
+	xfs_sb_to_disk(iocur_top->data, &tsb);
 	write_cur();
 	return uuid;
 }
@@ -516,7 +516,7 @@ do_label(xfs_agnumber_t agno, char *label)
 	memset(&tsb.sb_fname, 0, sizeof(tsb.sb_fname));
 	memcpy(&tsb.sb_fname, label, len);
 	memcpy(&lbl[0], &tsb.sb_fname, sizeof(tsb.sb_fname));
-	libxfs_sb_to_disk(iocur_top->data, &tsb);
+	xfs_sb_to_disk(iocur_top->data, &tsb);
 	write_cur();
 	return &lbl[0];
 }
@@ -615,7 +615,7 @@ do_version(xfs_agnumber_t agno, uint16_t version, uint32_t features)
 	tsb.sb_versionnum = version;
 	tsb.sb_features2 = features;
 	tsb.sb_bad_features2 = features;
-	libxfs_sb_to_disk(iocur_top->data, &tsb);
+	xfs_sb_to_disk(iocur_top->data, &tsb);
 	write_cur();
 	return 1;
 }
include/cache.h +1 -1
index 334ad263..bca9f6bb 100644
@@ -33,7 +33,7 @@ enum {
  * For prefetch support, the top half of the range starts at
  * CACHE_PREFETCH_PRIORITY and everytime the buffer is fetched and is at or
  * above this priority level, it is reduced to below this level (refer to
- * libxfs_buf_get).
+ * xfs_buf_get).
  *
  * If we have dirty nodes, we can't recycle them until they've been cleaned. To
  * keep these out of the reclaimable lists (as there can be lots of them) give
include/libxfs.h +3 -4
index 12447835..cfc5260d 100644
@@ -7,7 +7,6 @@
 #ifndef __LIBXFS_H__
 #define __LIBXFS_H__
 
-#include "libxfs_api_defs.h"
 #include "platform_defs.h"
 #include "xfs.h"
 
@@ -157,7 +156,7 @@ extern int	libxfs_log_header(char *, uuid_t *, int, int, int, xfs_lsn_t,
 
 /* Shared utility routines */
 
-extern int	libxfs_alloc_file_space (struct xfs_inode *, xfs_off_t,
+extern int	xfs_alloc_file_space (struct xfs_inode *, xfs_off_t,
 				xfs_off_t, int, int);
 
 /* XXX: this is messy and needs fixing */
@@ -210,8 +209,8 @@ libxfs_bmbt_disk_get_all(
 
 /* XXX: this is clearly a bug - a shared header needs to export this */
 /* xfs_rtalloc.c */
-int libxfs_rtfree_extent(struct xfs_trans *, xfs_rtblock_t, xfs_extlen_t);
-bool libxfs_verify_rtbno(struct xfs_mount *mp, xfs_rtblock_t rtbno);
+int xfs_rtfree_extent(struct xfs_trans *, xfs_rtblock_t, xfs_extlen_t);
+bool xfs_verify_rtbno(struct xfs_mount *mp, xfs_rtblock_t rtbno);
 
 #include "xfs_attr.h"
 
include/xfs_inode.h +4 -4
index 3caeeb39..5a34c681 100644
@@ -146,20 +146,20 @@ typedef struct cred {
 	gid_t	cr_gid;
 } cred_t;
 
-extern int	libxfs_inode_alloc (struct xfs_trans **, struct xfs_inode *,
+extern int	xfs_inode_alloc (struct xfs_trans **, struct xfs_inode *,
 				mode_t, nlink_t, xfs_dev_t, struct cred *,
 				struct fsxattr *, struct xfs_inode **);
-extern void	libxfs_trans_inode_alloc_buf (struct xfs_trans *,
+extern void	xfs_trans_inode_alloc_buf (struct xfs_trans *,
 				struct xfs_buf *);
 
-extern void	libxfs_trans_ichgtime(struct xfs_trans *,
+extern void	xfs_trans_ichgtime(struct xfs_trans *,
 				struct xfs_inode *, int);
 extern int	libxfs_iflush_int (struct xfs_inode *, struct xfs_buf *);
 
 extern struct timespec64 current_time(struct inode *inode);
 
 /* Inode Cache Interfaces */
-extern bool	libxfs_inode_verify_forks(struct xfs_inode *ip);
+extern bool	xfs_inode_verify_forks(struct xfs_inode *ip);
 extern int	libxfs_iget(struct xfs_mount *, struct xfs_trans *, xfs_ino_t,
 				uint, struct xfs_inode **,
 				struct xfs_ifork_ops *);
include/xfs_trans.h +24 -24
index 16e2a468..8d5a9e2f 100644
@@ -76,46 +76,46 @@ typedef struct xfs_trans {
 void	xfs_trans_init(struct xfs_mount *);
 int	xfs_trans_roll(struct xfs_trans **);
 
-int	libxfs_trans_alloc(struct xfs_mount *mp, struct xfs_trans_res *resp,
+int	xfs_trans_alloc(struct xfs_mount *mp, struct xfs_trans_res *resp,
 			   uint blocks, uint rtextents, uint flags,
 			   struct xfs_trans **tpp);
-int	libxfs_trans_alloc_rollable(struct xfs_mount *mp, uint blocks,
+int	xfs_trans_alloc_rollable(struct xfs_mount *mp, uint blocks,
 				    struct xfs_trans **tpp);
-int	libxfs_trans_alloc_empty(struct xfs_mount *mp, struct xfs_trans **tpp);
-int	libxfs_trans_commit(struct xfs_trans *);
-void	libxfs_trans_cancel(struct xfs_trans *);
+int	xfs_trans_alloc_empty(struct xfs_mount *mp, struct xfs_trans **tpp);
+int	xfs_trans_commit(struct xfs_trans *);
+void	xfs_trans_cancel(struct xfs_trans *);
 
 /* cancel dfops associated with a transaction */
 void xfs_defer_cancel(struct xfs_trans *);
 
-struct xfs_buf *libxfs_trans_getsb(struct xfs_trans *, struct xfs_mount *);
+struct xfs_buf *xfs_trans_getsb(struct xfs_trans *, struct xfs_mount *);
 
-void	libxfs_trans_ijoin(struct xfs_trans *, struct xfs_inode *, uint);
-void	libxfs_trans_log_inode (struct xfs_trans *, struct xfs_inode *,
+void	xfs_trans_ijoin(struct xfs_trans *, struct xfs_inode *, uint);
+void	xfs_trans_log_inode (struct xfs_trans *, struct xfs_inode *,
 				uint);
-int	libxfs_trans_roll_inode (struct xfs_trans **, struct xfs_inode *);
-
-void	libxfs_trans_brelse(struct xfs_trans *, struct xfs_buf *);
-void	libxfs_trans_binval(struct xfs_trans *, struct xfs_buf *);
-void	libxfs_trans_bjoin(struct xfs_trans *, struct xfs_buf *);
-void	libxfs_trans_bhold(struct xfs_trans *, struct xfs_buf *);
-void	libxfs_trans_bhold_release(struct xfs_trans *, struct xfs_buf *);
-void	libxfs_trans_dirty_buf(struct xfs_trans *, struct xfs_buf *);
-void	libxfs_trans_log_buf(struct xfs_trans *, struct xfs_buf *,
+int	xfs_trans_roll_inode (struct xfs_trans **, struct xfs_inode *);
+
+void	xfs_trans_brelse(struct xfs_trans *, struct xfs_buf *);
+void	xfs_trans_binval(struct xfs_trans *, struct xfs_buf *);
+void	xfs_trans_bjoin(struct xfs_trans *, struct xfs_buf *);
+void	xfs_trans_bhold(struct xfs_trans *, struct xfs_buf *);
+void	xfs_trans_bhold_release(struct xfs_trans *, struct xfs_buf *);
+void	xfs_trans_dirty_buf(struct xfs_trans *, struct xfs_buf *);
+void	xfs_trans_log_buf(struct xfs_trans *, struct xfs_buf *,
 				uint, uint);
-bool	libxfs_trans_ordered_buf(xfs_trans_t *, struct xfs_buf *);
+bool	xfs_trans_ordered_buf(xfs_trans_t *, struct xfs_buf *);
 
-int	libxfs_trans_get_buf_map(struct xfs_trans *tp, struct xfs_buftarg *btp,
+int	xfs_trans_get_buf_map(struct xfs_trans *tp, struct xfs_buftarg *btp,
 		struct xfs_buf_map *map, int nmaps, xfs_buf_flags_t flags,
 		struct xfs_buf **bpp);
 
-int	libxfs_trans_read_buf_map(struct xfs_mount *mp, struct xfs_trans *tp,
+int	xfs_trans_read_buf_map(struct xfs_mount *mp, struct xfs_trans *tp,
 				  struct xfs_buftarg *btp,
 				  struct xfs_buf_map *map, int nmaps,
 				  xfs_buf_flags_t flags, struct xfs_buf **bpp,
 				  const struct xfs_buf_ops *ops);
 static inline int
-libxfs_trans_get_buf(
+xfs_trans_get_buf(
 	struct xfs_trans	*tp,
 	struct xfs_buftarg	*btp,
 	xfs_daddr_t		blkno,
@@ -125,11 +125,11 @@ libxfs_trans_get_buf(
 {
 	DEFINE_SINGLE_BUF_MAP(map, blkno, numblks);
 
-	return libxfs_trans_get_buf_map(tp, btp, &map, 1, flags, bpp);
+	return xfs_trans_get_buf_map(tp, btp, &map, 1, flags, bpp);
 }
 
 static inline int
-libxfs_trans_read_buf(
+xfs_trans_read_buf(
 	struct xfs_mount	*mp,
 	struct xfs_trans	*tp,
 	struct xfs_buftarg	*btp,
@@ -140,7 +140,7 @@ libxfs_trans_read_buf(
 	const struct xfs_buf_ops *ops)
 {
 	DEFINE_SINGLE_BUF_MAP(map, blkno, numblks);
-	return libxfs_trans_read_buf_map(mp, tp, btp, &map, 1, flags, bpp, ops);
+	return xfs_trans_read_buf_map(mp, tp, btp, &map, 1, flags, bpp, ops);
 }
 
 #endif	/* __XFS_TRANS_H__ */
io/open.c +1 -1
index 9a8b5e5c..bc94ca2b 100644
@@ -754,7 +754,7 @@ get_last_inode(void)
 
 	/* The last inode number in use */
 	last_ino = ireq->inumbers[lastgrp].xi_startino +
-		  libxfs_highbit64(ireq->inumbers[lastgrp].xi_allocmask);
+		  xfs_highbit64(ireq->inumbers[lastgrp].xi_allocmask);
 out:
 	free(ireq);
 
libxfs/Makefile +0 -1
index 44b23816..b7b6f770 100644
@@ -49,7 +49,6 @@ HFILES = \
 	xfs_trans_resv.h \
 	xfs_trans_space.h \
 	libxfs_io.h \
-	libxfs_api_defs.h \
 	init.h \
 	libxfs_priv.h \
 	xfs_dir2_priv.h
libxfs/cache.c +1 -1
index 139c7c1b..31a4438f 100644
@@ -53,7 +53,7 @@ cache_init(
 	cache->c_misses = 0;
 	cache->c_maxcount = maxcount;
 	cache->c_hashsize = hashsize;
-	cache->c_hashshift = libxfs_highbit32(hashsize);
+	cache->c_hashshift = xfs_highbit32(hashsize);
 	cache->hash = cache_operations->hash;
 	cache->alloc = cache_operations->alloc;
 	cache->flush = cache_operations->flush;
libxfs/init.c +8 -8
index cb8967bc..81dc8a9e 100644
@@ -456,14 +456,14 @@ rtmount_init(
 			(unsigned long long) mp->m_sb.sb_rblocks);
 		return -1;
 	}
-	error = libxfs_buf_read(mp->m_rtdev, d - XFS_FSB_TO_BB(mp, 1),
+	error = xfs_buf_read(mp->m_rtdev, d - XFS_FSB_TO_BB(mp, 1),
 			XFS_FSB_TO_BB(mp, 1), 0, &bp, NULL);
 	if (error) {
 		fprintf(stderr, _("%s: realtime size check failed\n"),
 			progname);
 		return -1;
 	}
-	libxfs_buf_relse(bp);
+	xfs_buf_relse(bp);
 	return 0;
 }
 
@@ -736,20 +736,20 @@ libxfs_mount(
 		return mp;
 
 	/* device size checks must pass unless we're a debugger. */
-	error = libxfs_buf_read(mp->m_dev, d - XFS_FSS_TO_BB(mp, 1),
+	error = xfs_buf_read(mp->m_dev, d - XFS_FSS_TO_BB(mp, 1),
 			XFS_FSS_TO_BB(mp, 1), 0, &bp, NULL);
 	if (error) {
 		fprintf(stderr, _("%s: data size check failed\n"), progname);
 		if (!debugger)
 			return NULL;
 	} else
-		libxfs_buf_relse(bp);
+		xfs_buf_relse(bp);
 
 	if (mp->m_logdev_targp->dev &&
 	    mp->m_logdev_targp->dev != mp->m_ddev_targp->dev) {
 		d = (xfs_daddr_t) XFS_FSB_TO_BB(mp, mp->m_sb.sb_logblocks);
 		if (XFS_BB_TO_FSB(mp, d) != mp->m_sb.sb_logblocks ||
-		    libxfs_buf_read(mp->m_logdev_targp,
+		    xfs_buf_read(mp->m_logdev_targp,
 				d - XFS_FSB_TO_BB(mp, 1), XFS_FSB_TO_BB(mp, 1),
 				0, &bp, NULL)) {
 			fprintf(stderr, _("%s: log size checks failed\n"),
@@ -758,7 +758,7 @@ libxfs_mount(
 				return NULL;
 		}
 		if (bp)
-			libxfs_buf_relse(bp);
+			xfs_buf_relse(bp);
 	}
 
 	/* Initialize realtime fields in the mount structure */
@@ -776,7 +776,7 @@ libxfs_mount(
 	 * read the first one and let the user know to check the geometry.
 	 */
 	if (sbp->sb_agcount > 1000000) {
-		error = libxfs_buf_read(mp->m_dev,
+		error = xfs_buf_read(mp->m_dev,
 				XFS_AG_DADDR(mp, sbp->sb_agcount - 1, 0), 1,
 				0, &bp, NULL);
 		if (error) {
@@ -788,7 +788,7 @@ libxfs_mount(
 								progname);
 			sbp->sb_agcount = 1;
 		} else
-			libxfs_buf_relse(bp);
+			xfs_buf_relse(bp);
 	}
 
 	error = libxfs_initialize_perag(mp, sbp->sb_agcount, &mp->m_maxagi);
libxfs/libxfs_api_defs.h deleted +0 -191
deleted file mode 100644
index 4462036b..00000000
@@ -1,191 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * Copyright (c) 2000-2005 Silicon Graphics, Inc.
- * All Rights Reserved.
- */
-
-#ifndef __LIBXFS_API_DEFS_H__
-#define __LIBXFS_API_DEFS_H__
-
-/*
- * This file defines all the kernel based functions we expose to userspace
- * via the libxfs_* namespace. This is kept in a separate header file so
- * it can be included in both the internal and external libxfs header files
- * without introducing any depenencies between the two.
- */
-#define LIBXFS_ATTR_ROOT		XFS_ATTR_ROOT
-#define LIBXFS_ATTR_SECURE		XFS_ATTR_SECURE
-
-#define xfs_agfl_size			libxfs_agfl_size
-#define xfs_agfl_walk			libxfs_agfl_walk
-
-#define xfs_ag_init_headers		libxfs_ag_init_headers
-
-#define xfs_alloc_ag_max_usable		libxfs_alloc_ag_max_usable
-#define xfs_allocbt_maxrecs		libxfs_allocbt_maxrecs
-#define xfs_alloc_fix_freelist		libxfs_alloc_fix_freelist
-#define xfs_alloc_min_freelist		libxfs_alloc_min_freelist
-#define xfs_alloc_read_agf		libxfs_alloc_read_agf
-
-#define xfs_attr_get			libxfs_attr_get
-#define xfs_attr_leaf_newentsize	libxfs_attr_leaf_newentsize
-#define xfs_attr_namecheck		libxfs_attr_namecheck
-#define xfs_attr_set			libxfs_attr_set
-
-#define xfs_bmapi_read			libxfs_bmapi_read
-#define xfs_bmapi_write			libxfs_bmapi_write
-#define xfs_bmap_last_offset		libxfs_bmap_last_offset
-#define xfs_bmbt_maxrecs		libxfs_bmbt_maxrecs
-#define xfs_bmdr_maxrecs		libxfs_bmdr_maxrecs
-
-#define xfs_btree_del_cursor		libxfs_btree_del_cursor
-#define xfs_btree_init_block		libxfs_btree_init_block
-#define xfs_buf_delwri_submit		libxfs_buf_delwri_submit
-#define xfs_buf_get			libxfs_buf_get
-#define xfs_buf_get_uncached		libxfs_buf_get_uncached
-#define xfs_buf_read			libxfs_buf_read
-#define xfs_buf_read_uncached		libxfs_buf_read_uncached
-#define xfs_buf_relse			libxfs_buf_relse
-#define xfs_bunmapi			libxfs_bunmapi
-#define xfs_bwrite			libxfs_bwrite
-#define xfs_calc_dquots_per_chunk	libxfs_calc_dquots_per_chunk
-#define xfs_da3_node_hdr_from_disk	libxfs_da3_node_hdr_from_disk
-#define xfs_da_get_buf			libxfs_da_get_buf
-#define xfs_da_hashname			libxfs_da_hashname
-#define xfs_da_read_buf			libxfs_da_read_buf
-#define xfs_da_shrink_inode		libxfs_da_shrink_inode
-#define xfs_default_ifork_ops		libxfs_default_ifork_ops
-#define xfs_defer_cancel		libxfs_defer_cancel
-#define xfs_defer_finish		libxfs_defer_finish
-#define xfs_dinode_calc_crc		libxfs_dinode_calc_crc
-#define xfs_dinode_good_version		libxfs_dinode_good_version
-#define xfs_dinode_verify		libxfs_dinode_verify
-
-#define xfs_dir2_data_bestfree_p	libxfs_dir2_data_bestfree_p
-#define xfs_dir2_data_entry_tag_p	libxfs_dir2_data_entry_tag_p
-#define xfs_dir2_data_entsize		libxfs_dir2_data_entsize
-#define xfs_dir2_data_freescan		libxfs_dir2_data_freescan
-#define xfs_dir2_data_get_ftype		libxfs_dir2_data_get_ftype
-#define xfs_dir2_data_log_entry		libxfs_dir2_data_log_entry
-#define xfs_dir2_data_log_header	libxfs_dir2_data_log_header
-#define xfs_dir2_data_make_free		libxfs_dir2_data_make_free
-#define xfs_dir2_data_put_ftype		libxfs_dir2_data_put_ftype
-#define xfs_dir2_data_use_free		libxfs_dir2_data_use_free
-#define xfs_dir2_free_hdr_from_disk	libxfs_dir2_free_hdr_from_disk
-#define xfs_dir2_hashname		libxfs_dir2_hashname
-#define xfs_dir2_isblock		libxfs_dir2_isblock
-#define xfs_dir2_isleaf			libxfs_dir2_isleaf
-#define xfs_dir2_leaf_hdr_from_disk	libxfs_dir2_leaf_hdr_from_disk
-#define xfs_dir2_namecheck		libxfs_dir2_namecheck
-#define xfs_dir2_sf_entsize		libxfs_dir2_sf_entsize
-#define xfs_dir2_sf_get_ftype		libxfs_dir2_sf_get_ftype
-#define xfs_dir2_sf_get_ino		libxfs_dir2_sf_get_ino
-#define xfs_dir2_sf_get_parent_ino	libxfs_dir2_sf_get_parent_ino
-#define xfs_dir2_sf_nextentry		libxfs_dir2_sf_nextentry
-#define xfs_dir2_sf_put_ftype		libxfs_dir2_sf_put_ftype
-#define xfs_dir2_sf_put_ino		libxfs_dir2_sf_put_ino
-#define xfs_dir2_sf_put_parent_ino	libxfs_dir2_sf_put_parent_ino
-#define xfs_dir2_shrink_inode		libxfs_dir2_shrink_inode
-
-#define xfs_dir_createname		libxfs_dir_createname
-#define xfs_dir_init			libxfs_dir_init
-#define xfs_dir_ino_validate		libxfs_dir_ino_validate
-#define xfs_dir_lookup			libxfs_dir_lookup
-#define xfs_dir_replace			libxfs_dir_replace
-
-#define xfs_dqblk_repair		libxfs_dqblk_repair
-#define xfs_dquot_verify		libxfs_dquot_verify
-
-#define xfs_finobt_calc_reserves	libxfs_finobt_calc_reserves
-#define xfs_free_extent			libxfs_free_extent
-#define xfs_fs_geometry			libxfs_fs_geometry
-#define xfs_highbit32			libxfs_highbit32
-#define xfs_highbit64			libxfs_highbit64
-#define xfs_ialloc_calc_rootino		libxfs_ialloc_calc_rootino
-#define xfs_idata_realloc		libxfs_idata_realloc
-#define xfs_idestroy_fork		libxfs_idestroy_fork
-#define xfs_iext_lookup_extent		libxfs_iext_lookup_extent
-#define xfs_initialize_perag_data	libxfs_initialize_perag_data
-#define xfs_init_local_fork		libxfs_init_local_fork
-
-#define xfs_inobt_maxrecs		libxfs_inobt_maxrecs
-#define xfs_inode_from_disk		libxfs_inode_from_disk
-#define xfs_inode_to_disk		libxfs_inode_to_disk
-#define xfs_inode_validate_cowextsize	libxfs_inode_validate_cowextsize
-#define xfs_inode_validate_extsize	libxfs_inode_validate_extsize
-
-#define xfs_iread_extents		libxfs_iread_extents
-#define xfs_log_calc_minimum_size	libxfs_log_calc_minimum_size
-#define xfs_log_get_max_trans_res	libxfs_log_get_max_trans_res
-#define xfs_log_sb			libxfs_log_sb
-#define xfs_mode_to_ftype		libxfs_mode_to_ftype
-#define xfs_perag_get			libxfs_perag_get
-#define xfs_perag_put			libxfs_perag_put
-#define xfs_prealloc_blocks		libxfs_prealloc_blocks
-
-#define xfs_read_agf			libxfs_read_agf
-#define xfs_refc_block			libxfs_refc_block
-#define xfs_refcountbt_calc_reserves	libxfs_refcountbt_calc_reserves
-#define xfs_refcountbt_init_cursor	libxfs_refcountbt_init_cursor
-#define xfs_refcountbt_maxrecs		libxfs_refcountbt_maxrecs
-#define xfs_refcount_get_rec		libxfs_refcount_get_rec
-#define xfs_refcount_lookup_le		libxfs_refcount_lookup_le
-
-#define xfs_rmap_alloc			libxfs_rmap_alloc
-#define xfs_rmapbt_calc_reserves	libxfs_rmapbt_calc_reserves
-#define xfs_rmapbt_init_cursor		libxfs_rmapbt_init_cursor
-#define xfs_rmapbt_maxrecs		libxfs_rmapbt_maxrecs
-#define xfs_rmap_compare		libxfs_rmap_compare
-#define xfs_rmap_get_rec		libxfs_rmap_get_rec
-#define xfs_rmap_irec_offset_pack	libxfs_rmap_irec_offset_pack
-#define xfs_rmap_irec_offset_unpack	libxfs_rmap_irec_offset_unpack
-#define xfs_rmap_lookup_le		libxfs_rmap_lookup_le
-#define xfs_rmap_lookup_le_range	libxfs_rmap_lookup_le_range
-#define xfs_rmap_query_range		libxfs_rmap_query_range
-
-#define xfs_rtfree_extent		libxfs_rtfree_extent
-#define xfs_sb_from_disk		libxfs_sb_from_disk
-#define xfs_sb_quota_from_disk		libxfs_sb_quota_from_disk
-#define xfs_sb_read_secondary		libxfs_sb_read_secondary
-#define xfs_sb_to_disk			libxfs_sb_to_disk
-#define xfs_symlink_blocks		libxfs_symlink_blocks
-#define xfs_symlink_hdr_ok		libxfs_symlink_hdr_ok
-
-#define xfs_trans_add_item		libxfs_trans_add_item
-#define xfs_trans_alloc_empty		libxfs_trans_alloc_empty
-#define xfs_trans_alloc			libxfs_trans_alloc
-#define xfs_trans_bhold			libxfs_trans_bhold
-#define xfs_trans_bhold_release		libxfs_trans_bhold_release
-#define xfs_trans_binval		libxfs_trans_binval
-#define xfs_trans_bjoin			libxfs_trans_bjoin
-#define xfs_trans_brelse		libxfs_trans_brelse
-#define xfs_trans_cancel		libxfs_trans_cancel
-#define xfs_trans_commit		libxfs_trans_commit
-#define xfs_trans_del_item		libxfs_trans_del_item
-#define xfs_trans_dirty_buf		libxfs_trans_dirty_buf
-#define xfs_trans_get_buf		libxfs_trans_get_buf
-#define xfs_trans_get_buf_map		libxfs_trans_get_buf_map
-#define xfs_trans_getsb			libxfs_trans_getsb
-#define xfs_trans_ichgtime		libxfs_trans_ichgtime
-#define xfs_trans_ijoin			libxfs_trans_ijoin
-#define xfs_trans_init			libxfs_trans_init
-#define xfs_trans_inode_alloc_buf	libxfs_trans_inode_alloc_buf
-#define xfs_trans_log_buf		libxfs_trans_log_buf
-#define xfs_trans_log_inode		libxfs_trans_log_inode
-#define xfs_trans_mod_sb		libxfs_trans_mod_sb
-#define xfs_trans_ordered_buf		libxfs_trans_ordered_buf
-#define xfs_trans_read_buf		libxfs_trans_read_buf
-#define xfs_trans_read_buf_map		libxfs_trans_read_buf_map
-#define xfs_trans_resv_calc		libxfs_trans_resv_calc
-#define xfs_trans_roll_inode		libxfs_trans_roll_inode
-#define xfs_trans_roll			libxfs_trans_roll
-
-#define xfs_verify_cksum		libxfs_verify_cksum
-#define xfs_verify_dir_ino		libxfs_verify_dir_ino
-#define xfs_verify_ino			libxfs_verify_ino
-#define xfs_verify_rtbno		libxfs_verify_rtbno
-#define xfs_zero_extent			libxfs_zero_extent
-
-/* Please keep this list alphabetized. */
-
-#endif /* __LIBXFS_API_DEFS_H__ */
libxfs/libxfs_io.h +15 -15
index 34462f78..e6d758f9 100644
@@ -130,22 +130,22 @@ extern struct cache_operations	libxfs_bcache_operations;
 
 #ifdef XFS_BUF_TRACING
 
-#define libxfs_buf_read(dev, daddr, len, flags, bpp, ops) \
+#define xfs_buf_read(dev, daddr, len, flags, bpp, ops) \
 	libxfs_trace_readbuf(__FUNCTION__, __FILE__, __LINE__, \
 			    (dev), (daddr), (len), (flags), (bpp), (ops))
-#define libxfs_buf_read_map(dev, map, nmaps, flags, bpp, ops) \
+#define xfs_buf_read_map(dev, map, nmaps, flags, bpp, ops) \
 	libxfs_trace_readbuf_map(__FUNCTION__, __FILE__, __LINE__, \
 			    (dev), (map), (nmaps), (flags), (bpp), (ops))
 #define libxfs_buf_mark_dirty(buf) \
 	libxfs_trace_dirtybuf(__FUNCTION__, __FILE__, __LINE__, \
 			      (buf))
-#define libxfs_buf_get(dev, daddr, len, bpp) \
+#define xfs_buf_get(dev, daddr, len, bpp) \
 	libxfs_trace_getbuf(__FUNCTION__, __FILE__, __LINE__, \
 			    (dev), (daddr), (len), (bpp))
-#define libxfs_buf_get_map(dev, map, nmaps, flags, bpp) \
+#define xfs_buf_get_map(dev, map, nmaps, flags, bpp) \
 	libxfs_trace_getbuf_map(__FUNCTION__, __FILE__, __LINE__, \
 			    (dev), (map), (nmaps), (flags), (bpp))
-#define libxfs_buf_relse(buf) \
+#define xfs_buf_relse(buf) \
 	libxfs_trace_putbuf(__FUNCTION__, __FILE__, __LINE__, (buf))
 
 int libxfs_trace_readbuf(const char *func, const char *file, int line,
@@ -169,16 +169,16 @@ extern void	libxfs_trace_putbuf (const char *, const char *, int,
 
 #else
 
-int libxfs_buf_read_map(struct xfs_buftarg *btp, struct xfs_buf_map *maps,
+int xfs_buf_read_map(struct xfs_buftarg *btp, struct xfs_buf_map *maps,
 			int nmaps, int flags, struct xfs_buf **bpp,
 			const struct xfs_buf_ops *ops);
 void libxfs_buf_mark_dirty(struct xfs_buf *bp);
-int libxfs_buf_get_map(struct xfs_buftarg *btp, struct xfs_buf_map *maps,
+int xfs_buf_get_map(struct xfs_buftarg *btp, struct xfs_buf_map *maps,
 			int nmaps, int flags, struct xfs_buf **bpp);
-void	libxfs_buf_relse(struct xfs_buf *bp);
+void	xfs_buf_relse(struct xfs_buf *bp);
 
 static inline int
-libxfs_buf_get(
+xfs_buf_get(
 	struct xfs_buftarg	*target,
 	xfs_daddr_t		blkno,
 	size_t			numblks,
@@ -186,11 +186,11 @@ libxfs_buf_get(
 {
 	DEFINE_SINGLE_BUF_MAP(map, blkno, numblks);
 
-	return libxfs_buf_get_map(target, &map, 1, 0, bpp);
+	return xfs_buf_get_map(target, &map, 1, 0, bpp);
 }
 
 static inline int
-libxfs_buf_read(
+xfs_buf_read(
 	struct xfs_buftarg	*target,
 	xfs_daddr_t		blkno,
 	size_t			numblks,
@@ -200,7 +200,7 @@ libxfs_buf_read(
 {
 	DEFINE_SINGLE_BUF_MAP(map, blkno, numblks);
 
-	return libxfs_buf_read_map(target, &map, 1, flags, bpp, ops);
+	return xfs_buf_read_map(target, &map, 1, flags, bpp, ops);
 }
 
 #endif /* XFS_BUF_TRACING */
@@ -213,7 +213,7 @@ extern void	libxfs_bcache_flush(void);
 extern int	libxfs_bcache_overflowed(void);
 
 /* Buffer (Raw) Interfaces */
-int		libxfs_bwrite(struct xfs_buf *bp);
+int		xfs_bwrite(struct xfs_buf *bp);
 extern int	libxfs_readbufr(struct xfs_buftarg *, xfs_daddr_t, xfs_buf_t *, int, int);
 extern int	libxfs_readbufr_map(struct xfs_buftarg *, struct xfs_buf *, int);
 
@@ -243,9 +243,9 @@ xfs_buf_associate_memory(struct xfs_buf *bp, void *mem, size_t len)
 	return 0;
 }
 
-int libxfs_buf_get_uncached(struct xfs_buftarg *targ, size_t bblen, int flags,
+int xfs_buf_get_uncached(struct xfs_buftarg *targ, size_t bblen, int flags,
 		struct xfs_buf **bpp);
-int libxfs_buf_read_uncached(struct xfs_buftarg *targ, xfs_daddr_t daddr,
+int xfs_buf_read_uncached(struct xfs_buftarg *targ, xfs_daddr_t daddr,
 		size_t bblen, int flags, struct xfs_buf **bpp,
 		const struct xfs_buf_ops *ops);
 
libxfs/libxfs_priv.h +3 -4
index 5688284d..0d05fb2f 100644
@@ -37,7 +37,6 @@
 #ifndef __LIBXFS_INTERNAL_XFS_H__
 #define __LIBXFS_INTERNAL_XFS_H__
 
-#include "libxfs_api_defs.h"
 #include "platform_defs.h"
 #include "xfs.h"
 
@@ -573,8 +572,8 @@ xfs_buf_corruption_error(struct xfs_buf *bp, xfs_failaddr_t fa);
 
 /* XXX: this is clearly a bug - a shared header needs to export this */
 /* xfs_rtalloc.c */
-int libxfs_rtfree_extent(struct xfs_trans *, xfs_rtblock_t, xfs_extlen_t);
-bool libxfs_verify_rtbno(struct xfs_mount *mp, xfs_rtblock_t rtbno);
+int xfs_rtfree_extent(struct xfs_trans *, xfs_rtblock_t, xfs_extlen_t);
+bool xfs_verify_rtbno(struct xfs_mount *mp, xfs_rtblock_t rtbno);
 
 struct xfs_rtalloc_rec {
 	xfs_rtblock_t		ar_startext;
@@ -586,7 +585,7 @@ typedef int (*xfs_rtalloc_query_range_fn)(
 	struct xfs_rtalloc_rec	*rec,
 	void			*priv);
 
-int libxfs_zero_extent(struct xfs_inode *ip, xfs_fsblock_t start_fsb,
+int xfs_zero_extent(struct xfs_inode *ip, xfs_fsblock_t start_fsb,
                         xfs_off_t count_fsb);
 
 
libxfs/rdwr.c +33 -33
index 13a414d7..5f250278 100644
@@ -32,7 +32,7 @@ static void libxfs_brelse(struct cache_node *node);
  * outside libxfs clears bp->b_error - very little code even checks it - so the
  * libxfs code is tripping on stale errors left by the userspace code.
  *
- * We can't clear errors or zero buffer contents in libxfs_buf_get-* like we do
+ * We can't clear errors or zero buffer contents in xfs_buf_get-* like we do
  * in the kernel, because those functions are used by the libxfs_readbuf_*
  * functions and hence need to leave the buffers unchanged on cache hits. This
  * is actually the only way to gather a write error from a libxfs_writebuf()
@@ -46,11 +46,11 @@ static void libxfs_brelse(struct cache_node *node);
  *
  * IOWs, userspace is behaving quite differently to the kernel and as a result
  * it leaks errors from reads, invalidations and writes through
- * libxfs_buf_get/libxfs_buf_read.
+ * xfs_buf_get/xfs_buf_read.
  *
  * The result of this is that until the userspace code outside libxfs is cleaned
  * up, functions that release buffers from userspace control (i.e
- * libxfs_writebuf/libxfs_buf_relse) need to zero bp->b_error to prevent
+ * libxfs_writebuf/xfs_buf_relse) need to zero bp->b_error to prevent
  * propagation of stale errors into future buffer operations.
  */
 
@@ -154,19 +154,19 @@ static char *next(
 
 #ifdef XFS_BUF_TRACING
 
-#undef libxfs_buf_read_map
+#undef xfs_buf_read_map
 #undef libxfs_writebuf
-#undef libxfs_buf_get_map
+#undef xfs_buf_get_map
 
-int		libxfs_buf_read_map(struct xfs_buftarg *btp,
+int		bxfs_buf_read_map(struct xfs_buftarg *btp,
 				struct xfs_buf_map *maps, int nmaps, int flags,
 				struct xfs_buf **bpp,
 				const struct xfs_buf_ops *ops);
 int		libxfs_writebuf(xfs_buf_t *, int);
-int		libxfs_buf_get_map(struct xfs_buftarg *btp,
+int		xfs_buf_get_map(struct xfs_buftarg *btp,
 				struct xfs_buf_map *maps, int nmaps, int flags,
 				struct xfs_buf **bpp);
-void		libxfs_buf_relse(struct xfs_buf *bp);
+void		xfs_buf_relse(struct xfs_buf *bp);
 
 #define	__add_trace(bp, func, file, line)	\
 do {						\
@@ -192,7 +192,7 @@ libxfs_trace_readbuf(
 	int			error;
 	DEFINE_SINGLE_BUF_MAP(map, blkno, numblks);
 
-	error = libxfs_buf_read_map(btp, &map, 1, flags, bpp, ops);
+	error = xfs_buf_read_map(btp, &map, 1, flags, bpp, ops);
 	__add_trace(*bpp, func, file, line);
 	return error;
 }
@@ -211,7 +211,7 @@ libxfs_trace_readbuf_map(
 {
 	int			error;
 
-	error = libxfs_buf_read_map(btp, map, nmaps, flags, bpp, ops);
+	error = xfs_buf_read_map(btp, map, nmaps, flags, bpp, ops);
 	__add_trace(*bpp, func, file, line);
 	return error;
 }
@@ -240,7 +240,7 @@ libxfs_trace_getbuf(
 	int			error;
 	DEFINE_SINGLE_BUF_MAP(map, blkno, numblks);
 
-	error = libxfs_buf_get_map(target, &map, 1, 0, bpp);
+	error = xfs_buf_get_map(target, &map, 1, 0, bpp);
 	__add_trace(bp, func, file, line);
 	return error;
 }
@@ -258,7 +258,7 @@ libxfs_trace_getbuf_map(
 {
 	int			error;
 
-	error = libxfs_buf_get_map(btp, map, nmaps, flags, bpp);
+	error = xfs_buf_get_map(btp, map, nmaps, flags, bpp);
 	__add_trace(*bpp, func, file, line);
 	return error;
 }
@@ -267,7 +267,7 @@ void
 libxfs_trace_putbuf(const char *func, const char *file, int line, xfs_buf_t *bp)
 {
 	__add_trace(bp, func, file, line);
-	libxfs_buf_relse(bp);
+	xfs_buf_relse(bp);
 }
 
 
@@ -280,7 +280,7 @@ libxfs_getsb(
 {
 	struct xfs_buf		*bp;
 
-	libxfs_buf_read(mp->m_ddev_targp, XFS_SB_DADDR, XFS_FSS_TO_BB(mp, 1),
+	xfs_buf_read(mp->m_ddev_targp, XFS_SB_DADDR, XFS_FSS_TO_BB(mp, 1),
 			0, &bp, &xfs_sb_buf_ops);
 	return bp;
 }
@@ -641,7 +641,7 @@ __libxfs_buf_get_map(
 }
 
 int
-libxfs_buf_get_map(
+xfs_buf_get_map(
 	struct xfs_buftarg	*btp,
 	struct xfs_buf_map	*map,
 	int			nmaps,
@@ -659,7 +659,7 @@ libxfs_buf_get_map(
 }
 
 void
-libxfs_buf_relse(
+xfs_buf_relse(
 	struct xfs_buf	*bp)
 {
 	/*
@@ -688,7 +688,7 @@ libxfs_buf_relse(
 		cache_node_put(libxfs_bcache, &bp->b_node);
 	else if (--bp->b_node.cn_count == 0) {
 		if (bp->b_flags & LIBXFS_B_DIRTY)
-			libxfs_bwrite(bp);
+			xfs_bwrite(bp);
 		libxfs_brelse(&bp->b_node);
 	}
 }
@@ -801,7 +801,7 @@ libxfs_readbufr_map(struct xfs_buftarg *btp, struct xfs_buf *bp, int flags)
 }
 
 int
-libxfs_buf_read_map(
+xfs_buf_read_map(
 	struct xfs_buftarg	*btp,
 	struct xfs_buf_map	*map,
 	int			nmaps,
@@ -874,7 +874,7 @@ ok:
 	*bpp = bp;
 	return 0;
 err:
-	libxfs_buf_relse(bp);
+	xfs_buf_relse(bp);
 	return error;
 }
 
@@ -901,7 +901,7 @@ libxfs_getbufr_uncached(
  * and the cache node hash list will be empty to indicate that it's uncached.
  */
 int
-libxfs_buf_get_uncached(
+xfs_buf_get_uncached(
 	struct xfs_buftarg	*targ,
 	size_t			bblen,
 	int			flags,
@@ -916,7 +916,7 @@ libxfs_buf_get_uncached(
  * node hash list will be empty to indicate that it's uncached.
  */
 int
-libxfs_buf_read_uncached(
+xfs_buf_read_uncached(
 	struct xfs_buftarg	*targ,
 	xfs_daddr_t		daddr,
 	size_t			bblen,
@@ -943,7 +943,7 @@ libxfs_buf_read_uncached(
 	*bpp = bp;
 	return 0;
 err:
-	libxfs_buf_relse(bp);
+	xfs_buf_relse(bp);
 	return error;
 }
 
@@ -967,7 +967,7 @@ __write_buf(int fd, void *buf, int len, off64_t offset, int flags)
 }
 
 int
-libxfs_bwrite(
+xfs_bwrite(
 	struct xfs_buf	*bp)
 {
 	int		fd = libxfs_device_to_fd(bp->b_target->dev);
@@ -1147,7 +1147,7 @@ libxfs_bflush(
 						   b_node);
 
 	if (!bp->b_error && bp->b_flags & LIBXFS_B_DIRTY)
-		return libxfs_bwrite(bp);
+		return xfs_bwrite(bp);
 	return bp->b_error;
 }
 
@@ -1228,7 +1228,7 @@ extern kmem_zone_t	*xfs_ili_zone;
  * make sure they're not corrupt.
  */
 bool
-libxfs_inode_verify_forks(
+xfs_inode_verify_forks(
 	struct xfs_inode	*ip)
 {
 	struct xfs_ifork	*ifp;
@@ -1282,7 +1282,7 @@ libxfs_iget(
 	}
 
 	ip->i_fork_ops = ifork_ops;
-	if (!libxfs_inode_verify_forks(ip)) {
+	if (!xfs_inode_verify_forks(ip)) {
 		libxfs_irele(ip);
 		return -EFSCORRUPTED;
 	}
@@ -1298,11 +1298,11 @@ libxfs_idestroy(xfs_inode_t *ip)
 		case S_IFREG:
 		case S_IFDIR:
 		case S_IFLNK:
-			libxfs_idestroy_fork(ip, XFS_DATA_FORK);
+			xfs_idestroy_fork(ip, XFS_DATA_FORK);
 			break;
 	}
 	if (ip->i_afp)
-		libxfs_idestroy_fork(ip, XFS_ATTR_FORK);
+		xfs_idestroy_fork(ip, XFS_ATTR_FORK);
 	if (ip->i_cowfp)
 		xfs_idestroy_fork(ip, XFS_COW_FORK);
 }
@@ -1351,10 +1351,10 @@ xfs_buf_delwri_submit(
 
 	list_for_each_entry_safe(bp, n, buffer_list, b_list) {
 		list_del_init(&bp->b_list);
-		error2 = libxfs_bwrite(bp);
+		error2 = xfs_bwrite(bp);
 		if (!error)
 			error = error2;
-		libxfs_buf_relse(bp);
+		xfs_buf_relse(bp);
 	}
 
 	return error;
@@ -1376,7 +1376,7 @@ xfs_buf_delwri_cancel(
 		bp = list_first_entry(list, struct xfs_buf, b_list);
 
 		list_del_init(&bp->b_list);
-		libxfs_buf_relse(bp);
+		xfs_buf_relse(bp);
 	}
 }
 
@@ -1441,7 +1441,7 @@ libxfs_log_clear(
 			  next, bp);
 	if (bp) {
 		libxfs_buf_mark_dirty(bp);
-		libxfs_buf_relse(bp);
+		xfs_buf_relse(bp);
 	}
 
 	/*
@@ -1493,7 +1493,7 @@ libxfs_log_clear(
 				  tail_lsn, next, bp);
 		if (bp) {
 			libxfs_buf_mark_dirty(bp);
-			libxfs_buf_relse(bp);
+			xfs_buf_relse(bp);
 		}
 
 		blk += len;
libxfs/trans.c +39 -39
index ddd07cff..2569b580 100644
@@ -37,7 +37,7 @@ kmem_zone_t	*xfs_trans_zone;
  * in the mount structure.
  */
 void
-libxfs_trans_init(
+xfs_trans_init(
 	struct xfs_mount	*mp)
 {
 	xfs_trans_resv_calc(mp, &mp->m_resv);
@@ -47,7 +47,7 @@ libxfs_trans_init(
  * Add the given log item to the transaction's list of log items.
  */
 void
-libxfs_trans_add_item(
+xfs_trans_add_item(
 	struct xfs_trans	*tp,
 	struct xfs_log_item	*lip)
 {
@@ -63,7 +63,7 @@ libxfs_trans_add_item(
  * Unlink and free the given descriptor.
  */
 void
-libxfs_trans_del_item(
+xfs_trans_del_item(
 	struct xfs_log_item	*lip)
 {
 	clear_bit(XFS_LI_DIRTY, &lip->li_flags);
@@ -78,7 +78,7 @@ libxfs_trans_del_item(
  * chunk we've been working on and get a new transaction to continue.
  */
 int
-libxfs_trans_roll(
+xfs_trans_roll(
 	struct xfs_trans	**tpp)
 {
 	struct xfs_trans	*trans = *tpp;
@@ -246,7 +246,7 @@ undo_blocks:
 }
 
 int
-libxfs_trans_alloc(
+xfs_trans_alloc(
 	struct xfs_mount	*mp,
 	struct xfs_trans_res	*resp,
 	unsigned int		blocks,
@@ -289,7 +289,7 @@ libxfs_trans_alloc(
  * without any dirty data.
  */
 int
-libxfs_trans_alloc_empty(
+xfs_trans_alloc_empty(
 	struct xfs_mount		*mp,
 	struct xfs_trans		**tpp)
 {
@@ -304,17 +304,17 @@ libxfs_trans_alloc_empty(
  * permanent log reservation flag to avoid blowing asserts.
  */
 int
-libxfs_trans_alloc_rollable(
+xfs_trans_alloc_rollable(
 	struct xfs_mount	*mp,
 	unsigned int		blocks,
 	struct xfs_trans	**tpp)
 {
-	return libxfs_trans_alloc(mp, &M_RES(mp)->tr_itruncate, blocks,
+	return xfs_trans_alloc(mp, &M_RES(mp)->tr_itruncate, blocks,
 			0, 0, tpp);
 }
 
 void
-libxfs_trans_cancel(
+xfs_trans_cancel(
 	struct xfs_trans	*tp)
 {
 	trace_xfs_trans_cancel(tp, _RET_IP_);
@@ -351,7 +351,7 @@ xfs_buf_item_put(
  * then allocate one for it.  Then add the buf item to the transaction.
  */
 STATIC void
-_libxfs_trans_bjoin(
+_xfs_trans_bjoin(
 	struct xfs_trans	*tp,
 	struct xfs_buf		*bp,
 	int			reset_recur)
@@ -380,11 +380,11 @@ _libxfs_trans_bjoin(
 }
 
 void
-libxfs_trans_bjoin(
+xfs_trans_bjoin(
 	struct xfs_trans	*tp,
 	struct xfs_buf		*bp)
 {
-	_libxfs_trans_bjoin(tp, bp, 0);
+	_xfs_trans_bjoin(tp, bp, 0);
 	trace_xfs_trans_bjoin(bp->b_log_item);
 }
 
@@ -393,7 +393,7 @@ libxfs_trans_bjoin(
  * for this transaction.
  */
 void
-libxfs_trans_bhold_release(
+xfs_trans_bhold_release(
 	xfs_trans_t		*tp,
 	xfs_buf_t		*bp)
 {
@@ -416,7 +416,7 @@ libxfs_trans_bhold_release(
  * get_buf() call.
  */
 int
-libxfs_trans_get_buf_map(
+xfs_trans_get_buf_map(
 	struct xfs_trans	*tp,
 	struct xfs_buftarg	*target,
 	struct xfs_buf_map	*map,
@@ -430,7 +430,7 @@ libxfs_trans_get_buf_map(
 
 	*bpp = NULL;
 	if (!tp)
-		return libxfs_buf_get_map(target, map, nmaps, 0, bpp);
+		return xfs_buf_get_map(target, map, nmaps, 0, bpp);
 
 	/*
 	 * If we find the buffer in the cache with this transaction
@@ -449,20 +449,20 @@ libxfs_trans_get_buf_map(
 		return 0;
 	}
 
-	error = libxfs_buf_get_map(target, map, nmaps, 0, &bp);
+	error = xfs_buf_get_map(target, map, nmaps, 0, &bp);
 	if (error)
 		return error;
 
 	ASSERT(!bp->b_error);
 
-	_libxfs_trans_bjoin(tp, bp, 1);
+	_xfs_trans_bjoin(tp, bp, 1);
 	trace_xfs_trans_get_buf(bp->b_log_item);
 	*bpp = bp;
 	return 0;
 }
 
 xfs_buf_t *
-libxfs_trans_getsb(
+xfs_trans_getsb(
 	xfs_trans_t		*tp,
 	struct xfs_mount	*mp)
 {
@@ -488,13 +488,13 @@ libxfs_trans_getsb(
 	if (bp == NULL)
 		return NULL;
 
-	_libxfs_trans_bjoin(tp, bp, 1);
+	_xfs_trans_bjoin(tp, bp, 1);
 	trace_xfs_trans_getsb(bp->b_log_item);
 	return bp;
 }
 
 int
-libxfs_trans_read_buf_map(
+xfs_trans_read_buf_map(
 	struct xfs_mount	*mp,
 	struct xfs_trans	*tp,
 	struct xfs_buftarg	*target,
@@ -511,7 +511,7 @@ libxfs_trans_read_buf_map(
 	*bpp = NULL;
 
 	if (tp == NULL)
-		return libxfs_buf_read_map(target, map, nmaps, flags, bpp, ops);
+		return xfs_buf_read_map(target, map, nmaps, flags, bpp, ops);
 
 	bp = xfs_trans_buf_item_match(tp, target, map, nmaps);
 	if (bp) {
@@ -523,11 +523,11 @@ libxfs_trans_read_buf_map(
 		goto done;
 	}
 
-	error = libxfs_buf_read_map(target, map, nmaps, flags, &bp, ops);
+	error = xfs_buf_read_map(target, map, nmaps, flags, &bp, ops);
 	if (error)
 		return error;
 
-	_libxfs_trans_bjoin(tp, bp, 1);
+	_xfs_trans_bjoin(tp, bp, 1);
 done:
 	trace_xfs_trans_read_buf(bp->b_log_item);
 	*bpp = bp;
@@ -547,7 +547,7 @@ done:
  * If the transaction pointer is NULL, this is a normal xfs_buf_relse() call.
  */
 void
-libxfs_trans_brelse(
+xfs_trans_brelse(
 	struct xfs_trans	*tp,
 	struct xfs_buf		*bp)
 {
@@ -556,7 +556,7 @@ libxfs_trans_brelse(
 	ASSERT(bp->b_transp == tp);
 
 	if (!tp) {
-		libxfs_buf_relse(bp);
+		xfs_buf_relse(bp);
 		return;
 	}
 
@@ -592,7 +592,7 @@ libxfs_trans_brelse(
 	xfs_buf_item_put(bip);
 
 	bp->b_transp = NULL;
-	libxfs_buf_relse(bp);
+	xfs_buf_relse(bp);
 }
 
 /*
@@ -602,7 +602,7 @@ libxfs_trans_brelse(
  */
 /* ARGSUSED */
 void
-libxfs_trans_bhold(
+xfs_trans_bhold(
 	xfs_trans_t		*tp,
 	xfs_buf_t		*bp)
 {
@@ -619,7 +619,7 @@ libxfs_trans_bhold(
  * Mark a buffer dirty in the transaction.
  */
 void
-libxfs_trans_dirty_buf(
+xfs_trans_dirty_buf(
 	struct xfs_trans	*tp,
 	struct xfs_buf		*bp)
 {
@@ -642,7 +642,7 @@ libxfs_trans_dirty_buf(
  * value of b_blkno.
  */
 void
-libxfs_trans_log_buf(
+xfs_trans_log_buf(
 	struct xfs_trans	*tp,
 	struct xfs_buf		*bp,
 	uint			first,
@@ -659,7 +659,7 @@ libxfs_trans_log_buf(
 }
 
 void
-libxfs_trans_binval(
+xfs_trans_binval(
 	xfs_trans_t		*tp,
 	xfs_buf_t		*bp)
 {
@@ -693,7 +693,7 @@ libxfs_trans_binval(
  */
 /* ARGSUSED */
 void
-libxfs_trans_inode_alloc_buf(
+xfs_trans_inode_alloc_buf(
 	xfs_trans_t		*tp,
 	xfs_buf_t		*bp)
 {
@@ -713,7 +713,7 @@ libxfs_trans_inode_alloc_buf(
  * If the buffer is already dirty, trigger the "already logged" return condition.
  */
 bool
-libxfs_trans_ordered_buf(
+xfs_trans_ordered_buf(
 	struct xfs_trans	*tp,
 	struct xfs_buf		*bp)
 {
@@ -721,7 +721,7 @@ libxfs_trans_ordered_buf(
 	bool			ret;
 
 	ret = test_bit(XFS_LI_DIRTY, &bip->bli_item.li_flags);
-	libxfs_trans_log_buf(tp, bp, 0, bp->b_bcount);
+	xfs_trans_log_buf(tp, bp, 0, bp->b_bcount);
 	return ret;
 }
 
@@ -737,7 +737,7 @@ libxfs_trans_ordered_buf(
  * Originally derived from xfs_trans_mod_sb().
  */
 void
-libxfs_trans_mod_sb(
+xfs_trans_mod_sb(
 	xfs_trans_t		*tp,
 	uint			field,
 	long			delta)
@@ -829,12 +829,12 @@ inode_item_done(
 	if (error) {
 		fprintf(stderr, _("%s: warning - iflush_int failed (%d)\n"),
 			progname, error);
-		libxfs_buf_relse(bp);
+		xfs_buf_relse(bp);
 		goto free;
 	}
 
 	libxfs_buf_mark_dirty(bp);
-	libxfs_buf_relse(bp);
+	xfs_buf_relse(bp);
 free:
 	xfs_inode_item_put(iip);
 }
@@ -859,7 +859,7 @@ buf_item_done(
 	xfs_buf_item_put(bip);
 	if (hold)
 		return;
-	libxfs_buf_relse(bp);
+	xfs_buf_relse(bp);
 }
 
 static void
@@ -897,7 +897,7 @@ buf_item_unlock(
 	bip->bli_flags &= ~XFS_BLI_HOLD;
 	xfs_buf_item_put(bip);
 	if (!hold)
-		libxfs_buf_relse(bp);
+		xfs_buf_relse(bp);
 }
 
 static void
@@ -985,7 +985,7 @@ out_unreserve:
 }
 
 int
-libxfs_trans_commit(
+xfs_trans_commit(
 	struct xfs_trans	*tp)
 {
 	return __xfs_trans_commit(tp, false);
libxfs/util.c +4 -4
index 914e4ca5..523d5950 100644
@@ -383,7 +383,7 @@ libxfs_iflush_int(xfs_inode_t *ip, xfs_buf_t *bp)
 		VFS_I(ip)->i_version++;
 
 	/* Check the inline fork data before we write out. */
-	if (!libxfs_inode_verify_forks(ip))
+	if (!xfs_inode_verify_forks(ip))
 		return -EFSCORRUPTED;
 
 	/*
@@ -432,7 +432,7 @@ libxfs_mod_incore_sb(
  * Originally derived from xfs_alloc_file_space().
  */
 int
-libxfs_alloc_file_space(
+xfs_alloc_file_space(
 	xfs_inode_t	*ip,
 	xfs_off_t	offset,
 	xfs_off_t	len,
@@ -516,7 +516,7 @@ error0:	/* Cancel bmap, cancel trans */
  * other in repair - now there is just the one.
  */
 int
-libxfs_inode_alloc(
+xfs_inode_alloc(
 	xfs_trans_t	**tp,
 	xfs_inode_t	*pip,
 	mode_t		mode,
@@ -700,7 +700,7 @@ xfs_fsb_to_db(struct xfs_inode *ip, xfs_fsblock_t fsb)
 }
 
 int
-libxfs_zero_extent(
+xfs_zero_extent(
 	struct xfs_inode *ip,
 	xfs_fsblock_t	start_fsb,
 	xfs_off_t	count_fsb)
libxlog/xfs_log_recover.c +14 -14
index 78fbafab..7db0be47 100644
@@ -69,7 +69,7 @@ xlog_get_bp(
 		nbblks += log->l_sectBBsize;
 	nbblks = round_up(nbblks, log->l_sectBBsize);
 
-	libxfs_buf_get_uncached(log->l_dev, nbblks, 0, &bp);
+	xfs_buf_get_uncached(log->l_dev, nbblks, 0, &bp);
 	return bp;
 }
 
@@ -270,7 +270,7 @@ xlog_find_verify_cycle(
 	*new_blk = -1;
 
 out:
-	libxfs_buf_relse(bp);
+	xfs_buf_relse(bp);
 	return error;
 }
 
@@ -379,7 +379,7 @@ xlog_find_verify_log_record(
 		*last_blk = i;
 
 out:
-	libxfs_buf_relse(bp);
+	xfs_buf_relse(bp);
 	return error;
 }
 
@@ -630,7 +630,7 @@ validate_head:
 			goto bp_err;
 	}
 
-	libxfs_buf_relse(bp);
+	xfs_buf_relse(bp);
 	if (head_blk == log_bbnum)
 		*return_head_blk = 0;
 	else
@@ -644,7 +644,7 @@ validate_head:
 	return 0;
 
  bp_err:
-	libxfs_buf_relse(bp);
+	xfs_buf_relse(bp);
 
 	if (error)
 		xfs_warn(log->l_mp, "failed to find log head");
@@ -741,7 +741,7 @@ xlog_find_tail(
 	}
 	if (!found) {
 		xfs_warn(log->l_mp, "%s: couldn't find sync record", __func__);
-		libxfs_buf_relse(bp);
+		xfs_buf_relse(bp);
 		ASSERT(0);
 		return XFS_ERROR(EIO);
 	}
@@ -854,7 +854,7 @@ xlog_find_tail(
 		error = xlog_clear_stale_blocks(log, tail_lsn);
 
 done:
-	libxfs_buf_relse(bp);
+	xfs_buf_relse(bp);
 
 	if (error)
 		xfs_warn(log->l_mp, "failed to locate log tail");
@@ -902,7 +902,7 @@ xlog_find_zeroed(
 	first_cycle = xlog_get_cycle(offset);
 	if (first_cycle == 0) {		/* completely zeroed log */
 		*blk_no = 0;
-		libxfs_buf_relse(bp);
+		xfs_buf_relse(bp);
 		return -1;
 	}
 
@@ -913,7 +913,7 @@ xlog_find_zeroed(
 
 	last_cycle = xlog_get_cycle(offset);
 	if (last_cycle != 0) {		/* log completely written to */
-		libxfs_buf_relse(bp);
+		xfs_buf_relse(bp);
 		return 0;
 	} else if (first_cycle != 1) {
 		/*
@@ -970,7 +970,7 @@ xlog_find_zeroed(
 
 	*blk_no = last_blk;
 bp_err:
-	libxfs_buf_relse(bp);
+	xfs_buf_relse(bp);
 	if (error)
 		return error;
 	return -1;
@@ -1453,7 +1453,7 @@ xlog_do_recovery_pass(
 			hblks = h_size / XLOG_HEADER_CYCLE_SIZE;
 			if (h_size % XLOG_HEADER_CYCLE_SIZE)
 				hblks++;
-			libxfs_buf_relse(hbp);
+			xfs_buf_relse(hbp);
 			hbp = xlog_get_bp(log, hblks);
 		} else {
 			hblks = 1;
@@ -1469,7 +1469,7 @@ xlog_do_recovery_pass(
 		return ENOMEM;
 	dbp = xlog_get_bp(log, BTOBB(h_size));
 	if (!dbp) {
-		libxfs_buf_relse(hbp);
+		xfs_buf_relse(hbp);
 		return ENOMEM;
 	}
 
@@ -1653,8 +1653,8 @@ xlog_do_recovery_pass(
 	}
 
  bread_err2:
-	libxfs_buf_relse(dbp);
+	xfs_buf_relse(dbp);
  bread_err1:
-	libxfs_buf_relse(hbp);
+	xfs_buf_relse(hbp);
 	return error;
 }
logprint/log_misc.c +2 -2
index be889887..9cf8a3c0 100644
@@ -489,12 +489,12 @@ xlog_print_dir2_sf(
 	count = sfp->count;
 	sfep = xfs_dir2_sf_firstentry(sfp);
 	for (i = 0; i < count; i++) {
-		ino = libxfs_dir2_sf_get_ino(log->l_mp, sfp, sfep);
+		ino = xfs_dir2_sf_get_ino(log->l_mp, sfp, sfep);
 		memmove(namebuf, (sfep->name), sfep->namelen);
 		namebuf[sfep->namelen] = '\0';
 		printf(_("%s ino 0x%llx namelen %d\n"),
 		       namebuf, (unsigned long long)ino, sfep->namelen);
-		sfep = libxfs_dir2_sf_nextentry(log->l_mp, sfp, sfep);
+		sfep = xfs_dir2_sf_nextentry(log->l_mp, sfp, sfep);
 	}
 }
 
logprint/log_print_all.c +1 -1
index e2e28b9c..6ce09a51 100644
@@ -39,7 +39,7 @@ xlog_print_find_oldest(
 		error = xlog_find_cycle_start(log, bp, first_blk,
 					      last_blk, last_half_cycle);
 
-	libxfs_buf_relse(bp);
+	xfs_buf_relse(bp);
 	return error;
 }
 
logprint/logprint.c +1 -1
index e882c5d4..b86a2dac 100644
@@ -79,7 +79,7 @@ logstat(xfs_mount_t *mp)
 		 * Conjure up a mount structure
 		 */
 		sb = &mp->m_sb;
-		libxfs_sb_from_disk(sb, (xfs_dsb_t *)buf);
+		xfs_sb_from_disk(sb, (xfs_dsb_t *)buf);
 		mp->m_blkbb_log = sb->sb_blocklog - BBSHIFT;
 
 		x.logBBsize = XFS_FSB_TO_BB(mp, sb->sb_logblocks);
mdrestore/xfs_mdrestore.c +2 -2
index 1cd399db..665e63fc 100644
@@ -89,7 +89,7 @@ perform_restore(
 	if (fread(block_buffer, mb_count << mbp->mb_blocklog, 1, src_f) != 1)
 		fatal("error reading from metadump file\n");
 
-	libxfs_sb_from_disk(&sb, (xfs_dsb_t *)block_buffer);
+	xfs_sb_from_disk(&sb, (xfs_dsb_t *)block_buffer);
 
 	if (sb.sb_magicnum != XFS_SB_MAGIC)
 		fatal("bad magic number for primary superblock\n");
@@ -163,7 +163,7 @@ perform_restore(
 
 	memset(block_buffer, 0, sb.sb_sectsize);
 	sb.sb_inprogress = 0;
-	libxfs_sb_to_disk((xfs_dsb_t *)block_buffer, &sb);
+	xfs_sb_to_disk((xfs_dsb_t *)block_buffer, &sb);
 	if (xfs_sb_version_hascrc(&sb)) {
 		xfs_update_cksum(block_buffer, sb.sb_sectsize,
 				 offsetof(struct xfs_sb, sb_crc));
mkfs/proto.c +56 -56
index 01b30c5f..191fde07 100644
@@ -123,7 +123,7 @@ getres(
 	uint		r;
 
 	for (i = 0, r = MKFS_BLOCKRES(blocks); r >= blocks; r--) {
-		i = -libxfs_trans_alloc_rollable(mp, r, &tp);
+		i = -xfs_trans_alloc_rollable(mp, r, &tp);
 		if (i == 0)
 			return tp;
 	}
@@ -179,7 +179,7 @@ rsvfile(
 	int		error;
 	xfs_trans_t	*tp;
 
-	error = -libxfs_alloc_file_space(ip, 0, llen, 1, 0);
+	error = -xfs_alloc_file_space(ip, 0, llen, 1, 0);
 
 	if (error) {
 		fail(_("error reserving space for a file"), error);
@@ -189,10 +189,10 @@ rsvfile(
 	/*
 	 * update the inode timestamp, mode, and prealloc flag bits
 	 */
-	error = -libxfs_trans_alloc_rollable(mp, 0, &tp);
+	error = -xfs_trans_alloc_rollable(mp, 0, &tp);
 	if (error)
 		fail(_("allocating transaction for a file"), error);
-	libxfs_trans_ijoin(tp, ip, 0);
+	xfs_trans_ijoin(tp, ip, 0);
 
 	VFS_I(ip)->i_mode &= ~S_ISUID;
 
@@ -206,12 +206,12 @@ rsvfile(
 	if (VFS_I(ip)->i_mode & S_IXGRP)
 		VFS_I(ip)->i_mode &= ~S_ISGID;
 
-	libxfs_trans_ichgtime(tp, ip, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
+	xfs_trans_ichgtime(tp, ip, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
 
 	ip->i_d.di_flags |= XFS_DIFLAG_PREALLOC;
 
-	libxfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
-	error = -libxfs_trans_commit(tp);
+	xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
+	error = -xfs_trans_commit(tp);
 	if (error)
 		fail(_("committing space for a file failed"), error);
 }
@@ -237,13 +237,13 @@ newfile(
 	flags = 0;
 	mp = ip->i_mount;
 	if (symlink && len <= XFS_IFORK_DSIZE(ip)) {
-		libxfs_init_local_fork(ip, XFS_DATA_FORK, buf, len);
+		xfs_init_local_fork(ip, XFS_DATA_FORK, buf, len);
 		ip->i_d.di_format = XFS_DINODE_FMT_LOCAL;
 		flags = XFS_ILOG_DDATA;
 	} else if (len > 0) {
 		nb = XFS_B_TO_FSB(mp, len);
 		nmap = 1;
-		error = -libxfs_bmapi_write(tp, ip, 0, nb, 0, nb, &map, &nmap);
+		error = -xfs_bmapi_write(tp, ip, 0, nb, 0, nb, &map, &nmap);
 		if (error) {
 			fail(_("error allocating space for a file"), error);
 		}
@@ -254,7 +254,7 @@ newfile(
 			exit(1);
 		}
 		d = XFS_FSB_TO_DADDR(mp, map.br_startblock);
-		error = -libxfs_trans_get_buf(logit ? tp : NULL, mp->m_dev, d,
+		error = -xfs_trans_get_buf(logit ? tp : NULL, mp->m_dev, d,
 				nb << mp->m_blkbb_log, 0, &bp);
 		if (error) {
 			fprintf(stderr,
@@ -266,10 +266,10 @@ newfile(
 		if (len < bp->b_bcount)
 			memset((char *)bp->b_addr + len, 0, bp->b_bcount - len);
 		if (logit)
-			libxfs_trans_log_buf(tp, bp, 0, bp->b_bcount - 1);
+			xfs_trans_log_buf(tp, bp, 0, bp->b_bcount - 1);
 		else {
 			libxfs_buf_mark_dirty(bp);
-			libxfs_buf_relse(bp);
+			xfs_buf_relse(bp);
 		}
 	}
 	ip->i_d.di_size = len;
@@ -318,7 +318,7 @@ newdirent(
 
 	rsv = XFS_DIRENTER_SPACE_RES(mp, name->len);
 
-	error = -libxfs_dir_createname(tp, pip, name, inum, rsv);
+	error = -xfs_dir_createname(tp, pip, name, inum, rsv);
 	if (error)
 		fail(_("directory createname error"), error);
 }
@@ -332,7 +332,7 @@ newdirectory(
 {
 	int	error;
 
-	error = -libxfs_dir_init(tp, dp, pdp);
+	error = -xfs_dir_init(tp, dp, pdp);
 	if (error)
 		fail(_("directory create error"), error);
 }
@@ -444,14 +444,14 @@ parseproto(
 	case IF_REGULAR:
 		buf = newregfile(pp, &len);
 		tp = getres(mp, XFS_B_TO_FSB(mp, len));
-		error = -libxfs_inode_alloc(&tp, pip, mode|S_IFREG, 1, 0,
+		error = -xfs_inode_alloc(&tp, pip, mode|S_IFREG, 1, 0,
 					   &creds, fsxp, &ip);
 		if (error)
 			fail(_("Inode allocation failed"), error);
 		flags |= newfile(tp, ip, 0, 0, buf, len);
 		if (buf)
 			free(buf);
-		libxfs_trans_ijoin(tp, pip, 0);
+		xfs_trans_ijoin(tp, pip, 0);
 		xname.type = XFS_DIR3_FT_REG_FILE;
 		newdirent(mp, tp, pip, &xname, ip->i_ino);
 		break;
@@ -468,17 +468,17 @@ parseproto(
 		}
 		tp = getres(mp, XFS_B_TO_FSB(mp, llen));
 
-		error = -libxfs_inode_alloc(&tp, pip, mode|S_IFREG, 1, 0,
+		error = -xfs_inode_alloc(&tp, pip, mode|S_IFREG, 1, 0,
 					  &creds, fsxp, &ip);
 		if (error)
 			fail(_("Inode pre-allocation failed"), error);
 
-		libxfs_trans_ijoin(tp, pip, 0);
+		xfs_trans_ijoin(tp, pip, 0);
 
 		xname.type = XFS_DIR3_FT_REG_FILE;
 		newdirent(mp, tp, pip, &xname, ip->i_ino);
-		libxfs_trans_log_inode(tp, ip, flags);
-		error = -libxfs_trans_commit(tp);
+		xfs_trans_log_inode(tp, ip, flags);
+		error = -xfs_trans_commit(tp);
 		if (error)
 			fail(_("Space preallocation failed."), error);
 		rsvfile(mp, ip, llen);
@@ -489,12 +489,12 @@ parseproto(
 		tp = getres(mp, 0);
 		majdev = getnum(getstr(pp), 0, 0, false);
 		mindev = getnum(getstr(pp), 0, 0, false);
-		error = -libxfs_inode_alloc(&tp, pip, mode|S_IFBLK, 1,
+		error = -xfs_inode_alloc(&tp, pip, mode|S_IFBLK, 1,
 				IRIX_MKDEV(majdev, mindev), &creds, fsxp, &ip);
 		if (error) {
 			fail(_("Inode allocation failed"), error);
 		}
-		libxfs_trans_ijoin(tp, pip, 0);
+		xfs_trans_ijoin(tp, pip, 0);
 		xname.type = XFS_DIR3_FT_BLKDEV;
 		newdirent(mp, tp, pip, &xname, ip->i_ino);
 		flags |= XFS_ILOG_DEV;
@@ -504,11 +504,11 @@ parseproto(
 		tp = getres(mp, 0);
 		majdev = getnum(getstr(pp), 0, 0, false);
 		mindev = getnum(getstr(pp), 0, 0, false);
-		error = -libxfs_inode_alloc(&tp, pip, mode|S_IFCHR, 1,
+		error = -xfs_inode_alloc(&tp, pip, mode|S_IFCHR, 1,
 				IRIX_MKDEV(majdev, mindev), &creds, fsxp, &ip);
 		if (error)
 			fail(_("Inode allocation failed"), error);
-		libxfs_trans_ijoin(tp, pip, 0);
+		xfs_trans_ijoin(tp, pip, 0);
 		xname.type = XFS_DIR3_FT_CHRDEV;
 		newdirent(mp, tp, pip, &xname, ip->i_ino);
 		flags |= XFS_ILOG_DEV;
@@ -516,11 +516,11 @@ parseproto(
 
 	case IF_FIFO:
 		tp = getres(mp, 0);
-		error = -libxfs_inode_alloc(&tp, pip, mode|S_IFIFO, 1, 0,
+		error = -xfs_inode_alloc(&tp, pip, mode|S_IFIFO, 1, 0,
 				&creds, fsxp, &ip);
 		if (error)
 			fail(_("Inode allocation failed"), error);
-		libxfs_trans_ijoin(tp, pip, 0);
+		xfs_trans_ijoin(tp, pip, 0);
 		xname.type = XFS_DIR3_FT_FIFO;
 		newdirent(mp, tp, pip, &xname, ip->i_ino);
 		break;
@@ -528,18 +528,18 @@ parseproto(
 		buf = getstr(pp);
 		len = (int)strlen(buf);
 		tp = getres(mp, XFS_B_TO_FSB(mp, len));
-		error = -libxfs_inode_alloc(&tp, pip, mode|S_IFLNK, 1, 0,
+		error = -xfs_inode_alloc(&tp, pip, mode|S_IFLNK, 1, 0,
 				&creds, fsxp, &ip);
 		if (error)
 			fail(_("Inode allocation failed"), error);
 		flags |= newfile(tp, ip, 1, 1, buf, len);
-		libxfs_trans_ijoin(tp, pip, 0);
+		xfs_trans_ijoin(tp, pip, 0);
 		xname.type = XFS_DIR3_FT_SYMLINK;
 		newdirent(mp, tp, pip, &xname, ip->i_ino);
 		break;
 	case IF_DIRECTORY:
 		tp = getres(mp, 0);
-		error = -libxfs_inode_alloc(&tp, pip, mode|S_IFDIR, 1, 0,
+		error = -xfs_inode_alloc(&tp, pip, mode|S_IFDIR, 1, 0,
 				&creds, fsxp, &ip);
 		if (error)
 			fail(_("Inode allocation failed"), error);
@@ -547,18 +547,18 @@ parseproto(
 		if (!pip) {
 			pip = ip;
 			mp->m_sb.sb_rootino = ip->i_ino;
-			libxfs_log_sb(tp);
+			xfs_log_sb(tp);
 			isroot = 1;
 		} else {
-			libxfs_trans_ijoin(tp, pip, 0);
+			xfs_trans_ijoin(tp, pip, 0);
 			xname.type = XFS_DIR3_FT_DIR;
 			newdirent(mp, tp, pip, &xname, ip->i_ino);
 			inc_nlink(VFS_I(pip));
-			libxfs_trans_log_inode(tp, pip, XFS_ILOG_CORE);
+			xfs_trans_log_inode(tp, pip, XFS_ILOG_CORE);
 		}
 		newdirectory(mp, tp, ip, pip);
-		libxfs_trans_log_inode(tp, ip, flags);
-		error = -libxfs_trans_commit(tp);
+		xfs_trans_log_inode(tp, ip, flags);
+		error = -xfs_trans_commit(tp);
 		if (error)
 			fail(_("Directory inode allocation failed."), error);
 		/*
@@ -582,8 +582,8 @@ parseproto(
 		ASSERT(0);
 		fail(_("Unknown format"), EINVAL);
 	}
-	libxfs_trans_log_inode(tp, ip, flags);
-	error = -libxfs_trans_commit(tp);
+	xfs_trans_log_inode(tp, ip, flags);
+	error = -xfs_trans_commit(tp);
 	if (error) {
 		fail(_("Error encountered creating file from prototype file"),
 			error);
@@ -625,13 +625,13 @@ rtinit(
 	/*
 	 * First, allocate the inodes.
 	 */
-	i = -libxfs_trans_alloc_rollable(mp, MKFS_BLOCKRES_INODE, &tp);
+	i = -xfs_trans_alloc_rollable(mp, MKFS_BLOCKRES_INODE, &tp);
 	if (i)
 		res_failed(i);
 
 	memset(&creds, 0, sizeof(creds));
 	memset(&fsxattrs, 0, sizeof(fsxattrs));
-	error = -libxfs_inode_alloc(&tp, NULL, S_IFREG, 1, 0,
+	error = -xfs_inode_alloc(&tp, NULL, S_IFREG, 1, 0,
 					&creds, &fsxattrs, &rbmip);
 	if (error) {
 		fail(_("Realtime bitmap inode allocation failed"), error);
@@ -645,19 +645,19 @@ rtinit(
 	rbmip->i_d.di_size = mp->m_sb.sb_rbmblocks * mp->m_sb.sb_blocksize;
 	rbmip->i_d.di_flags = XFS_DIFLAG_NEWRTBM;
 	*(uint64_t *)&VFS_I(rbmip)->i_atime = 0;
-	libxfs_trans_log_inode(tp, rbmip, XFS_ILOG_CORE);
-	libxfs_log_sb(tp);
+	xfs_trans_log_inode(tp, rbmip, XFS_ILOG_CORE);
+	xfs_log_sb(tp);
 	mp->m_rbmip = rbmip;
-	error = -libxfs_inode_alloc(&tp, NULL, S_IFREG, 1, 0,
+	error = -xfs_inode_alloc(&tp, NULL, S_IFREG, 1, 0,
 					&creds, &fsxattrs, &rsumip);
 	if (error) {
 		fail(_("Realtime summary inode allocation failed"), error);
 	}
 	mp->m_sb.sb_rsumino = rsumip->i_ino;
 	rsumip->i_d.di_size = mp->m_rsumsize;
-	libxfs_trans_log_inode(tp, rsumip, XFS_ILOG_CORE);
-	libxfs_log_sb(tp);
-	error = -libxfs_trans_commit(tp);
+	xfs_trans_log_inode(tp, rsumip, XFS_ILOG_CORE);
+	xfs_log_sb(tp);
+	error = -xfs_trans_commit(tp);
 	if (error)
 		fail(_("Completion of the realtime summary inode failed"),
 				error);
@@ -667,15 +667,15 @@ rtinit(
 	 */
 	blocks = mp->m_sb.sb_rbmblocks +
 			XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK) - 1;
-	i = -libxfs_trans_alloc_rollable(mp, blocks, &tp);
+	i = -xfs_trans_alloc_rollable(mp, blocks, &tp);
 	if (i)
 		res_failed(i);
 
-	libxfs_trans_ijoin(tp, rbmip, 0);
+	xfs_trans_ijoin(tp, rbmip, 0);
 	bno = 0;
 	while (bno < mp->m_sb.sb_rbmblocks) {
 		nmap = XFS_BMAP_MAX_NMAP;
-		error = -libxfs_bmapi_write(tp, rbmip, bno,
+		error = -xfs_bmapi_write(tp, rbmip, bno,
 				(xfs_extlen_t)(mp->m_sb.sb_rbmblocks - bno),
 				0, mp->m_sb.sb_rbmblocks, map, &nmap);
 		if (error) {
@@ -690,7 +690,7 @@ rtinit(
 		}
 	}
 
-	error = -libxfs_trans_commit(tp);
+	error = -xfs_trans_commit(tp);
 	if (error)
 		fail(_("Block allocation of the realtime bitmap inode failed"),
 				error);
@@ -700,14 +700,14 @@ rtinit(
 	 */
 	nsumblocks = mp->m_rsumsize >> mp->m_sb.sb_blocklog;
 	blocks = nsumblocks + XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK) - 1;
-	i = -libxfs_trans_alloc_rollable(mp, blocks, &tp);
+	i = -xfs_trans_alloc_rollable(mp, blocks, &tp);
 	if (i)
 		res_failed(i);
-	libxfs_trans_ijoin(tp, rsumip, 0);
+	xfs_trans_ijoin(tp, rsumip, 0);
 	bno = 0;
 	while (bno < nsumblocks) {
 		nmap = XFS_BMAP_MAX_NMAP;
-		error = -libxfs_bmapi_write(tp, rsumip, bno,
+		error = -xfs_bmapi_write(tp, rsumip, bno,
 				(xfs_extlen_t)(nsumblocks - bno),
 				0, nsumblocks, map, &nmap);
 		if (error) {
@@ -721,7 +721,7 @@ rtinit(
 			bno += ep->br_blockcount;
 		}
 	}
-	error = -libxfs_trans_commit(tp);
+	error = -xfs_trans_commit(tp);
 	if (error)
 		fail(_("Block allocation of the realtime summary inode failed"),
 				error);
@@ -731,19 +731,19 @@ rtinit(
 	 * Do one transaction per bitmap block.
 	 */
 	for (bno = 0; bno < mp->m_sb.sb_rextents; bno = ebno) {
-		i = -libxfs_trans_alloc(mp, &M_RES(mp)->tr_itruncate,
+		i = -xfs_trans_alloc(mp, &M_RES(mp)->tr_itruncate,
 				0, 0, 0, &tp);
 		if (i)
 			res_failed(i);
-		libxfs_trans_ijoin(tp, rbmip, 0);
+		xfs_trans_ijoin(tp, rbmip, 0);
 		ebno = XFS_RTMIN(mp->m_sb.sb_rextents,
 			bno + NBBY * mp->m_sb.sb_blocksize);
-		error = -libxfs_rtfree_extent(tp, bno, (xfs_extlen_t)(ebno-bno));
+		error = -xfs_rtfree_extent(tp, bno, (xfs_extlen_t)(ebno-bno));
 		if (error) {
 			fail(_("Error initializing the realtime space"),
 				error);
 		}
-		error = -libxfs_trans_commit(tp);
+		error = -xfs_trans_commit(tp);
 		if (error)
 			fail(_("Initialization of the realtime space failed"),
 					error);
mkfs/xfs_mkfs.c +42 -42
index 2e6cd280..3a6e539f 100644
@@ -1140,7 +1140,7 @@ zero_old_xfs_structures(
 				strerror(errno));
 		goto done;
 	}
-	libxfs_sb_from_disk(&sb, buf);
+	xfs_sb_from_disk(&sb, buf);
 
 	/*
 	 * perform same basic superblock validation to make sure we
@@ -1754,7 +1754,7 @@ _("specified blocksize %d is less than device physical sector size %d\n"
 	} else
 		cfg->sectorsize = cli->sectorsize;
 
-	cfg->sectorlog = libxfs_highbit32(cfg->sectorsize);
+	cfg->sectorlog = xfs_highbit32(cfg->sectorsize);
 
 	/* validate specified/probed sector size */
 	if (cfg->sectorsize < XFS_MIN_SECTORSIZE ||
@@ -1792,7 +1792,7 @@ validate_blocksize(
 		cfg->blocksize = dft->blocksize;
 	else
 		cfg->blocksize = cli->blocksize;
-	cfg->blocklog = libxfs_highbit32(cfg->blocksize);
+	cfg->blocklog = xfs_highbit32(cfg->blocksize);
 
 	/* validate block sizes are in range */
 	if (cfg->blocksize < XFS_MIN_BLOCKSIZE ||
@@ -1837,7 +1837,7 @@ _("Can't change sector size on internal log!\n"));
 		cfg->lsectorsize = cfg->sectorsize;
 	else
 		cfg->lsectorsize = dft->sectorsize;
-	cfg->lsectorlog = libxfs_highbit32(cfg->lsectorsize);
+	cfg->lsectorlog = xfs_highbit32(cfg->lsectorsize);
 
 	if (cfg->lsectorsize < XFS_MIN_SECTORSIZE ||
 	    cfg->lsectorsize > XFS_MAX_SECTORSIZE ||
@@ -2019,7 +2019,7 @@ validate_dirblocksize(
 				cfg->dirblocksize);
 			usage();
 		}
-		cfg->dirblocklog = libxfs_highbit32(cfg->dirblocksize);
+		cfg->dirblocklog = xfs_highbit32(cfg->dirblocksize);
 		return;
 	}
 
@@ -2038,9 +2038,9 @@ validate_inodesize(
 {
 
 	if (cli->inopblock)
-		cfg->inodelog = cfg->blocklog - libxfs_highbit32(cli->inopblock);
+		cfg->inodelog = cfg->blocklog - xfs_highbit32(cli->inopblock);
 	else if (cli->inodesize)
-		cfg->inodelog = libxfs_highbit32(cli->inodesize);
+		cfg->inodelog = xfs_highbit32(cli->inodesize);
 	else if (cfg->sb_feat.crcs_enabled)
 		cfg->inodelog = XFS_DINODE_DFL_CRC_LOG;
 	else
@@ -2181,7 +2181,7 @@ validate_extsize_hint(
 	if (cli->fsx.fsx_xflags & FS_XFLAG_EXTSZINHERIT)
 		flags |= XFS_DIFLAG_EXTSZINHERIT;
 
-	fa = libxfs_inode_validate_extsize(mp, cli->fsx.fsx_extsize, S_IFDIR,
+	fa = xfs_inode_validate_extsize(mp, cli->fsx.fsx_extsize, S_IFDIR,
 			flags);
 	if (fa) {
 		fprintf(stderr,
@@ -2202,7 +2202,7 @@ _("illegal extent size hint %lld, must be less than %u.\n"),
 	if (cli->fsx.fsx_xflags & FS_XFLAG_EXTSZINHERIT)
 		flags |= XFS_DIFLAG_EXTSIZE;
 
-	fa = libxfs_inode_validate_extsize(mp, cli->fsx.fsx_extsize, S_IFREG,
+	fa = xfs_inode_validate_extsize(mp, cli->fsx.fsx_extsize, S_IFREG,
 			flags);
 
 	if (fa) {
@@ -2232,7 +2232,7 @@ validate_cowextsize_hint(
 	if (cli->fsx.fsx_xflags & FS_XFLAG_COWEXTSIZE)
 		flags2 |= XFS_DIFLAG2_COWEXTSIZE;
 
-	fa = libxfs_inode_validate_cowextsize(mp, cli->fsx.fsx_cowextsize,
+	fa = xfs_inode_validate_cowextsize(mp, cli->fsx.fsx_cowextsize,
 			S_IFDIR, 0, flags2);
 	if (fa) {
 		fprintf(stderr,
@@ -3062,7 +3062,7 @@ calculate_log_size(
 	memset(&mount, 0, sizeof(mount));
 	mount.m_sb = *sbp;
 	libxfs_mount(&mount, &mp->m_sb, 0, 0, 0, 0);
-	min_logblocks = libxfs_log_calc_minimum_size(&mount);
+	min_logblocks = xfs_log_calc_minimum_size(&mount);
 	libxfs_umount(&mount);
 
 	ASSERT(min_logblocks);
@@ -3134,7 +3134,7 @@ _("external log device %lld too small, must be at least %lld blocks\n"),
 		 * an AG.
 		 */
 		cfg->logblocks = min(cfg->logblocks,
-				     libxfs_alloc_ag_max_usable(mp) - 1);
+				     xfs_alloc_ag_max_usable(mp) - 1);
 
 		/* and now clamp the size to the maximum supported size */
 		cfg->logblocks = min(cfg->logblocks, XFS_MAX_LOG_BLOCKS);
@@ -3144,7 +3144,7 @@ _("external log device %lld too small, must be at least %lld blocks\n"),
 		validate_log_size(cfg->logblocks, cfg->blocklog, min_logblocks);
 	}
 
-	if (cfg->logblocks > sbp->sb_agblocks - libxfs_prealloc_blocks(mp)) {
+	if (cfg->logblocks > sbp->sb_agblocks - xfs_prealloc_blocks(mp)) {
 		fprintf(stderr,
 _("internal log size %lld too large, must fit in allocation group\n"),
 			(long long)cfg->logblocks);
@@ -3164,7 +3164,7 @@ _("log ag number %lld too large, must be less than %lld\n"),
 		cfg->logagno = (xfs_agnumber_t)(sbp->sb_agcount / 2);
 
 	cfg->logstart = XFS_AGB_TO_FSB(mp, cfg->logagno,
-				       libxfs_prealloc_blocks(mp));
+				       xfs_prealloc_blocks(mp));
 
 	/*
 	 * Align the logstart at stripe unit boundary.
@@ -3229,7 +3229,7 @@ initialise_mount(
 	struct xfs_mount	*mp,
 	struct xfs_sb		*sbp)
 {
-	/* Minimum needed for libxfs_prealloc_blocks() */
+	/* Minimum needed for xfs_prealloc_blocks() */
 	mp->m_blkbb_log = sbp->sb_blocklog - BBSHIFT;
 	mp->m_sectbb_log = sbp->sb_sectlog - BBSHIFT;
 }
@@ -3270,13 +3270,13 @@ finish_superblock_setup(
 	sbp->sb_rbmblocks = cfg->rtbmblocks;
 	sbp->sb_logblocks = (xfs_extlen_t)cfg->logblocks;
 	sbp->sb_rextslog = (uint8_t)(cfg->rtextents ?
-			libxfs_highbit32((unsigned int)cfg->rtextents) : 0);
+			xfs_highbit32((unsigned int)cfg->rtextents) : 0);
 	sbp->sb_inprogress = 1;	/* mkfs is in progress */
 	sbp->sb_imax_pct = cfg->imaxpct;
 	sbp->sb_icount = 0;
 	sbp->sb_ifree = 0;
 	sbp->sb_fdblocks = cfg->dblocks -
-			   cfg->agcount * libxfs_prealloc_blocks(mp) -
+			   cfg->agcount * xfs_prealloc_blocks(mp) -
 			   (cfg->loginternal ? cfg->logblocks : 0);
 	sbp->sb_frextents = 0;	/* will do a free later */
 	sbp->sb_uquotino = sbp->sb_gquotino = sbp->sb_pquotino = 0;
@@ -3296,7 +3296,7 @@ alloc_write_buf(
 	struct xfs_buf		*bp;
 	int			error;
 
-	error = -libxfs_buf_get_uncached(btp, bblen, 0, &bp);
+	error = -xfs_buf_get_uncached(btp, bblen, 0, &bp);
 	if (error) {
 		fprintf(stderr, _("Could not get memory for buffer, err=%d\n"),
 				error);
@@ -3359,7 +3359,7 @@ prepare_devices(
 			whack_blks);
 	memset(buf->b_addr, 0, WHACK_SIZE);
 	libxfs_buf_mark_dirty(buf);
-	libxfs_buf_relse(buf);
+	xfs_buf_relse(buf);
 
 	/*
 	 * Now zero out the beginning of the device, to obliterate any old
@@ -3370,16 +3370,16 @@ prepare_devices(
 	buf = alloc_write_buf(mp->m_ddev_targp, 0, whack_blks);
 	memset(buf->b_addr, 0, WHACK_SIZE);
 	libxfs_buf_mark_dirty(buf);
-	libxfs_buf_relse(buf);
+	xfs_buf_relse(buf);
 
 	/* OK, now write the superblock... */
 	buf = alloc_write_buf(mp->m_ddev_targp, XFS_SB_DADDR,
 			XFS_FSS_TO_BB(mp, 1));
 	buf->b_ops = &xfs_sb_buf_ops;
 	memset(buf->b_addr, 0, cfg->sectorsize);
-	libxfs_sb_to_disk(buf->b_addr, sbp);
+	xfs_sb_to_disk(buf->b_addr, sbp);
 	libxfs_buf_mark_dirty(buf);
-	libxfs_buf_relse(buf);
+	xfs_buf_relse(buf);
 
 	/* ...and zero the log.... */
 	lsunit = sbp->sb_logsunit;
@@ -3399,7 +3399,7 @@ prepare_devices(
 				BTOBB(cfg->blocksize));
 		memset(buf->b_addr, 0, cfg->blocksize);
 		libxfs_buf_mark_dirty(buf);
-		libxfs_buf_relse(buf);
+		xfs_buf_relse(buf);
 	}
 
 }
@@ -3422,14 +3422,14 @@ initialise_ag_headers(
 		.agno		= agno,
 		.agsize		= cfg->agsize,
 	};
-	struct xfs_perag	*pag = libxfs_perag_get(mp, agno);
+	struct xfs_perag	*pag = xfs_perag_get(mp, agno);
 	int			error;
 
 	if (agno == cfg->agcount - 1)
 		id.agsize = cfg->dblocks - (xfs_rfsblock_t)(agno * cfg->agsize);
 
 	INIT_LIST_HEAD(&id.buffer_list);
-	error = -libxfs_ag_init_headers(mp, &id);
+	error = -xfs_ag_init_headers(mp, &id);
 	if (error) {
 		fprintf(stderr, _("AG header init failed, error %d\n"), error);
 		exit(1);
@@ -3437,9 +3437,9 @@ initialise_ag_headers(
 
 	list_splice_tail_init(&id.buffer_list, buffer_list);
 
-	if (libxfs_alloc_min_freelist(mp, pag) > *worst_freelist)
-		*worst_freelist = libxfs_alloc_min_freelist(mp, pag);
-	libxfs_perag_put(pag);
+	if (xfs_alloc_min_freelist(mp, pag) > *worst_freelist)
+		*worst_freelist = xfs_alloc_min_freelist(mp, pag);
+	xfs_perag_put(pag);
 }
 
 static void
@@ -3452,7 +3452,7 @@ initialise_ag_freespace(
 	struct xfs_trans	*tp;
 	int			c;
 
-	c = -libxfs_trans_alloc_rollable(mp, worst_freelist, &tp);
+	c = -xfs_trans_alloc_rollable(mp, worst_freelist, &tp);
 	if (c)
 		res_failed(c);
 
@@ -3461,11 +3461,11 @@ initialise_ag_freespace(
 	args.mp = mp;
 	args.agno = agno;
 	args.alignment = 1;
-	args.pag = libxfs_perag_get(mp, agno);
+	args.pag = xfs_perag_get(mp, agno);
 
-	libxfs_alloc_fix_freelist(&args, 0);
-	libxfs_perag_put(args.pag);
-	c = -libxfs_trans_commit(tp);
+	xfs_alloc_fix_freelist(&args, 0);
+	xfs_perag_put(args.pag);
+	c = -xfs_trans_commit(tp);
 	if (c) {
 		errno = c;
 		perror(_("initializing AG free space list"));
@@ -3487,7 +3487,7 @@ rewrite_secondary_superblocks(
 	int			error;
 
 	/* rewrite the last superblock */
-	error = -libxfs_buf_read(mp->m_dev,
+	error = -xfs_buf_read(mp->m_dev,
 			XFS_AGB_TO_DADDR(mp, mp->m_sb.sb_agcount - 1,
 				XFS_SB_DADDR),
 			XFS_FSS_TO_BB(mp, 1), 0, &buf, &xfs_sb_buf_ops);
@@ -3499,13 +3499,13 @@ rewrite_secondary_superblocks(
 	dsb = buf->b_addr;
 	dsb->sb_rootino = cpu_to_be64(mp->m_sb.sb_rootino);
 	libxfs_buf_mark_dirty(buf);
-	libxfs_buf_relse(buf);
+	xfs_buf_relse(buf);
 
 	/* and one in the middle for luck if there's enough AGs for that */
 	if (mp->m_sb.sb_agcount <= 2)
 		return;
 
-	error = -libxfs_buf_read(mp->m_dev,
+	error = -xfs_buf_read(mp->m_dev,
 			XFS_AGB_TO_DADDR(mp, (mp->m_sb.sb_agcount - 1) / 2,
 				XFS_SB_DADDR),
 			XFS_FSS_TO_BB(mp, 1), 0, &buf, &xfs_sb_buf_ops);
@@ -3517,7 +3517,7 @@ rewrite_secondary_superblocks(
 	dsb = buf->b_addr;
 	dsb->sb_rootino = cpu_to_be64(mp->m_sb.sb_rootino);
 	libxfs_buf_mark_dirty(buf);
-	libxfs_buf_relse(buf);
+	xfs_buf_relse(buf);
 }
 
 static void
@@ -3541,7 +3541,7 @@ check_root_ino(
 	 * Fail the format immediately if those assumptions ever break, because
 	 * repair will toss the root directory.
 	 */
-	ino = libxfs_ialloc_calc_rootino(mp, mp->m_sb.sb_unit);
+	ino = xfs_ialloc_calc_rootino(mp, mp->m_sb.sb_unit);
 	if (mp->m_sb.sb_rootino != ino) {
 		fprintf(stderr,
 	_("%s: root inode (%llu) not allocated in expected location (%llu)\n"),
@@ -3772,7 +3772,7 @@ main(
 	if (!quiet || dry_run) {
 		struct xfs_fsop_geom	geo;
 
-		libxfs_fs_geometry(sbp, &geo, XFS_FS_GEOM_MAX_STRUCT_VER);
+		xfs_fs_geometry(sbp, &geo, XFS_FS_GEOM_MAX_STRUCT_VER);
 		xfs_report_geom(&geo, dfile, logfile, rtfile);
 		if (dry_run)
 			exit(0);
@@ -3813,7 +3813,7 @@ main(
 		if (agno % 16)
 			continue;
 
-		error = -libxfs_buf_delwri_submit(&buffer_list);
+		error = -xfs_buf_delwri_submit(&buffer_list);
 		if (error) {
 			fprintf(stderr,
 	_("%s: writing AG headers failed, err=%d\n"),
@@ -3822,7 +3822,7 @@ main(
 		}
 	}
 
-	error = -libxfs_buf_delwri_submit(&buffer_list);
+	error = -xfs_buf_delwri_submit(&buffer_list);
 	if (error) {
 		fprintf(stderr, _("%s: writing AG headers failed, err=%d\n"),
 				progname, error);
@@ -3867,7 +3867,7 @@ main(
 	dsb = buf->b_addr;
 	dsb->sb_inprogress = 0;
 	libxfs_buf_mark_dirty(buf);
-	libxfs_buf_relse(buf);
+	xfs_buf_relse(buf);
 
 	/* Exit w/ failure if anything failed to get written to our new fs. */
 	error = -libxfs_umount(mp);
repair/agheader.c +5 -5
index f28d8a7b..ab9b1bba 100644
@@ -79,18 +79,18 @@ verify_set_agf(xfs_mount_t *mp, xfs_agf_t *agf, xfs_agnumber_t i)
 	 * check first/last AGF fields.  if need be, lose the free
 	 * space in the AGFL, we'll reclaim it later.
 	 */
-	if (be32_to_cpu(agf->agf_flfirst) >= libxfs_agfl_size(mp)) {
+	if (be32_to_cpu(agf->agf_flfirst) >= xfs_agfl_size(mp)) {
 		do_warn(_("flfirst %d in agf %d too large (max = %u)\n"),
 			be32_to_cpu(agf->agf_flfirst),
-			i, libxfs_agfl_size(mp) - 1);
+			i, xfs_agfl_size(mp) - 1);
 		if (!no_modify)
 			agf->agf_flfirst = cpu_to_be32(0);
 	}
 
-	if (be32_to_cpu(agf->agf_fllast) >= libxfs_agfl_size(mp)) {
+	if (be32_to_cpu(agf->agf_fllast) >= xfs_agfl_size(mp)) {
 		do_warn(_("fllast %d in agf %d too large (max = %u)\n"),
 			be32_to_cpu(agf->agf_fllast),
-			i, libxfs_agfl_size(mp) - 1);
+			i, xfs_agfl_size(mp) - 1);
 		if (!no_modify)
 			agf->agf_fllast = cpu_to_be32(0);
 	}
@@ -338,7 +338,7 @@ secondary_sb_whack(
 	 * secondaries.
 	 *
 	 * Also, the in-core inode flags now have different meaning to the
-	 * on-disk flags, and so libxfs_sb_to_disk cannot directly write the
+	 * on-disk flags, and so xfs_sb_to_disk cannot directly write the
 	 * sb_gquotino/sb_pquotino fields without specific sb_qflags being set.
 	 * Hence we need to zero those fields directly in the sb buffer here.
 	 */
repair/attr_repair.c +22 -24
index 5f884033..32d59b8c 100644
@@ -293,7 +293,7 @@ process_shortform_attr(
 		}
 
 		/* namecheck checks for null chars in attr names. */
-		if (!libxfs_attr_namecheck(currententry->nameval,
+		if (!xfs_attr_namecheck(currententry->nameval,
 					   currententry->namelen)) {
 			do_warn(
 	_("entry contains illegal character in shortform attribute name\n"));
@@ -406,7 +406,7 @@ rmtval_get(xfs_mount_t *mp, xfs_ino_t ino, blkmap_t *blkmap,
 			clearit = 1;
 			break;
 		}
-		error = -libxfs_buf_read(mp->m_dev, XFS_FSB_TO_DADDR(mp, bno),
+		error = -xfs_buf_read(mp->m_dev, XFS_FSB_TO_DADDR(mp, bno),
 				XFS_FSB_TO_BB(mp, 1), LIBXFS_READBUF_SALVAGE,
 				&bp, &xfs_attr3_rmt_buf_ops);
 		if (error) {
@@ -419,7 +419,7 @@ rmtval_get(xfs_mount_t *mp, xfs_ino_t ino, blkmap_t *blkmap,
 		if (bp->b_error == -EFSBADCRC || bp->b_error == -EFSCORRUPTED) {
 			do_warn(
 	_("Corrupt remote block for attributes of inode %" PRIu64 "\n"), ino);
-			libxfs_buf_relse(bp);
+			xfs_buf_relse(bp);
 			clearit = 1;
 			break;
 		}
@@ -431,7 +431,7 @@ rmtval_get(xfs_mount_t *mp, xfs_ino_t ino, blkmap_t *blkmap,
 		amountdone += length;
 		value += length;
 		i++;
-		libxfs_buf_relse(bp);
+		xfs_buf_relse(bp);
 	}
 	return (clearit);
 }
@@ -458,8 +458,7 @@ process_leaf_attr_local(
 
 	local = xfs_attr3_leaf_name_local(leaf, i);
 	if (local->namelen == 0 ||
-	    !libxfs_attr_namecheck(local->nameval,
-				   local->namelen)) {
+	    !xfs_attr_namecheck(local->nameval, local->namelen)) {
 		do_warn(
 	_("attribute entry %d in attr block %u, inode %" PRIu64 " has bad name (namelen = %d)\n"),
 			i, da_bno, ino, local->namelen);
@@ -474,7 +473,7 @@ process_leaf_attr_local(
 	 * ordering anyway in case both the name value and the
 	 * hashvalue were wrong but matched. Unlikely, however.
 	 */
-	if (be32_to_cpu(entry->hashval) != libxfs_da_hashname(
+	if (be32_to_cpu(entry->hashval) != xfs_da_hashname(
 				&local->nameval[0], local->namelen) ||
 				be32_to_cpu(entry->hashval) < last_hashval) {
 		do_warn(
@@ -514,10 +513,9 @@ process_leaf_attr_remote(
 	remotep = xfs_attr3_leaf_name_remote(leaf, i);
 
 	if (remotep->namelen == 0 ||
-	    !libxfs_attr_namecheck(remotep->name,
-				   remotep->namelen) ||
+	    !xfs_attr_namecheck(remotep->name, remotep->namelen) ||
 	    be32_to_cpu(entry->hashval) !=
-			libxfs_da_hashname((unsigned char *)&remotep->name[0],
+			xfs_da_hashname((unsigned char *)&remotep->name[0],
 					   remotep->namelen) ||
 	    be32_to_cpu(entry->hashval) < last_hashval ||
 	    be32_to_cpu(remotep->valueblk) == 0) {
@@ -765,7 +763,7 @@ process_leaf_attr_level(xfs_mount_t	*mp,
 			goto error_out;
 		}
 
-		error = -libxfs_buf_read(mp->m_dev,
+		error = -xfs_buf_read(mp->m_dev,
 				XFS_FSB_TO_DADDR(mp, dev_bno),
 				XFS_FSB_TO_BB(mp, 1), LIBXFS_READBUF_SALVAGE,
 				&bp, &xfs_attr3_leaf_buf_ops);
@@ -785,7 +783,7 @@ process_leaf_attr_level(xfs_mount_t	*mp,
 			do_warn(
 	_("bad attribute leaf magic %#x for inode %" PRIu64 "\n"),
 				 leafhdr.magic, ino);
-			libxfs_buf_relse(bp);
+			xfs_buf_relse(bp);
 			goto error_out;
 		}
 
@@ -796,7 +794,7 @@ process_leaf_attr_level(xfs_mount_t	*mp,
 		if (process_leaf_attr_block(mp, leaf, da_bno, ino,
 				da_cursor->blkmap, current_hashval,
 				&greatest_hashval, &repair))  {
-			libxfs_buf_relse(bp);
+			xfs_buf_relse(bp);
 			goto error_out;
 		}
 
@@ -816,7 +814,7 @@ process_leaf_attr_level(xfs_mount_t	*mp,
 			do_warn(
 	_("bad sibling back pointer for block %u in attribute fork for inode %" PRIu64 "\n"),
 				da_bno, ino);
-			libxfs_buf_relse(bp);
+			xfs_buf_relse(bp);
 			goto error_out;
 		}
 
@@ -825,7 +823,7 @@ process_leaf_attr_level(xfs_mount_t	*mp,
 
 		if (da_bno != 0) {
 			if (verify_da_path(mp, da_cursor, 0, XFS_ATTR_FORK)) {
-				libxfs_buf_relse(bp);
+				xfs_buf_relse(bp);
 				goto error_out;
 			}
 		}
@@ -840,10 +838,10 @@ process_leaf_attr_level(xfs_mount_t	*mp,
 
 		if (repair && !no_modify) {
 			libxfs_buf_mark_dirty(bp);
-			libxfs_buf_relse(bp);
+			xfs_buf_relse(bp);
 		}
 		else
-			libxfs_buf_relse(bp);
+			xfs_buf_relse(bp);
 	} while (da_bno != 0);
 
 	if (verify_final_da_path(mp, da_cursor, 0, XFS_ATTR_FORK))  {
@@ -997,7 +995,7 @@ _("would clear forw/back pointers in block 0 for attributes in inode %" PRIu64 "
 	if (badness) {
 		*repair = 0;
 		/* the block is bad.  lose the attribute fork. */
-		libxfs_buf_relse(bp);
+		xfs_buf_relse(bp);
 		return 1;
 	}
 
@@ -1005,7 +1003,7 @@ _("would clear forw/back pointers in block 0 for attributes in inode %" PRIu64 "
 
 	if (*repair && !no_modify)
 		libxfs_buf_mark_dirty(bp);
-	libxfs_buf_relse(bp);
+	xfs_buf_relse(bp);
 
 	return 0;
 }
@@ -1023,7 +1021,7 @@ process_longform_da_root(
 	int			repairlinks = 0;
 	int			error;
 
-	libxfs_da3_node_hdr_from_disk(mp, &da3_hdr, bp->b_addr);
+	xfs_da3_node_hdr_from_disk(mp, &da3_hdr, bp->b_addr);
 	/*
 	 * check sibling pointers in leaf block or root block 0 before
 	 * we have to release the btree block
@@ -1049,7 +1047,7 @@ _("would clear forw/back pointers in block 0 for attributes in inode %" PRIu64 "
 		*repair = 1;
 		libxfs_buf_mark_dirty(bp);
 	}
-	libxfs_buf_relse(bp);
+	xfs_buf_relse(bp);
 	error = process_node_attr(mp, ino, dip, blkmap); /* + repair */
 	if (error)
 		*repair = 0;
@@ -1098,7 +1096,7 @@ process_longform_attr(
 		return 1;
 	}
 
-	error = -libxfs_buf_read(mp->m_dev, XFS_FSB_TO_DADDR(mp, bno),
+	error = -xfs_buf_read(mp->m_dev, XFS_FSB_TO_DADDR(mp, bno),
 			XFS_FSB_TO_BB(mp, 1), LIBXFS_READBUF_SALVAGE, &bp,
 			&xfs_da3_node_buf_ops);
 	if (error) {
@@ -1113,7 +1111,7 @@ process_longform_attr(
 	/* is this block sane? */
 	if (__check_attr_header(mp, bp, ino)) {
 		*repair = 0;
-		libxfs_buf_relse(bp);
+		xfs_buf_relse(bp);
 		return 1;
 	}
 
@@ -1136,7 +1134,7 @@ process_longform_attr(
 		do_warn(
 	_("bad attribute leaf magic # %#x for dir ino %" PRIu64 "\n"),
 			be16_to_cpu(info->magic), ino);
-		libxfs_buf_relse(bp);
+		xfs_buf_relse(bp);
 		*repair = 0;
 		return 1;
 	}
repair/da_util.c +18 -18
index 5061880f..5e2e6f59 100644
@@ -64,7 +64,7 @@ da_read_buf(
 		map[i].bm_bn = XFS_FSB_TO_DADDR(mp, bmp[i].startblock);
 		map[i].bm_len = XFS_FSB_TO_BB(mp, bmp[i].blockcount);
 	}
-	libxfs_buf_read_map(mp->m_dev, map, nex, LIBXFS_READBUF_SALVAGE,
+	xfs_buf_read_map(mp->m_dev, map, nex, LIBXFS_READBUF_SALVAGE,
 			&bp, ops);
 	if (map != map_array)
 		free(map);
@@ -135,7 +135,7 @@ _("can't read %s block %u for inode %" PRIu64 "\n"),
 		}
 
 		node = bp->b_addr;
-		libxfs_da3_node_hdr_from_disk(mp, &nodehdr, node);
+		xfs_da3_node_hdr_from_disk(mp, &nodehdr, node);
 
 		if (whichfork == XFS_DATA_FORK &&
 		    (nodehdr.magic == XFS_DIR2_LEAFN_MAGIC ||
@@ -146,7 +146,7 @@ _("found non-root LEAFN node in inode %" PRIu64 " bno = %u\n"),
 					da_cursor->ino, bno);
 			}
 			*rbno = 0;
-			libxfs_buf_relse(bp);
+			xfs_buf_relse(bp);
 			return 1;
 		}
 
@@ -156,13 +156,13 @@ _("found non-root LEAFN node in inode %" PRIu64 " bno = %u\n"),
 _("bad %s magic number 0x%x in inode %" PRIu64 " bno = %u\n"),
 					FORKNAME(whichfork), nodehdr.magic,
 					da_cursor->ino, bno);
-			libxfs_buf_relse(bp);
+			xfs_buf_relse(bp);
 			goto error_out;
 		}
 
 		/* corrupt node; rebuild the dir. */
 		if (bp->b_error == -EFSBADCRC || bp->b_error == -EFSCORRUPTED) {
-			libxfs_buf_relse(bp);
+			xfs_buf_relse(bp);
 			do_warn(
 _("corrupt %s tree block %u for inode %" PRIu64 "\n"),
 				FORKNAME(whichfork), bno, da_cursor->ino);
@@ -174,7 +174,7 @@ _("corrupt %s tree block %u for inode %" PRIu64 "\n"),
 _("bad %s record count in inode %" PRIu64 ", count = %d, max = %d\n"),
 				FORKNAME(whichfork), da_cursor->ino,
 				nodehdr.count, geo->node_ents);
-			libxfs_buf_relse(bp);
+			xfs_buf_relse(bp);
 			goto error_out;
 		}
 
@@ -187,7 +187,7 @@ _("bad %s record count in inode %" PRIu64 ", count = %d, max = %d\n"),
 				do_warn(
 _("bad header depth for directory inode %" PRIu64 "\n"),
 					da_cursor->ino);
-				libxfs_buf_relse(bp);
+				xfs_buf_relse(bp);
 				i = -1;
 				goto error_out;
 			}
@@ -198,7 +198,7 @@ _("bad header depth for directory inode %" PRIu64 "\n"),
 				do_warn(
 _("bad %s btree for inode %" PRIu64 "\n"),
 					FORKNAME(whichfork), da_cursor->ino);
-				libxfs_buf_relse(bp);
+				xfs_buf_relse(bp);
 				goto error_out;
 			}
 		}
@@ -223,7 +223,7 @@ _("bad %s btree for inode %" PRIu64 "\n"),
 
 error_out:
 	while (i > 1 && i <= da_cursor->active) {
-		libxfs_buf_relse(da_cursor->level[i].bp);
+		xfs_buf_relse(da_cursor->level[i].bp);
 		i++;
 	}
 
@@ -253,7 +253,7 @@ release_da_cursor_int(
 		}
 		ASSERT(error != 0);
 
-		libxfs_buf_relse(cursor->level[level].bp);
+		xfs_buf_relse(cursor->level[level].bp);
 		cursor->level[level].bp = NULL;
 	}
 
@@ -314,7 +314,7 @@ verify_final_da_path(
 	 */
 	entry = cursor->level[this_level].index;
 	node = cursor->level[this_level].bp->b_addr;
-	libxfs_da3_node_hdr_from_disk(mp, &nodehdr, node);
+	xfs_da3_node_hdr_from_disk(mp, &nodehdr, node);
 
 	/*
 	 * check internal block consistency on this level -- ensure
@@ -406,10 +406,10 @@ _("would correct bad hashval in non-leaf %s block\n"
 
 	if (cursor->level[this_level].dirty && !no_modify) {
 		libxfs_buf_mark_dirty(cursor->level[this_level].bp);
-		libxfs_buf_relse(cursor->level[this_level].bp);
+		xfs_buf_relse(cursor->level[this_level].bp);
 	}
 	else
-		libxfs_buf_relse(cursor->level[this_level].bp);
+		xfs_buf_relse(cursor->level[this_level].bp);
 
 	cursor->level[this_level].bp = NULL;
 
@@ -505,7 +505,7 @@ verify_da_path(
 	 */
 	entry = cursor->level[this_level].index;
 	node = cursor->level[this_level].bp->b_addr;
-	libxfs_da3_node_hdr_from_disk(mp, &nodehdr, node);
+	xfs_da3_node_hdr_from_disk(mp, &nodehdr, node);
 
 	/* No entries in this node?  Tree is corrupt. */
[… more lines in the raw message]

Lines of this file are not shown. View the raw message.

repair/dino_chunks.c +10 -10
index 6685a4d2..f58b7058 100644

Lines of this file are not shown. View the raw message.

repair/dinode.c +20 -20
index 1f1cc26b..4c05eb89 100644

Lines of this file are not shown. View the raw message.

repair/dir2.c +44 -44
index cbbce601..dec6d36d 100644

Lines of this file are not shown. View the raw message.

repair/phase3.c +3 -3
index ca4dbee4..c025b476 100644

Lines of this file are not shown. View the raw message.

repair/phase4.c +6 -6
index 8197db06..0fad2db5 100644

Lines of this file are not shown. View the raw message.

repair/phase5.c +64 -64
index 677297fe..c795679d 100644

Lines of this file are not shown. View the raw message.

repair/phase6.c +183 -183
index 5e3b394a..56424c08 100644

Lines of this file are not shown. View the raw message.

repair/phase7.c +5 -5
index c2996470..78df1ae0 100644

Lines of this file are not shown. View the raw message.

repair/prefetch.c +9 -9
index 3ac49db1..402fdb34 100644

Lines of this file are not shown. View the raw message.

repair/rmap.c +36 -36
index a4cc6a49..efdeb621 100644

Lines of this file are not shown. View the raw message.

repair/rt.c +4 -6
index d901e751..cca654ae 100644

Lines of this file are not shown. View the raw message.

repair/sb.c +5 -5
index 91a36dd3..0936f5be 100644

Lines of this file are not shown. View the raw message.

repair/scan.c +23 -23
index 5c8d8b23..e47e71dd 100644

Lines of this file are not shown. View the raw message.

repair/xfs_repair.c +9 -9
index 9d72fa8e..91f72670 100644

Lines of this file are not shown. View the raw message.

tools/find-api-violations.sh +3 -35
index c25fccca..01f5565f 100755

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.26.2

Part of the diff is not shown here. View the raw message.