]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/xfs/linux-2.6/xfs_linux.h
[XFS] kill vn_to_inode
[linux-2.6-omap-h63xx.git] / fs / xfs / linux-2.6 / xfs_linux.h
index 9bf4f7e965c7b3784531e403304fec785925868d..1b8dfdcac0a5841daa5d3b7f95b0088bad5979eb 100644 (file)
@@ -75,6 +75,8 @@
 #include <linux/delay.h>
 #include <linux/log2.h>
 #include <linux/spinlock.h>
+#include <linux/random.h>
+#include <linux/ctype.h>
 
 #include <asm/page.h>
 #include <asm/div64.h>
 /*
  * Feature macros (disable/enable)
  */
-#undef  HAVE_REFCACHE  /* reference cache not needed for NFS in 2.6 */
-#define HAVE_SPLICE    /* a splice(2) exists in 2.6, but not in 2.4 */
 #ifdef CONFIG_SMP
 #define HAVE_PERCPU_SB /* per cpu superblock counters are a 2.6 feature */
 #else
 
 #define spinlock_destroy(lock)
 
-#define NBPP           PAGE_SIZE
-#define NDPP           (1 << (PAGE_SHIFT - 9))
-
 #define NBBY           8               /* number of bits per byte */
-#define        NBPC            PAGE_SIZE       /* Number of bytes per click */
-#define        BPCSHIFT        PAGE_SHIFT      /* LOG2(NBPC) if exact */
 
 /*
  * Size of block device i/o is parameterized here.
  * Currently the system supports page-sized i/o.
  */
-#define        BLKDEV_IOSHIFT          BPCSHIFT
+#define        BLKDEV_IOSHIFT          PAGE_CACHE_SHIFT
 #define        BLKDEV_IOSIZE           (1<<BLKDEV_IOSHIFT)
 /* number of BB's per block device block */
 #define        BLKDEV_BB               BTOBB(BLKDEV_IOSIZE)
 
-/* bytes to clicks */
-#define        btoc(x)         (((__psunsigned_t)(x)+(NBPC-1))>>BPCSHIFT)
-#define        btoct(x)        ((__psunsigned_t)(x)>>BPCSHIFT)
-#define        btoc64(x)       (((__uint64_t)(x)+(NBPC-1))>>BPCSHIFT)
-#define        btoct64(x)      ((__uint64_t)(x)>>BPCSHIFT)
-
-/* off_t bytes to clicks */
-#define offtoc(x)       (((__uint64_t)(x)+(NBPC-1))>>BPCSHIFT)
-#define offtoct(x)      ((xfs_off_t)(x)>>BPCSHIFT)
-
-/* clicks to off_t bytes */
-#define        ctooff(x)       ((xfs_off_t)(x)<<BPCSHIFT)
-
-/* clicks to bytes */
-#define        ctob(x)         ((__psunsigned_t)(x)<<BPCSHIFT)
-#define btoct(x)        ((__psunsigned_t)(x)>>BPCSHIFT)
-#define        ctob64(x)       ((__uint64_t)(x)<<BPCSHIFT)
-
-/* bytes to clicks */
-#define btoc(x)         (((__psunsigned_t)(x)+(NBPC-1))>>BPCSHIFT)
-
 #define ENOATTR                ENODATA         /* Attribute not found */
 #define EWRONGFS       EINVAL          /* Mount with wrong filesystem type */
 #define EFSCORRUPTED   EUCLEAN         /* Filesystem is corrupted */
 #define xfs_sort(a,n,s,fn)     sort(a,n,s,fn,NULL)
 #define xfs_stack_trace()      dump_stack()
 #define xfs_itruncate_data(ip, off)    \
-       (-vmtruncate(vn_to_inode(XFS_ITOV(ip)), (off)))
+       (-vmtruncate(VFS_I(ip), (off)))
 
 
 /* Move the kernel do_div definition off to one side */
@@ -326,4 +300,11 @@ static inline __uint64_t howmany_64(__uint64_t x, __uint32_t y)
        return x;
 }
 
+/* ARM old ABI has some weird alignment/padding */
+#if defined(__arm__) && !defined(__ARM_EABI__)
+#define __arch_pack __attribute__((packed))
+#else
+#define __arch_pack
+#endif
+
 #endif /* __XFS_LINUX__ */