Whamcloud - gitweb
debian: remove trailing spaces from control.in file
[tools/e2fsprogs.git] / e2fsck / jfs_user.h
index 9da5a16..bfc1bcd 100644 (file)
 #include "e2fsck.h"
 
 struct buffer_head {
-       char            b_data[8192];
        e2fsck_t        b_ctx;
        io_channel      b_io;
        int             b_size;
-       blk_t           b_blocknr;
+       unsigned long long b_blocknr;
        int             b_dirty;
        int             b_uptodate;
        int             b_err;
+       char            b_data[1024];
 };
 
 struct inode {
@@ -45,12 +45,12 @@ typedef struct kdev_s *kdev_t;
 #define unlock_buffer(bh) do {} while(0)
 #define buffer_req(bh) 1
 #define do_readahead(journal, start) do {} while(0)
-       
+
 extern e2fsck_t e2fsck_global_ctx;  /* Try your very best not to use this! */
 
 typedef struct {
        int     object_length;
-} kmem_cache_t;
+} lkmem_cache_t;
 
 #define kmem_cache_alloc(cache,flags) malloc((cache)->object_length)
 #define kmem_cache_free(cache,obj) free(obj)
@@ -62,53 +62,78 @@ typedef struct {
 #define cond_resched() do { } while (0)
 
 typedef unsigned int __be32;
+typedef __u64 __be64;
+
+#define __init
+
+/*
+ * Now pull in the real linux/jfs.h definitions.
+ */
+#include <ext2fs/kernel-jbd.h>
 
 /*
  * We use the standard libext2fs portability tricks for inline
- * functions.  
+ * functions.
  */
-extern kmem_cache_t * do_cache_create(int len);
-extern void do_cache_destroy(kmem_cache_t *cache);
-       
+#ifdef NO_INLINE_FUNCS
+extern lkmem_cache_t * do_cache_create(int len);
+extern void do_cache_destroy(lkmem_cache_t *cache);
+extern size_t journal_tag_bytes(journal_t *journal);
+#endif
+
 #if (defined(E2FSCK_INCLUDE_INLINE_FUNCS) || !defined(NO_INLINE_FUNCS))
 #ifdef E2FSCK_INCLUDE_INLINE_FUNCS
-#define _INLINE_ extern
+#if (__STDC_VERSION__ >= 199901L)
+#define _INLINE_ extern inline
 #else
+#define _INLINE_ inline
+#endif
+#else /* !E2FSCK_INCLUDE_INLINE FUNCS */
+#if (__STDC_VERSION__ >= 199901L)
+#define _INLINE_ inline
+#else /* not C99 */
 #ifdef __GNUC__
 #define _INLINE_ extern __inline__
 #else                          /* For Watcom C */
 #define _INLINE_ extern inline
-#endif
-#endif
+#endif /* __GNUC__ */
+#endif /* __STDC_VERSION__ >= 199901L */
+#endif /* E2FSCK_INCLUDE_INLINE_FUNCS */
+
 
-_INLINE_ kmem_cache_t * do_cache_create(int len)
+_INLINE_ lkmem_cache_t * do_cache_create(int len)
 {
-       kmem_cache_t *new_cache;
+       lkmem_cache_t *new_cache;
        new_cache = malloc(sizeof(*new_cache));
        if (new_cache)
                new_cache->object_length = len;
        return new_cache;
 }
 
-_INLINE_ void do_cache_destroy(kmem_cache_t *cache)
+_INLINE_ void do_cache_destroy(lkmem_cache_t *cache)
 {
        free(cache);
 }
-#undef _INLINE_
-#endif
-
-#define __init
 
 /*
- * Now pull in the real linux/jfs.h definitions.
+ * helper functions to deal with 32 or 64bit block numbers.
  */
-#include <ext2fs/kernel-jbd.h>
+_INLINE_ size_t journal_tag_bytes(journal_t *journal)
+{
+       if (JFS_HAS_INCOMPAT_FEATURE(journal, JFS_FEATURE_INCOMPAT_64BIT))
+               return JBD_TAG_SIZE64;
+       else
+               return JBD_TAG_SIZE32;
+}
+
+#undef _INLINE_
+#endif
 
 /*
  * Kernel compatibility functions are defined in journal.c
  */
-int journal_bmap(journal_t *journal, blk_t block, unsigned long *phys);
-struct buffer_head *getblk(kdev_t ctx, blk_t blocknr, int blocksize);
+int journal_bmap(journal_t *journal, blk64_t block, unsigned long long *phys);
+struct buffer_head *getblk(kdev_t ctx, blk64_t blocknr, int blocksize);
 void sync_blockdev(kdev_t kdev);
 void ll_rw_block(int rw, int dummy, struct buffer_head *bh[]);
 void mark_buffer_dirty(struct buffer_head *bh);