Move libxfs_log2_roundup to libfrog and remove the 'libxfs_' prefix.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
--- /dev/null
+/*
+ * Copyright (c) 2000-2005 Silicon Graphics, Inc.
+ * All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it would be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+#ifndef __LIBFROG_UTIL_H_
+#define __LIBFROG_UTIL_H_
+
+unsigned int log2_roundup(unsigned int i);
+
+#endif /* __LIBFROG_UTIL_H_ */
/* Shared utility routines */
-extern unsigned int libxfs_log2_roundup(unsigned int i);
extern int libxfs_alloc_file_space (struct xfs_inode *, xfs_off_t,
xfs_off_t, int, int);
LT_REVISION = 0
LT_AGE = 0
-CFILES =
+CFILES = \
+util.c
default: ltdepend $(LTLIBRARY)
--- /dev/null
+/*
+ * Copyright (c) 2000-2005 Silicon Graphics, Inc.
+ * All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it would be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+#include "platform_defs.h"
+#include "libfrog.h"
+
+/*
+ * libfrog is a collection of miscellaneous userspace utilities.
+ * It's a library of Funny Random Oddball Gunk <cough>.
+ */
+
+unsigned int
+log2_roundup(unsigned int i)
+{
+ unsigned int rval;
+
+ for (rval = 0; rval < NBBY * sizeof(i); rval++) {
+ if ((1 << rval) >= i)
+ break;
+ }
+ return rval;
+}
return error;
}
-unsigned int
-libxfs_log2_roundup(unsigned int i)
-{
- unsigned int rval;
-
- for (rval = 0; rval < NBBY * sizeof(i); rval++) {
- if ((1 << rval) >= i)
- break;
- }
- return rval;
-}
-
/*
* Wrapper around call to libxfs_ialloc. Takes care of committing and
* allocating a new transaction as needed.
HFILES =
CFILES = maxtrres.c proto.c xfs_mkfs.c
-LLDLIBS += $(LIBXFS) $(LIBXCMD) $(LIBRT) $(LIBPTHREAD) $(LIBBLKID) $(LIBUUID)
-LTDEPENDENCIES += $(LIBXFS) $(LIBXCMD)
+LLDLIBS += $(LIBXFS) $(LIBXCMD) $(LIBFROG) $(LIBRT) $(LIBPTHREAD) $(LIBBLKID) \
+ $(LIBUUID)
+LTDEPENDENCIES += $(LIBXFS) $(LIBXCMD) $(LIBFROG)
LLDFLAGS = -static-libtool-libs
default: depend $(LTCOMMAND)
* of sector size, block size, inode size, directory version, and
* directory block size.
*/
-
+#include "libfrog.h"
#include "libxfs.h"
#include "xfs_multidisk.h"
sbp->sb_blocklog = blocklog;
sbp->sb_blocksize = 1 << blocklog;
sbp->sb_agblocks = agsize;
- sbp->sb_agblklog = (uint8_t)libxfs_log2_roundup((unsigned int)agsize);
+ sbp->sb_agblklog = (uint8_t)log2_roundup((unsigned int)agsize);
sbp->sb_inodelog = inodelog;
sbp->sb_inopblog = blocklog - inodelog;
sbp->sb_inodesize = 1 << inodelog;
* along with this program; if not, write the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
+#include "libfrog.h"
#include "libxfs.h"
#include <ctype.h>
#include "xfs_multidisk.h"
memset(mp, 0, sizeof(xfs_mount_t));
sbp->sb_blocklog = (uint8_t)blocklog;
sbp->sb_sectlog = (uint8_t)sectorlog;
- sbp->sb_agblklog = (uint8_t)libxfs_log2_roundup((unsigned int)agsize);
+ sbp->sb_agblklog = (uint8_t)log2_roundup((unsigned int)agsize);
sbp->sb_agblocks = (xfs_agblock_t)agsize;
mp->m_blkbb_log = sbp->sb_blocklog - BBSHIFT;
mp->m_sectbb_log = sbp->sb_sectlog - BBSHIFT;
progress.c prefetch.c rmap.c rt.c sb.c scan.c slab.c threads.c \
versions.c xfs_repair.c
-LLDLIBS = $(LIBXFS) $(LIBXLOG) $(LIBXCMD) $(LIBUUID) \
- $(LIBRT) $(LIBPTHREAD) $(LIBBLKID)
-LTDEPENDENCIES = $(LIBXFS) $(LIBXLOG) $(LIBXCMD)
+LLDLIBS = $(LIBXFS) $(LIBXLOG) $(LIBXCMD) $(LIBFROG) $(LIBUUID) $(LIBRT) \
+ $(LIBPTHREAD) $(LIBBLKID)
+LTDEPENDENCIES = $(LIBXFS) $(LIBXLOG) $(LIBXCMD) $(LIBFROG)
LLDFLAGS = -static-libtool-libs
default: depend $(LTCOMMAND)
* along with this program; if not, write the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
+#include "libfrog.h"
#include "libxfs.h"
#include "libxcmd.h"
#include "libxlog.h"
sb->sb_dblocks < XFS_MIN_DBLOCKS(sb))
return(XR_BAD_FS_SIZE_DATA);
- if (sb->sb_agblklog != (uint8_t)libxfs_log2_roundup(sb->sb_agblocks))
+ if (sb->sb_agblklog != (uint8_t)log2_roundup(sb->sb_agblocks))
return(XR_BAD_FS_SIZE_DATA);
if (sb->sb_inodesize < XFS_DINODE_MIN_SIZE ||