]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfsprogs-dev.git/commitdiff
libxfs: disambiguate xfs.h
authorDave Chinner <dchinner@redhat.com>
Fri, 5 Jun 2015 00:13:59 +0000 (10:13 +1000)
committerDave Chinner <david@fromorbit.com>
Fri, 5 Jun 2015 00:13:59 +0000 (10:13 +1000)
There are two "xfs.h" header files in xfsprogs. include/xfs.h
contains the userspace API definitions for the platform and ioctl
interfaces. libxfs/xfs.h contains support infrastructure
to allow kernel code to compile in userspace. They have different
purposes, and so we need to disambiguate them so it is clear what
header files are being included in which files.

We can't change include/xfs.h as it is exported and installed into
/usr/include/xfs, and that means we have to rename the libxfs
internal header file. Rename this to "libxfs_priv.h" so it is clear
that it is private to libxfs, and update all the libxfs code to
include it.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
37 files changed:
libxfs/Makefile
libxfs/cache.c
libxfs/init.c
libxfs/kmem.c
libxfs/libxfs_priv.h [new file with mode: 0644]
libxfs/linux.c
libxfs/logitem.c
libxfs/rdwr.c
libxfs/trans.c
libxfs/util.c
libxfs/xfs.h [deleted file]
libxfs/xfs_alloc.c
libxfs/xfs_alloc_btree.c
libxfs/xfs_attr.c
libxfs/xfs_attr_leaf.c
libxfs/xfs_attr_remote.c
libxfs/xfs_bmap.c
libxfs/xfs_bmap_btree.c
libxfs/xfs_btree.c
libxfs/xfs_da_btree.c
libxfs/xfs_da_format.c
libxfs/xfs_dir2.c
libxfs/xfs_dir2_block.c
libxfs/xfs_dir2_data.c
libxfs/xfs_dir2_leaf.c
libxfs/xfs_dir2_node.c
libxfs/xfs_dir2_sf.c
libxfs/xfs_dquot_buf.c
libxfs/xfs_ialloc.c
libxfs/xfs_ialloc_btree.c
libxfs/xfs_inode_buf.c
libxfs/xfs_inode_fork.c
libxfs/xfs_log_rlimit.c
libxfs/xfs_rtbitmap.c
libxfs/xfs_sb.c
libxfs/xfs_symlink_remote.c
libxfs/xfs_trans_resv.c

index 51b98ec6736c0daf4174d765582eea888b524890..df4e36910e9fd2cabe88df6546ca489cc815721c 100644 (file)
@@ -15,10 +15,10 @@ PKGHFILES = xfs_fs.h \
        xfs_types.h
 
 # headers with build dependencies
-HFILES = xfs.h \
-       init.h \
+HFILES = init.h \
        crc32defs.h \
        crc32table.h \
+       libxfs_priv.h \
        xfs_dir2_priv.h \
 
 # headers installed in QA targets
index 105d2f9769bb48df0e3d73682d62a42c1d4a2ce4..4753a1d788841dc2268b91de95228071f6722a99 100644 (file)
@@ -22,7 +22,7 @@
 #include <unistd.h>
 #include <pthread.h>
 
-#include "xfs.h"
+#include "libxfs_priv.h"
 #include "xfs_fs.h"
 #include "xfs_shared.h"
 #include "xfs_format.h"
index 42fa7af66dbceef637bc84639929b262c852caa3..6f404aaa85b4d6e90fbfbf8886d4f2e663961540 100644 (file)
@@ -19,7 +19,7 @@
 #include <sys/stat.h>
 #include "init.h"
 
-#include "xfs.h"
+#include "libxfs_priv.h"
 #include "xfs_fs.h"
 #include "xfs_shared.h"
 #include "xfs_format.h"
index c2b91fd9c05d2e037db09f274b54008da6b05cb1..6421304b08448ff4e256f8b44a754f4d67ce162b 100644 (file)
@@ -1,6 +1,6 @@
 
 
-#include "xfs.h"
+#include "libxfs_priv.h"
 
 /*
  * Simple memory interface
diff --git a/libxfs/libxfs_priv.h b/libxfs/libxfs_priv.h
new file mode 100644 (file)
index 0000000..26db719
--- /dev/null
@@ -0,0 +1,559 @@
+/*
+ * 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
+ */
+
+/*
+ * This header is effectively a "namespace multiplexor" for the
+ * user level XFS code.  It provides all of the necessary stuff
+ * such that we can build some parts of the XFS kernel code in
+ * user space in a controlled fashion, and translates the names
+ * used in the kernel into the names which libxfs is going to
+ * make available to user tools.
+ *
+ * It should only ever be #include'd by XFS "kernel" code being
+ * compiled in user space.
+ *
+ * Our goals here are to...
+ *      o  "share" large amounts of complex code between user and
+ *         kernel space;
+ *      o  shield the user tools from changes in the bleeding
+ *         edge kernel code, merging source changes when
+ *         convenient and not immediately (no symlinks);
+ *      o  i.e. be able to merge changes to the kernel source back
+ *         into the affected user tools in a controlled fashion;
+ *      o  provide a _minimalist_ life-support system for kernel
+ *         code in user land, not the "everything + the kitchen
+ *         sink" model which libsim had mutated into;
+ *      o  allow the kernel code to be completely free of code
+ *         specifically there to support the user level build.
+ */
+
+/*
+ * define a guard and something we can check to determine what include context
+ * we are running from.
+ */
+#ifndef __LIBXFS_INTERNAL_XFS_H__
+#define __LIBXFS_INTERNAL_XFS_H__
+
+/*
+ * repair doesn't have a inode when it calls libxfs_dir2_data_freescan,
+ * so we map this internally for now.
+ */
+#define xfs_dir2_data_freescan(ip, hdr, loghead) \
+       __xfs_dir2_data_freescan((ip)->i_mount->m_dir_geo, \
+                                (ip)->d_ops, hdr, loghead)
+
+/*
+ * start by remapping all the symbols we expect external users to call
+ * to the libxfs_ namespace. This ensures that all internal symbols are
+ * remapped correctly throughout all the included header files
+ * as well as in the C code.
+ */
+#define xfs_alloc_fix_freelist         libxfs_alloc_fix_freelist
+#define xfs_attr_get                   libxfs_attr_get
+#define xfs_attr_set                   libxfs_attr_set
+#define xfs_attr_remove                        libxfs_attr_remove
+#define xfs_rtfree_extent              libxfs_rtfree_extent
+
+#define xfs_fs_repair_cmn_err          libxfs_fs_repair_cmn_err
+#define xfs_fs_cmn_err                 libxfs_fs_cmn_err
+
+#define xfs_bmap_finish                        libxfs_bmap_finish
+#define xfs_trans_ichgtime             libxfs_trans_ichgtime
+
+#define xfs_trans_alloc                        libxfs_trans_alloc
+#define xfs_trans_add_item             libxfs_trans_add_item
+#define xfs_trans_bhold                        libxfs_trans_bhold
+#define xfs_trans_binval               libxfs_trans_binval
+#define xfs_trans_bjoin                        libxfs_trans_bjoin
+#define xfs_trans_brelse               libxfs_trans_brelse
+#define xfs_trans_commit               libxfs_trans_commit
+#define xfs_trans_cancel               libxfs_trans_cancel
+#define xfs_trans_del_item             libxfs_trans_del_item
+#define xfs_trans_dup                  libxfs_trans_dup
+#define xfs_trans_get_buf              libxfs_trans_get_buf
+#define xfs_trans_getsb                        libxfs_trans_getsb
+#define xfs_trans_iget                 libxfs_trans_iget
+#define xfs_trans_ijoin                        libxfs_trans_ijoin
+#define xfs_trans_ijoin_ref            libxfs_trans_ijoin_ref
+#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_read_buf             libxfs_trans_read_buf
+#define xfs_trans_read_buf_map         libxfs_trans_read_buf_map
+#define xfs_trans_roll                 libxfs_trans_roll
+#define xfs_trans_get_buf_map          libxfs_trans_get_buf_map
+#define xfs_trans_reserve              libxfs_trans_reserve
+
+/* xfs_attr_leaf.h */
+#define xfs_attr_leaf_newentsize       libxfs_attr_leaf_newentsize
+
+/* xfs_bit.h */
+#define xfs_highbit32                  libxfs_highbit32
+#define xfs_highbit64                  libxfs_highbit64
+
+/* xfs_bmap.h */
+#define xfs_bmap_cancel                        libxfs_bmap_cancel
+#define xfs_bmap_last_offset           libxfs_bmap_last_offset
+#define xfs_bmapi_write                        libxfs_bmapi_write
+#define xfs_bmapi_read                 libxfs_bmapi_read
+#define xfs_bunmapi                    libxfs_bunmapi
+
+/* xfs_bmap_btree.h */
+#define xfs_bmbt_get_all               libxfs_bmbt_get_all
+
+/* xfs_da_btree.h */
+#define xfs_da_brelse                  libxfs_da_brelse
+#define xfs_da_hashname                        libxfs_da_hashname
+#define xfs_da_shrink_inode            libxfs_da_shrink_inode
+#define xfs_da_read_buf                        libxfs_da_read_buf
+
+/* xfs_dir2.h */
+#define xfs_dir_createname             libxfs_dir_createname
+#define xfs_dir_init                   libxfs_dir_init
+#define xfs_dir_lookup                 libxfs_dir_lookup
+#define xfs_dir_replace                        libxfs_dir_replace
+#define xfs_dir2_isblock               libxfs_dir2_isblock
+#define xfs_dir2_isleaf                        libxfs_dir2_isleaf
+
+/* xfs_dir2_data.h */
+#define __xfs_dir2_data_freescan       libxfs_dir2_data_freescan
+#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_use_free         libxfs_dir2_data_use_free
+#define xfs_dir2_shrink_inode          libxfs_dir2_shrink_inode
+
+/* xfs_inode.h */
+#define xfs_dinode_from_disk           libxfs_dinode_from_disk
+#define xfs_dinode_to_disk             libxfs_dinode_to_disk
+#define xfs_dinode_calc_crc            libxfs_dinode_calc_crc
+#define xfs_idata_realloc              libxfs_idata_realloc
+#define xfs_idestroy_fork              libxfs_idestroy_fork
+
+#define xfs_dinode_verify              libxfs_dinode_verify
+
+/* xfs_sb.h */
+#define xfs_log_sb                     libxfs_log_sb
+#define xfs_sb_from_disk               libxfs_sb_from_disk
+#define xfs_sb_quota_from_disk         libxfs_sb_quota_from_disk
+#define xfs_sb_to_disk                 libxfs_sb_to_disk
+
+/* xfs_symlink.h */
+#define xfs_symlink_blocks             libxfs_symlink_blocks
+#define xfs_symlink_hdr_ok             libxfs_symlink_hdr_ok
+
+/* xfs_trans_resv.h */
+#define xfs_trans_resv_calc            libxfs_trans_resv_calc
+
+
+/*
+ * Now we've renamed and mapped everything, include the rest of the external
+ * libxfs headers.
+ */
+#include <xfs/platform_defs.h>
+
+#include <xfs/list.h>
+#include <xfs/hlist.h>
+#include <xfs/cache.h>
+#include <xfs/bitops.h>
+#include <xfs/kmem.h>
+#include <xfs/radix-tree.h>
+#include <xfs/swab.h>
+#include <xfs/atomic.h>
+
+#include <xfs/xfs_types.h>
+#include <xfs/xfs_arch.h>
+
+#include <xfs/xfs_fs.h>
+
+/* CRC stuff, buffer API dependent on it */
+extern uint32_t crc32_le(uint32_t crc, unsigned char const *p, size_t len);
+extern uint32_t crc32c_le(uint32_t crc, unsigned char const *p, size_t len);
+
+#define crc32(c,p,l)   crc32_le((c),(unsigned char const *)(p),(l))
+#define crc32c(c,p,l)  crc32c_le((c),(unsigned char const *)(p),(l))
+
+#include <xfs/xfs_cksum.h>
+
+/*
+ * This mirrors the kernel include for xfs_buf.h - it's implicitly included in
+ * every files via a similar include in the kernel xfs_linux.h.
+ */
+#include <xfs/libxfs_io.h>
+
+/* for all the support code that uses progname in error messages */
+extern char    *progname;
+
+#undef ASSERT
+#define ASSERT(ex) assert(ex)
+
+typedef __uint32_t             uint_t;
+typedef __uint32_t             inst_t;         /* an instruction */
+
+#ifndef EWRONGFS
+#define EWRONGFS       EINVAL
+#endif
+
+#define xfs_error_level                        0
+
+#define STATIC                         static
+
+/* XXX: need to push these out to make LIBXFS_ATTR defines */
+#define ATTR_ROOT                      0x0002
+#define ATTR_SECURE                    0x0008
+#define ATTR_CREATE                    0x0010
+#define ATTR_REPLACE                   0x0020
+#define ATTR_KERNOTIME                 0
+#define ATTR_KERNOVAL                  0
+
+#define IHOLD(ip)                      ((void) 0)
+
+#define XFS_IGET_CREATE                        0x1
+#define XFS_IGET_UNTRUSTED             0x2
+
+extern void cmn_err(int, char *, ...);
+enum ce { CE_DEBUG, CE_CONT, CE_NOTE, CE_WARN, CE_ALERT, CE_PANIC };
+
+#define xfs_notice(mp,fmt,args...)             cmn_err(CE_NOTE,fmt, ## args)
+#define xfs_warn(mp,fmt,args...)               cmn_err(CE_WARN,fmt, ## args)
+#define xfs_hex_dump(d,n)              ((void) 0)
+
+
+/* stop unused var warnings by assigning mp to itself */
+#define XFS_CORRUPTION_ERROR(e,l,mp,m) do { \
+       (mp) = (mp); \
+       cmn_err(CE_ALERT, "%s: XFS_CORRUPTION_ERROR", (e));  \
+} while (0)
+
+#define XFS_ERROR_REPORT(e,l,mp)       do { \
+       (mp) = (mp); \
+       cmn_err(CE_ALERT, "%s: XFS_ERROR_REPORT", (e));  \
+} while (0)
+
+#define XFS_QM_DQATTACH(mp,ip,flags)   0
+#define XFS_ERRLEVEL_LOW               1
+#define XFS_FORCED_SHUTDOWN(mp)                0
+#define XFS_ILOCK_EXCL                 0
+#define XFS_STATS_INC(count)           do { } while (0)
+#define XFS_STATS_DEC(count, x)                do { } while (0)
+#define XFS_STATS_ADD(count, x)                do { } while (0)
+#define XFS_TRANS_MOD_DQUOT_BYINO(mp,tp,ip,field,delta)        do { } while (0)
+#define XFS_TRANS_RESERVE_QUOTA_NBLKS(mp,tp,ip,nblks,ninos,fl) 0
+#define XFS_TRANS_UNRESERVE_QUOTA_NBLKS(mp,tp,ip,nblks,ninos,fl)       0
+#define XFS_TEST_ERROR(expr,a,b,c)     ( expr )
+#define XFS_WANT_CORRUPTED_GOTO(mp, expr, l)   \
+               { if (!(expr)) { error = EFSCORRUPTED; goto l; } }
+#define XFS_WANT_CORRUPTED_RETURN(mp, expr)    \
+               { if (!(expr)) { return EFSCORRUPTED; } }
+
+#ifdef __GNUC__
+#define __return_address       __builtin_return_address(0)
+#endif
+
+#define XFS_DQUOT_CLUSTER_SIZE_FSB (xfs_filblks_t)1
+
+/* miscellaneous kernel routines not in user space */
+#define down_read(a)           ((void) 0)
+#define up_read(a)             ((void) 0)
+#define spin_lock_init(a)      ((void) 0)
+#define spin_lock(a)           ((void) 0)
+#define spin_unlock(a)         ((void) 0)
+#define likely(x)              (x)
+#define unlikely(x)            (x)
+#define rcu_read_lock()                ((void) 0)
+#define rcu_read_unlock()      ((void) 0)
+#define WARN_ON_ONCE(expr)     ((void) 0)
+
+#define percpu_counter_read(x) (*x)
+#define percpu_counter_sum(x)  (*x)
+
+/*
+ * prandom_u32 is used for di_gen inode allocation, it must be zero for libxfs
+ * or all sorts of badness can occur!
+ */
+#define prandom_u32()          0
+
+#define PAGE_CACHE_SIZE                getpagesize()
+
+static inline int __do_div(unsigned long long *n, unsigned base)
+{
+       int __res;
+       __res = (int)(((unsigned long) *n) % (unsigned) base);
+       *n = ((unsigned long) *n) / (unsigned) base;
+       return __res;
+}
+
+#define do_div(n,base) (__do_div((unsigned long long *)&(n), (base)))
+#define do_mod(a, b)           ((a) % (b))
+#define rol32(x,y)             (((x) << (y)) | ((x) >> (32 - (y))))
+
+#define min_t(type,x,y) \
+       ({ type __x = (x); type __y = (y); __x < __y ? __x: __y; })
+#define max_t(type,x,y) \
+       ({ type __x = (x); type __y = (y); __x > __y ? __x: __y; })
+
+
+
+static inline __attribute__((const))
+int is_power_of_2(unsigned long n)
+{
+       return (n != 0 && ((n & (n - 1)) == 0));
+}
+
+/*
+ * xfs_iroundup: round up argument to next power of two
+ */
+static inline uint
+roundup_pow_of_two(uint v)
+{
+       int     i;
+       uint    m;
+
+       if ((v & (v - 1)) == 0)
+               return v;
+       ASSERT((v & 0x80000000) == 0);
+       if ((v & (v + 1)) == 0)
+               return v + 1;
+       for (i = 0, m = 1; i < 31; i++, m <<= 1) {
+               if (v & m)
+                       continue;
+               v |= m;
+               if ((v & (v + 1)) == 0)
+                       return v + 1;
+       }
+       ASSERT(0);
+       return 0;
+}
+
+static inline __uint64_t
+roundup_64(__uint64_t x, __uint32_t y)
+{
+       x += y - 1;
+       do_div(x, y);
+       return x * y;
+}
+
+#define __round_mask(x, y) ((__typeof__(x))((y)-1))
+#define round_up(x, y) ((((x)-1) | __round_mask(x, y))+1)
+#define round_down(x, y) ((x) & ~__round_mask(x, y))
+
+/* buffer management */
+#define XFS_BUF_LOCK                   0
+#define XFS_BUF_TRYLOCK                        0
+#define XBF_LOCK                       XFS_BUF_LOCK
+#define XBF_TRYLOCK                    XFS_BUF_TRYLOCK
+#define XBF_DONT_BLOCK                 0
+#define XBF_UNMAPPED                   0
+#define XBF_DONE                       0
+#define XFS_BUF_GETERROR(bp)           0
+#define XFS_BUF_DONE(bp)               ((bp)->b_flags |= LIBXFS_B_UPTODATE)
+#define XFS_BUF_ISDONE(bp)             ((bp)->b_flags & LIBXFS_B_UPTODATE)
+#define xfs_buf_stale(bp)              ((bp)->b_flags |= LIBXFS_B_STALE)
+#define XFS_BUF_UNDELAYWRITE(bp)       ((bp)->b_flags &= ~LIBXFS_B_DIRTY)
+#define XFS_BUF_SET_VTYPE(a,b)         ((void) 0)
+#define XFS_BUF_SET_VTYPE_REF(a,b,c)   ((void) 0)
+#define XFS_BUF_SET_BDSTRAT_FUNC(a,b)  ((void) 0)
+
+/* avoid gcc warning */
+#define xfs_incore(bt,blkno,len,lockit)        ({              \
+       typeof(blkno) __foo = (blkno);                  \
+       typeof(len) __bar = (len);                      \
+       (blkno) = __foo;                                \
+       (len) = __bar; /* no set-but-unused warning */  \
+       NULL;                                           \
+})
+#define xfs_buf_relse(bp)              libxfs_putbuf(bp)
+#define xfs_buf_get(devp,blkno,len,f)  (libxfs_getbuf((devp), (blkno), (len)))
+#define xfs_bwrite(bp)                 libxfs_writebuf((bp), 0)
+#define xfs_buf_delwri_queue(bp, bl)   libxfs_writebuf((bp), 0)
+
+#define XBRW_READ                      LIBXFS_BREAD
+#define XBRW_WRITE                     LIBXFS_BWRITE
+#define xfs_buf_iomove(bp,off,len,data,f)      libxfs_iomove(bp,off,len,data,f)
+#define xfs_buf_zero(bp,off,len)       libxfs_iomove(bp,off,len,0,LIBXFS_BZERO)
+
+/* mount stuff */
+#define XFS_MOUNT_32BITINODES          LIBXFS_MOUNT_32BITINODES
+#define XFS_MOUNT_ATTR2                        LIBXFS_MOUNT_ATTR2
+#define XFS_MOUNT_SMALL_INUMS          0       /* ignored in userspace */
+#define XFS_MOUNT_WSYNC                        0       /* ignored in userspace */
+#define XFS_MOUNT_NOALIGN              0       /* ignored in userspace */
+#define XFS_MOUNT_IKEEP                        0       /* ignored in userspace */
+#define XFS_MOUNT_SWALLOC              0       /* ignored in userspace */
+#define XFS_MOUNT_RDONLY               0       /* ignored in userspace */
+
+
+#define _xfs_trans_alloc(mp, type, f)  libxfs_trans_alloc(mp, type)
+#define xfs_trans_get_block_res(tp)    1
+#define xfs_trans_set_sync(tp)         ((void) 0)
+#define xfs_trans_ordered_buf(tp, bp)  ((void) 0)
+#define        xfs_trans_agblocks_delta(tp, d)
+#define        xfs_trans_agflist_delta(tp, d)
+#define        xfs_trans_agbtree_delta(tp, d)
+#define xfs_trans_buf_set_type(tp, bp, t)      ({      \
+       int __t = (t);                                  \
+       __t = __t; /* no set-but-unused warning */      \
+})
+
+#define xfs_trans_buf_copy_type(dbp, sbp)
+
+/* no readahead, need to avoid set-but-unused var warnings. */
+#define xfs_buf_readahead(a,d,c,ops)           ({      \
+       xfs_daddr_t __d = d;                            \
+       __d = __d; /* no set-but-unused warning */      \
+})
+#define xfs_buf_readahead_map(a,b,c,ops)       ((void) 0)      /* no readahead */
+#define xfs_buftrace(x,y)                      ((void) 0)      /* debug only */
+
+#define xfs_cmn_err(tag,level,mp,fmt,args...)  cmn_err(level,fmt, ## args)
+#define xfs_warn(mp,fmt,args...)               cmn_err(CE_WARN,fmt, ## args)
+#define xfs_alert(mp,fmt,args...)              cmn_err(CE_ALERT,fmt, ## args)
+#define xfs_alert_tag(mp,tag,fmt,args...)      cmn_err(CE_ALERT,fmt, ## args)
+
+#define xfs_dir2_trace_args(where, args)               ((void) 0)
+#define xfs_dir2_trace_args_b(where, args, bp)         ((void) 0)
+#define xfs_dir2_trace_args_bb(where, args, lbp, dbp)  ((void) 0)
+#define xfs_dir2_trace_args_bibii(where, args, bs, ss, bd, sd, c) ((void) 0)
+#define xfs_dir2_trace_args_db(where, args, db, bp)    ((void) 0)
+#define xfs_dir2_trace_args_i(where, args, i)          ((void) 0)
+#define xfs_dir2_trace_args_s(where, args, s)          ((void) 0)
+#define xfs_dir2_trace_args_sb(where, args, s, bp)     ((void) 0)
+#define xfs_sort                                       qsort
+
+#define xfs_icsb_reinit_counters(mp)                   do { } while (0)
+#define xfs_initialize_perag_icache(pag)               ((void) 0)
+
+#define xfs_ilock(ip,mode)                             ((void) 0)
+#define xfs_ilock_nowait(ip,mode)                      ((void) 0)
+#define xfs_ilock_demote(ip,mode)                      ((void) 0)
+#define xfs_ilock_data_map_shared(ip)                  (0)
+#define xfs_ilock_attr_map_shared(ip)                  (0)
+#define xfs_iunlock(ip,mode)                           ({      \
+       typeof(mode) __mode = mode;                             \
+       __mode = __mode; /* no set-but-unused warning */        \
+})
+#define __xfs_flock(ip)                                        ((void) 0)
+
+/* space allocation */
+#define xfs_extent_busy_reuse(mp,ag,bno,len,user)      ((void) 0)
+#define xfs_extent_busy_insert(tp,ag,bno,len,flags)    ((void) 0)
+#define xfs_extent_busy_trim(args,fbno,flen,bno,len) \
+do { \
+       *(bno) = (fbno); \
+       *(len) = (flen); \
+} while (0)
+
+/* avoid unused variable warning */
+#define xfs_alloc_busy_insert(tp,ag,b,len)     ({      \
+       xfs_agnumber_t __foo = ag;                      \
+       __foo = 0;                                      \
+})
+
+#define xfs_rotorstep                          1
+#define xfs_bmap_rtalloc(a)                    (ENOSYS)
+#define xfs_rtpick_extent(mp,tp,len,p)         (ENOSYS)
+#define xfs_get_extsz_hint(ip)                 (0)
+#define xfs_inode_is_filestream(ip)            (0)
+#define xfs_filestream_lookup_ag(ip)           (0)
+#define xfs_filestream_new_ag(ip,ag)           (0)
+
+#define xfs_log_force(mp,flags)                        ((void) 0)
+#define XFS_LOG_SYNC                           1
+
+/* quota bits */
+#define xfs_trans_mod_dquot_byino(t,i,f,d)             ((void) 0)
+#define xfs_trans_reserve_quota_nblks(t,i,b,n,f)       (0)
+#define xfs_trans_unreserve_quota_nblks(t,i,b,n,f)     ((void) 0)
+#define xfs_qm_dqattach(i,f)                           (0)
+
+#define uuid_copy(s,d)         platform_uuid_copy((s),(d))
+#define uuid_equal(s,d)                (platform_uuid_compare((s),(d)) == 0)
+
+#define xfs_icreate_log(tp, agno, agbno, cnt, isize, len, gen) ((void) 0)
+#define xfs_sb_validate_fsb_count(sbp, nblks)          (0)
+
+/*
+ * Prototypes for kernel static functions that are aren't in their
+ * associated header files.
+ */
+struct xfs_da_args;
+struct xfs_bmap_free;
+struct xfs_bmap_free_item;
+struct xfs_mount;
+struct xfs_sb;
+struct xfs_trans;
+struct xfs_inode;
+struct xfs_log_item;
+struct xfs_buf;
+struct xfs_buf_map;
+struct xfs_buf_log_item;
+struct xfs_buftarg;
+
+/* xfs_attr.c */
+int xfs_attr_rmtval_get(struct xfs_da_args *);
+
+/* xfs_bmap.c */
+void xfs_bmap_del_free(struct xfs_bmap_free *, struct xfs_bmap_free_item *,
+                       struct xfs_bmap_free_item *);
+
+/* xfs_mount.c */
+int xfs_initialize_perag_data(struct xfs_mount *, xfs_agnumber_t);
+void xfs_mount_common(struct xfs_mount *, struct xfs_sb *);
+
+/*
+ * logitem.c and trans.c prototypes
+ */
+void xfs_trans_init(struct xfs_mount *);
+int xfs_trans_roll(struct xfs_trans **, struct xfs_inode *);
+
+/* xfs_trans_item.c */
+void xfs_trans_add_item(struct xfs_trans *, struct xfs_log_item *);
+void xfs_trans_del_item(struct xfs_log_item *);
+void xfs_trans_free_items(struct xfs_trans *, int);
+
+/* xfs_inode_item.c */
+void xfs_inode_item_init(struct xfs_inode *, struct xfs_mount *);
+
+/* xfs_buf_item.c */
+void xfs_buf_item_init(struct xfs_buf *, struct xfs_mount *);
+void xfs_buf_item_log(struct xfs_buf_log_item *, uint, uint);
+
+/* xfs_trans_buf.c */
+struct xfs_buf *xfs_trans_buf_item_match(struct xfs_trans *,
+                       struct xfs_buftarg *, struct xfs_buf_map *, int);
+
+/* local source files */
+#define xfs_mod_fdblocks(mp, delta, rsvd) \
+       libxfs_mod_incore_sb(mp, XFS_TRANS_SB_FDBLOCKS, delta, rsvd)
+#define xfs_mod_frextents(mp, delta) \
+       libxfs_mod_incore_sb(mp, XFS_TRANS_SB_FREXTENTS, delta, 0)
+int  libxfs_mod_incore_sb(struct xfs_mount *, int, int64_t, int);
+void xfs_reinit_percpu_counters(struct xfs_mount *mp);
+
+void xfs_trans_mod_sb(struct xfs_trans *, uint, long);
+void xfs_trans_init(struct xfs_mount *);
+int  xfs_trans_roll(struct xfs_trans **, struct xfs_inode *);
+void xfs_verifier_error(struct xfs_buf *bp);
+
+/* 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);
+
+#endif /* __LIBXFS_INTERNAL_XFS_H__ */
index f16a51c71325e633a9bca1e5b8579e0d55bc2646..885016a016734d71e50ee8e76c3c40d808a95e29 100644 (file)
@@ -25,7 +25,7 @@
 #include <sys/ioctl.h>
 #include <sys/sysinfo.h>
 
-#include "xfs.h"
+#include "libxfs_priv.h"
 #include "xfs_fs.h"
 
 int platform_has_uuid = 1;
index 31d8005937264ef52849676c8b76ff7a41b6b799..ea85e72930c0d7ad932f4c0bbb1b6b2a91de220a 100644 (file)
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs.h"
+#include "libxfs_priv.h"
 #include "xfs_fs.h"
 #include "xfs_shared.h"
 #include "xfs_format.h"
index aeaae45bec570ef09b397c7373918e0618e1022c..cb172064fb92f6839ead51ce5b71189a8e424396 100644 (file)
@@ -17,7 +17,7 @@
  */
 
 
-#include "xfs.h"
+#include "libxfs_priv.h"
 #include "init.h"
 #include "xfs_fs.h"
 #include "xfs_shared.h"
@@ -30,7 +30,7 @@
 #include "xfs_inode.h"
 #include "xfs_trans.h"
 
-#include <xfs/libxfs.h>                /* for now */
+#include <xfs/libxfs.h>                /* for LIBXFS_EXIT_ON_FAILURE */
 
 /*
  * Important design/architecture note:
index 8d0eed7340fb85cc4dcfad4ab55306dc14d63318..885c5f4dcfb074fb0af6d8006bab90b4e5aad23f 100644 (file)
@@ -17,7 +17,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs.h"
+#include "libxfs_priv.h"
 #include "xfs_fs.h"
 #include "xfs_shared.h"
 #include "xfs_format.h"
index 41cc155f4b5b5ce968bfd0d1aeee2d50f79cda6e..a6b1fd1f5ab11697877b71380100b1474e616fdf 100644 (file)
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "xfs.h"
+#include "libxfs_priv.h"
 #include "init.h"
 #include "xfs_fs.h"
 #include "xfs_shared.h"
diff --git a/libxfs/xfs.h b/libxfs/xfs.h
deleted file mode 100644 (file)
index 26db719..0000000
+++ /dev/null
@@ -1,559 +0,0 @@
-/*
- * 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
- */
-
-/*
- * This header is effectively a "namespace multiplexor" for the
- * user level XFS code.  It provides all of the necessary stuff
- * such that we can build some parts of the XFS kernel code in
- * user space in a controlled fashion, and translates the names
- * used in the kernel into the names which libxfs is going to
- * make available to user tools.
- *
- * It should only ever be #include'd by XFS "kernel" code being
- * compiled in user space.
- *
- * Our goals here are to...
- *      o  "share" large amounts of complex code between user and
- *         kernel space;
- *      o  shield the user tools from changes in the bleeding
- *         edge kernel code, merging source changes when
- *         convenient and not immediately (no symlinks);
- *      o  i.e. be able to merge changes to the kernel source back
- *         into the affected user tools in a controlled fashion;
- *      o  provide a _minimalist_ life-support system for kernel
- *         code in user land, not the "everything + the kitchen
- *         sink" model which libsim had mutated into;
- *      o  allow the kernel code to be completely free of code
- *         specifically there to support the user level build.
- */
-
-/*
- * define a guard and something we can check to determine what include context
- * we are running from.
- */
-#ifndef __LIBXFS_INTERNAL_XFS_H__
-#define __LIBXFS_INTERNAL_XFS_H__
-
-/*
- * repair doesn't have a inode when it calls libxfs_dir2_data_freescan,
- * so we map this internally for now.
- */
-#define xfs_dir2_data_freescan(ip, hdr, loghead) \
-       __xfs_dir2_data_freescan((ip)->i_mount->m_dir_geo, \
-                                (ip)->d_ops, hdr, loghead)
-
-/*
- * start by remapping all the symbols we expect external users to call
- * to the libxfs_ namespace. This ensures that all internal symbols are
- * remapped correctly throughout all the included header files
- * as well as in the C code.
- */
-#define xfs_alloc_fix_freelist         libxfs_alloc_fix_freelist
-#define xfs_attr_get                   libxfs_attr_get
-#define xfs_attr_set                   libxfs_attr_set
-#define xfs_attr_remove                        libxfs_attr_remove
-#define xfs_rtfree_extent              libxfs_rtfree_extent
-
-#define xfs_fs_repair_cmn_err          libxfs_fs_repair_cmn_err
-#define xfs_fs_cmn_err                 libxfs_fs_cmn_err
-
-#define xfs_bmap_finish                        libxfs_bmap_finish
-#define xfs_trans_ichgtime             libxfs_trans_ichgtime
-
-#define xfs_trans_alloc                        libxfs_trans_alloc
-#define xfs_trans_add_item             libxfs_trans_add_item
-#define xfs_trans_bhold                        libxfs_trans_bhold
-#define xfs_trans_binval               libxfs_trans_binval
-#define xfs_trans_bjoin                        libxfs_trans_bjoin
-#define xfs_trans_brelse               libxfs_trans_brelse
-#define xfs_trans_commit               libxfs_trans_commit
-#define xfs_trans_cancel               libxfs_trans_cancel
-#define xfs_trans_del_item             libxfs_trans_del_item
-#define xfs_trans_dup                  libxfs_trans_dup
-#define xfs_trans_get_buf              libxfs_trans_get_buf
-#define xfs_trans_getsb                        libxfs_trans_getsb
-#define xfs_trans_iget                 libxfs_trans_iget
-#define xfs_trans_ijoin                        libxfs_trans_ijoin
-#define xfs_trans_ijoin_ref            libxfs_trans_ijoin_ref
-#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_read_buf             libxfs_trans_read_buf
-#define xfs_trans_read_buf_map         libxfs_trans_read_buf_map
-#define xfs_trans_roll                 libxfs_trans_roll
-#define xfs_trans_get_buf_map          libxfs_trans_get_buf_map
-#define xfs_trans_reserve              libxfs_trans_reserve
-
-/* xfs_attr_leaf.h */
-#define xfs_attr_leaf_newentsize       libxfs_attr_leaf_newentsize
-
-/* xfs_bit.h */
-#define xfs_highbit32                  libxfs_highbit32
-#define xfs_highbit64                  libxfs_highbit64
-
-/* xfs_bmap.h */
-#define xfs_bmap_cancel                        libxfs_bmap_cancel
-#define xfs_bmap_last_offset           libxfs_bmap_last_offset
-#define xfs_bmapi_write                        libxfs_bmapi_write
-#define xfs_bmapi_read                 libxfs_bmapi_read
-#define xfs_bunmapi                    libxfs_bunmapi
-
-/* xfs_bmap_btree.h */
-#define xfs_bmbt_get_all               libxfs_bmbt_get_all
-
-/* xfs_da_btree.h */
-#define xfs_da_brelse                  libxfs_da_brelse
-#define xfs_da_hashname                        libxfs_da_hashname
-#define xfs_da_shrink_inode            libxfs_da_shrink_inode
-#define xfs_da_read_buf                        libxfs_da_read_buf
-
-/* xfs_dir2.h */
-#define xfs_dir_createname             libxfs_dir_createname
-#define xfs_dir_init                   libxfs_dir_init
-#define xfs_dir_lookup                 libxfs_dir_lookup
-#define xfs_dir_replace                        libxfs_dir_replace
-#define xfs_dir2_isblock               libxfs_dir2_isblock
-#define xfs_dir2_isleaf                        libxfs_dir2_isleaf
-
-/* xfs_dir2_data.h */
-#define __xfs_dir2_data_freescan       libxfs_dir2_data_freescan
-#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_use_free         libxfs_dir2_data_use_free
-#define xfs_dir2_shrink_inode          libxfs_dir2_shrink_inode
-
-/* xfs_inode.h */
-#define xfs_dinode_from_disk           libxfs_dinode_from_disk
-#define xfs_dinode_to_disk             libxfs_dinode_to_disk
-#define xfs_dinode_calc_crc            libxfs_dinode_calc_crc
-#define xfs_idata_realloc              libxfs_idata_realloc
-#define xfs_idestroy_fork              libxfs_idestroy_fork
-
-#define xfs_dinode_verify              libxfs_dinode_verify
-
-/* xfs_sb.h */
-#define xfs_log_sb                     libxfs_log_sb
-#define xfs_sb_from_disk               libxfs_sb_from_disk
-#define xfs_sb_quota_from_disk         libxfs_sb_quota_from_disk
-#define xfs_sb_to_disk                 libxfs_sb_to_disk
-
-/* xfs_symlink.h */
-#define xfs_symlink_blocks             libxfs_symlink_blocks
-#define xfs_symlink_hdr_ok             libxfs_symlink_hdr_ok
-
-/* xfs_trans_resv.h */
-#define xfs_trans_resv_calc            libxfs_trans_resv_calc
-
-
-/*
- * Now we've renamed and mapped everything, include the rest of the external
- * libxfs headers.
- */
-#include <xfs/platform_defs.h>
-
-#include <xfs/list.h>
-#include <xfs/hlist.h>
-#include <xfs/cache.h>
-#include <xfs/bitops.h>
-#include <xfs/kmem.h>
-#include <xfs/radix-tree.h>
-#include <xfs/swab.h>
-#include <xfs/atomic.h>
-
-#include <xfs/xfs_types.h>
-#include <xfs/xfs_arch.h>
-
-#include <xfs/xfs_fs.h>
-
-/* CRC stuff, buffer API dependent on it */
-extern uint32_t crc32_le(uint32_t crc, unsigned char const *p, size_t len);
-extern uint32_t crc32c_le(uint32_t crc, unsigned char const *p, size_t len);
-
-#define crc32(c,p,l)   crc32_le((c),(unsigned char const *)(p),(l))
-#define crc32c(c,p,l)  crc32c_le((c),(unsigned char const *)(p),(l))
-
-#include <xfs/xfs_cksum.h>
-
-/*
- * This mirrors the kernel include for xfs_buf.h - it's implicitly included in
- * every files via a similar include in the kernel xfs_linux.h.
- */
-#include <xfs/libxfs_io.h>
-
-/* for all the support code that uses progname in error messages */
-extern char    *progname;
-
-#undef ASSERT
-#define ASSERT(ex) assert(ex)
-
-typedef __uint32_t             uint_t;
-typedef __uint32_t             inst_t;         /* an instruction */
-
-#ifndef EWRONGFS
-#define EWRONGFS       EINVAL
-#endif
-
-#define xfs_error_level                        0
-
-#define STATIC                         static
-
-/* XXX: need to push these out to make LIBXFS_ATTR defines */
-#define ATTR_ROOT                      0x0002
-#define ATTR_SECURE                    0x0008
-#define ATTR_CREATE                    0x0010
-#define ATTR_REPLACE                   0x0020
-#define ATTR_KERNOTIME                 0
-#define ATTR_KERNOVAL                  0
-
-#define IHOLD(ip)                      ((void) 0)
-
-#define XFS_IGET_CREATE                        0x1
-#define XFS_IGET_UNTRUSTED             0x2
-
-extern void cmn_err(int, char *, ...);
-enum ce { CE_DEBUG, CE_CONT, CE_NOTE, CE_WARN, CE_ALERT, CE_PANIC };
-
-#define xfs_notice(mp,fmt,args...)             cmn_err(CE_NOTE,fmt, ## args)
-#define xfs_warn(mp,fmt,args...)               cmn_err(CE_WARN,fmt, ## args)
-#define xfs_hex_dump(d,n)              ((void) 0)
-
-
-/* stop unused var warnings by assigning mp to itself */
-#define XFS_CORRUPTION_ERROR(e,l,mp,m) do { \
-       (mp) = (mp); \
-       cmn_err(CE_ALERT, "%s: XFS_CORRUPTION_ERROR", (e));  \
-} while (0)
-
-#define XFS_ERROR_REPORT(e,l,mp)       do { \
-       (mp) = (mp); \
-       cmn_err(CE_ALERT, "%s: XFS_ERROR_REPORT", (e));  \
-} while (0)
-
-#define XFS_QM_DQATTACH(mp,ip,flags)   0
-#define XFS_ERRLEVEL_LOW               1
-#define XFS_FORCED_SHUTDOWN(mp)                0
-#define XFS_ILOCK_EXCL                 0
-#define XFS_STATS_INC(count)           do { } while (0)
-#define XFS_STATS_DEC(count, x)                do { } while (0)
-#define XFS_STATS_ADD(count, x)                do { } while (0)
-#define XFS_TRANS_MOD_DQUOT_BYINO(mp,tp,ip,field,delta)        do { } while (0)
-#define XFS_TRANS_RESERVE_QUOTA_NBLKS(mp,tp,ip,nblks,ninos,fl) 0
-#define XFS_TRANS_UNRESERVE_QUOTA_NBLKS(mp,tp,ip,nblks,ninos,fl)       0
-#define XFS_TEST_ERROR(expr,a,b,c)     ( expr )
-#define XFS_WANT_CORRUPTED_GOTO(mp, expr, l)   \
-               { if (!(expr)) { error = EFSCORRUPTED; goto l; } }
-#define XFS_WANT_CORRUPTED_RETURN(mp, expr)    \
-               { if (!(expr)) { return EFSCORRUPTED; } }
-
-#ifdef __GNUC__
-#define __return_address       __builtin_return_address(0)
-#endif
-
-#define XFS_DQUOT_CLUSTER_SIZE_FSB (xfs_filblks_t)1
-
-/* miscellaneous kernel routines not in user space */
-#define down_read(a)           ((void) 0)
-#define up_read(a)             ((void) 0)
-#define spin_lock_init(a)      ((void) 0)
-#define spin_lock(a)           ((void) 0)
-#define spin_unlock(a)         ((void) 0)
-#define likely(x)              (x)
-#define unlikely(x)            (x)
-#define rcu_read_lock()                ((void) 0)
-#define rcu_read_unlock()      ((void) 0)
-#define WARN_ON_ONCE(expr)     ((void) 0)
-
-#define percpu_counter_read(x) (*x)
-#define percpu_counter_sum(x)  (*x)
-
-/*
- * prandom_u32 is used for di_gen inode allocation, it must be zero for libxfs
- * or all sorts of badness can occur!
- */
-#define prandom_u32()          0
-
-#define PAGE_CACHE_SIZE                getpagesize()
-
-static inline int __do_div(unsigned long long *n, unsigned base)
-{
-       int __res;
-       __res = (int)(((unsigned long) *n) % (unsigned) base);
-       *n = ((unsigned long) *n) / (unsigned) base;
-       return __res;
-}
-
-#define do_div(n,base) (__do_div((unsigned long long *)&(n), (base)))
-#define do_mod(a, b)           ((a) % (b))
-#define rol32(x,y)             (((x) << (y)) | ((x) >> (32 - (y))))
-
-#define min_t(type,x,y) \
-       ({ type __x = (x); type __y = (y); __x < __y ? __x: __y; })
-#define max_t(type,x,y) \
-       ({ type __x = (x); type __y = (y); __x > __y ? __x: __y; })
-
-
-
-static inline __attribute__((const))
-int is_power_of_2(unsigned long n)
-{
-       return (n != 0 && ((n & (n - 1)) == 0));
-}
-
-/*
- * xfs_iroundup: round up argument to next power of two
- */
-static inline uint
-roundup_pow_of_two(uint v)
-{
-       int     i;
-       uint    m;
-
-       if ((v & (v - 1)) == 0)
-               return v;
-       ASSERT((v & 0x80000000) == 0);
-       if ((v & (v + 1)) == 0)
-               return v + 1;
-       for (i = 0, m = 1; i < 31; i++, m <<= 1) {
-               if (v & m)
-                       continue;
-               v |= m;
-               if ((v & (v + 1)) == 0)
-                       return v + 1;
-       }
-       ASSERT(0);
-       return 0;
-}
-
-static inline __uint64_t
-roundup_64(__uint64_t x, __uint32_t y)
-{
-       x += y - 1;
-       do_div(x, y);
-       return x * y;
-}
-
-#define __round_mask(x, y) ((__typeof__(x))((y)-1))
-#define round_up(x, y) ((((x)-1) | __round_mask(x, y))+1)
-#define round_down(x, y) ((x) & ~__round_mask(x, y))
-
-/* buffer management */
-#define XFS_BUF_LOCK                   0
-#define XFS_BUF_TRYLOCK                        0
-#define XBF_LOCK                       XFS_BUF_LOCK
-#define XBF_TRYLOCK                    XFS_BUF_TRYLOCK
-#define XBF_DONT_BLOCK                 0
-#define XBF_UNMAPPED                   0
-#define XBF_DONE                       0
-#define XFS_BUF_GETERROR(bp)           0
-#define XFS_BUF_DONE(bp)               ((bp)->b_flags |= LIBXFS_B_UPTODATE)
-#define XFS_BUF_ISDONE(bp)             ((bp)->b_flags & LIBXFS_B_UPTODATE)
-#define xfs_buf_stale(bp)              ((bp)->b_flags |= LIBXFS_B_STALE)
-#define XFS_BUF_UNDELAYWRITE(bp)       ((bp)->b_flags &= ~LIBXFS_B_DIRTY)
-#define XFS_BUF_SET_VTYPE(a,b)         ((void) 0)
-#define XFS_BUF_SET_VTYPE_REF(a,b,c)   ((void) 0)
-#define XFS_BUF_SET_BDSTRAT_FUNC(a,b)  ((void) 0)
-
-/* avoid gcc warning */
-#define xfs_incore(bt,blkno,len,lockit)        ({              \
-       typeof(blkno) __foo = (blkno);                  \
-       typeof(len) __bar = (len);                      \
-       (blkno) = __foo;                                \
-       (len) = __bar; /* no set-but-unused warning */  \
-       NULL;                                           \
-})
-#define xfs_buf_relse(bp)              libxfs_putbuf(bp)
-#define xfs_buf_get(devp,blkno,len,f)  (libxfs_getbuf((devp), (blkno), (len)))
-#define xfs_bwrite(bp)                 libxfs_writebuf((bp), 0)
-#define xfs_buf_delwri_queue(bp, bl)   libxfs_writebuf((bp), 0)
-
-#define XBRW_READ                      LIBXFS_BREAD
-#define XBRW_WRITE                     LIBXFS_BWRITE
-#define xfs_buf_iomove(bp,off,len,data,f)      libxfs_iomove(bp,off,len,data,f)
-#define xfs_buf_zero(bp,off,len)       libxfs_iomove(bp,off,len,0,LIBXFS_BZERO)
-
-/* mount stuff */
-#define XFS_MOUNT_32BITINODES          LIBXFS_MOUNT_32BITINODES
-#define XFS_MOUNT_ATTR2                        LIBXFS_MOUNT_ATTR2
-#define XFS_MOUNT_SMALL_INUMS          0       /* ignored in userspace */
-#define XFS_MOUNT_WSYNC                        0       /* ignored in userspace */
-#define XFS_MOUNT_NOALIGN              0       /* ignored in userspace */
-#define XFS_MOUNT_IKEEP                        0       /* ignored in userspace */
-#define XFS_MOUNT_SWALLOC              0       /* ignored in userspace */
-#define XFS_MOUNT_RDONLY               0       /* ignored in userspace */
-
-
-#define _xfs_trans_alloc(mp, type, f)  libxfs_trans_alloc(mp, type)
-#define xfs_trans_get_block_res(tp)    1
-#define xfs_trans_set_sync(tp)         ((void) 0)
-#define xfs_trans_ordered_buf(tp, bp)  ((void) 0)
-#define        xfs_trans_agblocks_delta(tp, d)
-#define        xfs_trans_agflist_delta(tp, d)
-#define        xfs_trans_agbtree_delta(tp, d)
-#define xfs_trans_buf_set_type(tp, bp, t)      ({      \
-       int __t = (t);                                  \
-       __t = __t; /* no set-but-unused warning */      \
-})
-
-#define xfs_trans_buf_copy_type(dbp, sbp)
-
-/* no readahead, need to avoid set-but-unused var warnings. */
-#define xfs_buf_readahead(a,d,c,ops)           ({      \
-       xfs_daddr_t __d = d;                            \
-       __d = __d; /* no set-but-unused warning */      \
-})
-#define xfs_buf_readahead_map(a,b,c,ops)       ((void) 0)      /* no readahead */
-#define xfs_buftrace(x,y)                      ((void) 0)      /* debug only */
-
-#define xfs_cmn_err(tag,level,mp,fmt,args...)  cmn_err(level,fmt, ## args)
-#define xfs_warn(mp,fmt,args...)               cmn_err(CE_WARN,fmt, ## args)
-#define xfs_alert(mp,fmt,args...)              cmn_err(CE_ALERT,fmt, ## args)
-#define xfs_alert_tag(mp,tag,fmt,args...)      cmn_err(CE_ALERT,fmt, ## args)
-
-#define xfs_dir2_trace_args(where, args)               ((void) 0)
-#define xfs_dir2_trace_args_b(where, args, bp)         ((void) 0)
-#define xfs_dir2_trace_args_bb(where, args, lbp, dbp)  ((void) 0)
-#define xfs_dir2_trace_args_bibii(where, args, bs, ss, bd, sd, c) ((void) 0)
-#define xfs_dir2_trace_args_db(where, args, db, bp)    ((void) 0)
-#define xfs_dir2_trace_args_i(where, args, i)          ((void) 0)
-#define xfs_dir2_trace_args_s(where, args, s)          ((void) 0)
-#define xfs_dir2_trace_args_sb(where, args, s, bp)     ((void) 0)
-#define xfs_sort                                       qsort
-
-#define xfs_icsb_reinit_counters(mp)                   do { } while (0)
-#define xfs_initialize_perag_icache(pag)               ((void) 0)
-
-#define xfs_ilock(ip,mode)                             ((void) 0)
-#define xfs_ilock_nowait(ip,mode)                      ((void) 0)
-#define xfs_ilock_demote(ip,mode)                      ((void) 0)
-#define xfs_ilock_data_map_shared(ip)                  (0)
-#define xfs_ilock_attr_map_shared(ip)                  (0)
-#define xfs_iunlock(ip,mode)                           ({      \
-       typeof(mode) __mode = mode;                             \
-       __mode = __mode; /* no set-but-unused warning */        \
-})
-#define __xfs_flock(ip)                                        ((void) 0)
-
-/* space allocation */
-#define xfs_extent_busy_reuse(mp,ag,bno,len,user)      ((void) 0)
-#define xfs_extent_busy_insert(tp,ag,bno,len,flags)    ((void) 0)
-#define xfs_extent_busy_trim(args,fbno,flen,bno,len) \
-do { \
-       *(bno) = (fbno); \
-       *(len) = (flen); \
-} while (0)
-
-/* avoid unused variable warning */
-#define xfs_alloc_busy_insert(tp,ag,b,len)     ({      \
-       xfs_agnumber_t __foo = ag;                      \
-       __foo = 0;                                      \
-})
-
-#define xfs_rotorstep                          1
-#define xfs_bmap_rtalloc(a)                    (ENOSYS)
-#define xfs_rtpick_extent(mp,tp,len,p)         (ENOSYS)
-#define xfs_get_extsz_hint(ip)                 (0)
-#define xfs_inode_is_filestream(ip)            (0)
-#define xfs_filestream_lookup_ag(ip)           (0)
-#define xfs_filestream_new_ag(ip,ag)           (0)
-
-#define xfs_log_force(mp,flags)                        ((void) 0)
-#define XFS_LOG_SYNC                           1
-
-/* quota bits */
-#define xfs_trans_mod_dquot_byino(t,i,f,d)             ((void) 0)
-#define xfs_trans_reserve_quota_nblks(t,i,b,n,f)       (0)
-#define xfs_trans_unreserve_quota_nblks(t,i,b,n,f)     ((void) 0)
-#define xfs_qm_dqattach(i,f)                           (0)
-
-#define uuid_copy(s,d)         platform_uuid_copy((s),(d))
-#define uuid_equal(s,d)                (platform_uuid_compare((s),(d)) == 0)
-
-#define xfs_icreate_log(tp, agno, agbno, cnt, isize, len, gen) ((void) 0)
-#define xfs_sb_validate_fsb_count(sbp, nblks)          (0)
-
-/*
- * Prototypes for kernel static functions that are aren't in their
- * associated header files.
- */
-struct xfs_da_args;
-struct xfs_bmap_free;
-struct xfs_bmap_free_item;
-struct xfs_mount;
-struct xfs_sb;
-struct xfs_trans;
-struct xfs_inode;
-struct xfs_log_item;
-struct xfs_buf;
-struct xfs_buf_map;
-struct xfs_buf_log_item;
-struct xfs_buftarg;
-
-/* xfs_attr.c */
-int xfs_attr_rmtval_get(struct xfs_da_args *);
-
-/* xfs_bmap.c */
-void xfs_bmap_del_free(struct xfs_bmap_free *, struct xfs_bmap_free_item *,
-                       struct xfs_bmap_free_item *);
-
-/* xfs_mount.c */
-int xfs_initialize_perag_data(struct xfs_mount *, xfs_agnumber_t);
-void xfs_mount_common(struct xfs_mount *, struct xfs_sb *);
-
-/*
- * logitem.c and trans.c prototypes
- */
-void xfs_trans_init(struct xfs_mount *);
-int xfs_trans_roll(struct xfs_trans **, struct xfs_inode *);
-
-/* xfs_trans_item.c */
-void xfs_trans_add_item(struct xfs_trans *, struct xfs_log_item *);
-void xfs_trans_del_item(struct xfs_log_item *);
-void xfs_trans_free_items(struct xfs_trans *, int);
-
-/* xfs_inode_item.c */
-void xfs_inode_item_init(struct xfs_inode *, struct xfs_mount *);
-
-/* xfs_buf_item.c */
-void xfs_buf_item_init(struct xfs_buf *, struct xfs_mount *);
-void xfs_buf_item_log(struct xfs_buf_log_item *, uint, uint);
-
-/* xfs_trans_buf.c */
-struct xfs_buf *xfs_trans_buf_item_match(struct xfs_trans *,
-                       struct xfs_buftarg *, struct xfs_buf_map *, int);
-
-/* local source files */
-#define xfs_mod_fdblocks(mp, delta, rsvd) \
-       libxfs_mod_incore_sb(mp, XFS_TRANS_SB_FDBLOCKS, delta, rsvd)
-#define xfs_mod_frextents(mp, delta) \
-       libxfs_mod_incore_sb(mp, XFS_TRANS_SB_FREXTENTS, delta, 0)
-int  libxfs_mod_incore_sb(struct xfs_mount *, int, int64_t, int);
-void xfs_reinit_percpu_counters(struct xfs_mount *mp);
-
-void xfs_trans_mod_sb(struct xfs_trans *, uint, long);
-void xfs_trans_init(struct xfs_mount *);
-int  xfs_trans_roll(struct xfs_trans **, struct xfs_inode *);
-void xfs_verifier_error(struct xfs_buf *bp);
-
-/* 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);
-
-#endif /* __LIBXFS_INTERNAL_XFS_H__ */
index 15b4e1715dc54688fbecb164de83b076a6196934..23e3c5387503b40abf848e4ef885ff5f58d83719 100644 (file)
@@ -15,7 +15,7 @@
  * along with this program; if not, write the Free Software Foundation,
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-#include "xfs.h"
+#include "libxfs_priv.h"
 #include "xfs_fs.h"
 #include "xfs_format.h"
 #include "xfs_log_format.h"
index 20a072dd9c55de4e296741a7fd36af0ee025b931..7fd72af95b0b214cff1e2f1772a1151c2647eb3a 100644 (file)
@@ -15,7 +15,7 @@
  * along with this program; if not, write the Free Software Foundation,
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-#include "xfs.h"
+#include "libxfs_priv.h"
 #include "xfs_fs.h"
 #include "xfs_shared.h"
 #include "xfs_format.h"
index 00a319bd60a9917740189c04d582e0d3753cce23..f8c24f6d89f1c1d1701b0dd4ae80564a72524d65 100644 (file)
@@ -15,7 +15,7 @@
  * along with this program; if not, write the Free Software Foundation,
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-#include "xfs.h"
+#include "libxfs_priv.h"
 #include "xfs_fs.h"
 #include "xfs_shared.h"
 #include "xfs_format.h"
index 01173a743e855661e524437ce88fb468691b7c7a..200bd30c16f9f776857b3a4a80e8bf52ac479b18 100644 (file)
@@ -16,7 +16,7 @@
  * along with this program; if not, write the Free Software Foundation,
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-#include "xfs.h"
+#include "libxfs_priv.h"
 #include "xfs_fs.h"
 #include "xfs_shared.h"
 #include "xfs_format.h"
index 356b2e00e09e38a283944ad7c486ef0ea0ca73c6..4f492c18cc8c9bfb13ffff5cf3a7d9a87ef03fd5 100644 (file)
@@ -16,7 +16,7 @@
  * along with this program; if not, write the Free Software Foundation,
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-#include "xfs.h"
+#include "libxfs_priv.h"
 #include "xfs_fs.h"
 #include "xfs_shared.h"
 #include "xfs_format.h"
index 55a2a25e44d77c887c565698b2d847db6961d93e..e6d1e6c0d7becb4495f5e5a125ea28c7499acd49 100644 (file)
@@ -15,7 +15,7 @@
  * along with this program; if not, write the Free Software Foundation,
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-#include "xfs.h"
+#include "libxfs_priv.h"
 #include "xfs_fs.h"
 #include "xfs_shared.h"
 #include "xfs_format.h"
index f1ad2f97976cfc2fb0c9cfff5fa69c9a221e894a..2fd04e0cd19a43d62a965865070357318a0ca619 100644 (file)
@@ -15,7 +15,7 @@
  * along with this program; if not, write the Free Software Foundation,
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-#include "xfs.h"
+#include "libxfs_priv.h"
 #include "xfs_fs.h"
 #include "xfs_shared.h"
 #include "xfs_format.h"
index 6c460611d9147c43b468577112575007afcc1c51..203e7d20f07b19d981184bf300325cc027381731 100644 (file)
@@ -15,7 +15,7 @@
  * along with this program; if not, write the Free Software Foundation,
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-#include "xfs.h"
+#include "libxfs_priv.h"
 #include "xfs_fs.h"
 #include "xfs_shared.h"
 #include "xfs_format.h"
index a7502aecb6fe3c68b2c65c6b55441e29702e417f..441bef4ec1d7949447ece2b2ef5ce1eb17f2e3d8 100644 (file)
@@ -16,7 +16,7 @@
  * along with this program; if not, write the Free Software Foundation,
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-#include "xfs.h"
+#include "libxfs_priv.h"
 #include "xfs_fs.h"
 #include "xfs_shared.h"
 #include "xfs_format.h"
index 9d624a6229468f721beaba38826008492f325aa0..e4c37f94866efffd977a3e30c1194378f89ec498 100644 (file)
@@ -16,7 +16,7 @@
  * along with this program; if not, write the Free Software Foundation,
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-#include "xfs.h"
+#include "libxfs_priv.h"
 #include "xfs_fs.h"
 #include "xfs_shared.h"
 #include "xfs_format.h"
index 9ad9540d4635ffe86a0b2f4fda6a26e0927cc2eb..2a42317ab2f192cc697e2098961db3b9a1070ee9 100644 (file)
@@ -15,7 +15,7 @@
  * along with this program; if not, write the Free Software Foundation,
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-#include "xfs.h"
+#include "libxfs_priv.h"
 #include "xfs_fs.h"
 #include "xfs_format.h"
 #include "xfs_log_format.h"
index d949c6363cd92b0f5b277b5562eb1f79e3c13bed..f061a99a3f11b31cd9fecfab044c015346b9aaca 100644 (file)
@@ -16,7 +16,7 @@
  * along with this program; if not, write the Free Software Foundation,
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-#include "xfs.h"
+#include "libxfs_priv.h"
 #include "xfs_fs.h"
 #include "xfs_format.h"
 #include "xfs_log_format.h"
index 3d13011ea771897fe24f6b38f9c8c3600414d654..609c097bb1e922745b3ddffab93e9dbe0768436a 100644 (file)
@@ -16,7 +16,7 @@
  * along with this program; if not, write the Free Software Foundation,
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-#include "xfs.h"
+#include "libxfs_priv.h"
 #include "xfs_fs.h"
 #include "xfs_format.h"
 #include "xfs_log_format.h"
index 4c813864e86905ce7f52ecfad73880c8f30d52ad..c2dba8a4e78b545acb3741c7d50fb9ffb5e7158c 100644 (file)
@@ -16,7 +16,7 @@
  * along with this program; if not, write the Free Software Foundation,
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-#include "xfs.h"
+#include "libxfs_priv.h"
 #include "xfs_fs.h"
 #include "xfs_format.h"
 #include "xfs_log_format.h"
index ecda1ddb2d3413627a8d71d1b2427ee02620b28e..3b71e9e514205ee3b25e4e1535d7430d9e813fe0 100644 (file)
@@ -16,7 +16,7 @@
  * along with this program; if not, write the Free Software Foundation,
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-#include "xfs.h"
+#include "libxfs_priv.h"
 #include "xfs_fs.h"
 #include "xfs_format.h"
 #include "xfs_log_format.h"
index f549afef034efc96d496b177ac04c98907fa6086..e4b505b8bfe557c72298eca8f0281612193eada8 100644 (file)
@@ -15,7 +15,7 @@
  * along with this program; if not, write the Free Software Foundation,
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-#include "xfs.h"
+#include "libxfs_priv.h"
 #include "xfs_fs.h"
 #include "xfs_format.h"
 #include "xfs_log_format.h"
index 85827985fab99eb88d0b2fd4d2177a3af496dc9e..2e0484a6fe48c57c2fdfaccbb34a92e634ff5e4c 100644 (file)
@@ -16,7 +16,7 @@
  * along with this program; if not, write the Free Software Foundation,
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-#include "xfs.h"
+#include "libxfs_priv.h"
 #include "xfs_fs.h"
 #include "xfs_shared.h"
 #include "xfs_format.h"
index 841bde5e41a5ffac4eae057587885f503d3e33ef..2b4e4e0778662c098b4e08387a04b3fe6b98f6e2 100644 (file)
@@ -15,7 +15,7 @@
  * along with this program; if not, write the Free Software Foundation,
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-#include "xfs.h"
+#include "libxfs_priv.h"
 #include "xfs_fs.h"
 #include "xfs_shared.h"
 #include "xfs_format.h"
index fd62c7f90959ffdc78e4deb5f05e0912f4d1b931..9ac143a5efe3fd39766481feb900dc2d549eb6cb 100644 (file)
@@ -15,7 +15,7 @@
  * along with this program; if not, write the Free Software Foundation,
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-#include "xfs.h"
+#include "libxfs_priv.h"
 #include "xfs_fs.h"
 #include "xfs_shared.h"
 #include "xfs_format.h"
index 561fdd2f01b349b7bfd32911349adf5068f687c4..28085b3294cbf4863a49b1bfe8702f0b4b7d6b87 100644 (file)
@@ -15,7 +15,7 @@
  * along with this program; if not, write the Free Software Foundation,
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-#include "xfs.h"
+#include "libxfs_priv.h"
 #include "xfs_fs.h"
 #include "xfs_shared.h"
 #include "xfs_format.h"
index 334ff86b4c651cf6d7c97704db139c27a54f58e1..e1968b43efd333408db812cef9087e938594ebf2 100644 (file)
@@ -15,7 +15,7 @@
  * along with this program; if not, write the Free Software Foundation,
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-#include "xfs.h"
+#include "libxfs_priv.h"
 #include "xfs_fs.h"
 #include "xfs_format.h"
 #include "xfs_log_format.h"
index c10597973333ce44487c4c1c6723dac4ed2d38a3..9264afa92d1e47d4c365d108946de8e931b1b421 100644 (file)
@@ -15,7 +15,7 @@
  * along with this program; if not, write the Free Software Foundation,
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-#include "xfs.h"
+#include "libxfs_priv.h"
 #include "xfs_fs.h"
 #include "xfs_shared.h"
 #include "xfs_format.h"
index a4201566d6d568f9a9442d344f2161b3388b3b22..0054432c17329f7ac631a363287d98ea3d495a4e 100644 (file)
@@ -15,7 +15,7 @@
  * along with this program; if not, write the Free Software Foundation,
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-#include "xfs.h"
+#include "libxfs_priv.h"
 #include "xfs_fs.h"
 #include "xfs_shared.h"
 #include "xfs_format.h"
index e5cba591bce35955e6161d24909790c102f87bcf..6844cd8c3ef03e1819381e4e641982ae784eeea1 100644 (file)
@@ -15,7 +15,7 @@
  * along with this program; if not, write the Free Software Foundation,
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-#include "xfs.h"
+#include "libxfs_priv.h"
 #include "xfs_fs.h"
 #include "xfs_shared.h"
 #include "xfs_format.h"
index aad3df8a1325b63569fbe64b871cc99d42ea0c07..6bc5af530373f3c924ea5fa4b56bc4e952a1d3d6 100644 (file)
@@ -16,7 +16,7 @@
  * along with this program; if not, write the Free Software Foundation,
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-#include "xfs.h"
+#include "libxfs_priv.h"
 #include "xfs_fs.h"
 #include "xfs_format.h"
 #include "xfs_log_format.h"
index 2bb622da78e32c74b4ce7933727030b7dedc85ca..0c40b528de2b059fa4c69bd53463ec5191280dc8 100644 (file)
@@ -16,7 +16,7 @@
  * along with this program; if not, write the Free Software Foundation,
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-#include "xfs.h"
+#include "libxfs_priv.h"
 #include "xfs_fs.h"
 #include "xfs_shared.h"
 #include "xfs_format.h"