pagemap: fix pfn calculation for hugepage
[safe/jmp/linux-2.6] / include / linux / nilfs2_fs.h
index e38fad2..640702e 100644 (file)
  * struct nilfs_inode - structure of an inode on disk
  * @i_blocks: blocks count
  * @i_size: size in bytes
- * @i_ctime: creation time
- * @i_mtime: modification time
- * @i_dtime: deletion time
+ * @i_ctime: creation time (seconds)
+ * @i_mtime: modification time (seconds)
+ * @i_ctime_nsec: creation time (nano seconds)
+ * @i_mtime_nsec: modification time (nano seconds)
  * @i_uid: user id
  * @i_gid: group id
  * @i_mode: file mode
@@ -85,7 +86,8 @@ struct nilfs_inode {
        __le64  i_size;
        __le64  i_ctime;
        __le64  i_mtime;
-       __le64  i_dtime;
+       __le32  i_ctime_nsec;
+       __le32  i_mtime_nsec;
        __le32  i_uid;
        __le32  i_gid;
        __le16  i_mode;
@@ -149,6 +151,9 @@ struct nilfs_super_root {
 #define NILFS_MOUNT_BARRIER            0x1000  /* Use block barriers */
 #define NILFS_MOUNT_STRICT_ORDER       0x2000  /* Apply strict in-order
                                                   semantics also for data */
+#define NILFS_MOUNT_NORECOVERY         0x4000  /* Disable write access during
+                                                  mount-time recovery */
+#define NILFS_MOUNT_DISCARD            0x8000  /* Issue DISCARD requests */
 
 
 /**
@@ -252,6 +257,10 @@ struct nilfs_super_block {
 #define NILFS_MIN_NRSVSEGS     8       /* Minimum number of reserved
                                           segments */
 
+/*
+ * bytes offset of secondary super block
+ */
+#define NILFS_SB2_OFFSET_BYTES(devsize)        ((((devsize) >> 12) - 1) << 12)
 
 /*
  * Maximal count of links to a file
@@ -397,6 +406,28 @@ struct nilfs_segment_summary {
 #define NILFS_SS_GC     0x0010  /* segment written for cleaner operation */
 
 /**
+ * struct nilfs_btree_node - B-tree node
+ * @bn_flags: flags
+ * @bn_level: level
+ * @bn_nchildren: number of children
+ * @bn_pad: padding
+ */
+struct nilfs_btree_node {
+       __u8 bn_flags;
+       __u8 bn_level;
+       __le16 bn_nchildren;
+       __le32 bn_pad;
+};
+
+/* flags */
+#define NILFS_BTREE_NODE_ROOT   0x01
+
+/* level */
+#define NILFS_BTREE_LEVEL_DATA          0
+#define NILFS_BTREE_LEVEL_NODE_MIN      (NILFS_BTREE_LEVEL_DATA + 1)
+#define NILFS_BTREE_LEVEL_MAX           14
+
+/**
  * struct nilfs_palloc_group_desc - block group descriptor
  * @pg_nfrees: number of free entries in block group
  */
@@ -419,15 +450,6 @@ struct nilfs_dat_entry {
 };
 
 /**
- * struct nilfs_dat_group_desc - block group descriptor
- * @dg_nfrees: number of free virtual block numbers in block group
- */
-struct nilfs_dat_group_desc {
-       __le32 dg_nfrees;
-};
-
-
-/**
  * struct nilfs_snapshot_list - snapshot list
  * @ssl_next: next checkpoint number on snapshot list
  * @ssl_prev: previous checkpoint number on snapshot list
@@ -470,6 +492,7 @@ enum {
        NILFS_CHECKPOINT_SNAPSHOT,
        NILFS_CHECKPOINT_INVALID,
        NILFS_CHECKPOINT_SKETCH,
+       NILFS_CHECKPOINT_MINOR,
 };
 
 #define NILFS_CHECKPOINT_FNS(flag, name)                               \
@@ -494,11 +517,12 @@ nilfs_checkpoint_##name(const struct nilfs_checkpoint *cp)                \
 
 NILFS_CHECKPOINT_FNS(SNAPSHOT, snapshot)
 NILFS_CHECKPOINT_FNS(INVALID, invalid)
-NILFS_CHECKPOINT_FNS(SKETCH, sketch)
+NILFS_CHECKPOINT_FNS(MINOR, minor)
 
 /**
  * struct nilfs_cpinfo - checkpoint information
  * @ci_flags: flags
+ * @ci_pad: padding
  * @ci_cno: checkpoint number
  * @ci_create: creation timestamp
  * @ci_nblk_inc: number of blocks incremented by this checkpoint
@@ -508,6 +532,7 @@ NILFS_CHECKPOINT_FNS(SKETCH, sketch)
  */
 struct nilfs_cpinfo {
        __u32 ci_flags;
+       __u32 ci_pad;
        __u64 ci_cno;
        __u64 ci_create;
        __u64 ci_nblk_inc;
@@ -525,7 +550,7 @@ nilfs_cpinfo_##name(const struct nilfs_cpinfo *cpinfo)                      \
 
 NILFS_CPINFO_FNS(SNAPSHOT, snapshot)
 NILFS_CPINFO_FNS(INVALID, invalid)
-NILFS_CPINFO_FNS(SKETCH, sketch)
+NILFS_CPINFO_FNS(MINOR, minor)
 
 
 /**
@@ -563,8 +588,6 @@ enum {
        NILFS_SEGMENT_USAGE_DIRTY,
        NILFS_SEGMENT_USAGE_ERROR,
 
-       /* on-memory only */
-       NILFS_SEGMENT_USAGE_VOLATILE_ACTIVE,
        /* ... */
 };
 
@@ -592,7 +615,6 @@ nilfs_segment_usage_##name(const struct nilfs_segment_usage *su)    \
 NILFS_SEGMENT_USAGE_FNS(ACTIVE, active)
 NILFS_SEGMENT_USAGE_FNS(DIRTY, dirty)
 NILFS_SEGMENT_USAGE_FNS(ERROR, error)
-NILFS_SEGMENT_USAGE_FNS(VOLATILE_ACTIVE, volatile_active)
 
 static inline void
 nilfs_segment_usage_set_clean(struct nilfs_segment_usage *su)
@@ -648,7 +670,6 @@ nilfs_suinfo_##name(const struct nilfs_suinfo *si)                  \
 NILFS_SUINFO_FNS(ACTIVE, active)
 NILFS_SUINFO_FNS(DIRTY, dirty)
 NILFS_SUINFO_FNS(ERROR, error)
-NILFS_SUINFO_FNS(VOLATILE_ACTIVE, volatile_active)
 
 static inline int nilfs_suinfo_clean(const struct nilfs_suinfo *si)
 {
@@ -668,7 +689,8 @@ enum {
  */
 struct nilfs_cpmode {
        __u64 cm_cno;
-       int cm_mode;
+       __u32 cm_mode;
+       __u32 cm_pad;
 };
 
 /**
@@ -676,15 +698,15 @@ struct nilfs_cpmode {
  * @v_base:
  * @v_nmembs:
  * @v_size:
- * @v_index:
  * @v_flags:
+ * @v_index:
  */
 struct nilfs_argv {
-       void *v_base;
-       size_t v_nmembs;        /* number of members */
-       size_t v_size;          /* size of members */
-       int v_index;
-       int v_flags;
+       __u64 v_base;
+       __u32 v_nmembs; /* number of members */
+       __u16 v_size;   /* size of members */
+       __u16 v_flags;
+       __u64 v_index;
 };
 
 /**
@@ -714,15 +736,17 @@ struct nilfs_cpstat {
  * @ss_nsegs: number of segments
  * @ss_ncleansegs: number of clean segments
  * @ss_ndirtysegs: number of dirty segments
- * @ss_ctime:
- * @ss_nongc_ctime:
+ * @ss_ctime: creation time of the last segment
+ * @ss_nongc_ctime: creation time of the last segment not for GC
+ * @ss_prot_seq: least sequence number of segments which must not be reclaimed
  */
 struct nilfs_sustat {
        __u64 ss_nsegs;
        __u64 ss_ncleansegs;
        __u64 ss_ndirtysegs;
-       time_t ss_ctime;
-       time_t ss_nongc_ctime;
+       __u64 ss_ctime;
+       __u64 ss_nongc_ctime;
+       __u64 ss_prot_seq;
 };
 
 /**
@@ -750,6 +774,7 @@ struct nilfs_vdesc {
        __u64 vd_blocknr;
        __u64 vd_offset;
        __u32 vd_flags;
+       __u32 vd_pad;
 };
 
 /**
@@ -761,18 +786,7 @@ struct nilfs_bdesc {
        __u64 bd_blocknr;
        __u64 bd_offset;
        __u32 bd_level;
-};
-
-#define        NILFS_TIMEDWAIT_WRITE_LOCKED    0x1
-#define        NILFS_TIMEDWAIT_SEG_WRITE       0x2
-
-/**
- * struct nilfs_wait_cond -
- */
-struct nilfs_wait_cond {
-       int wc_cond;
-       int wc_flags;
-       struct timespec wc_timeout;
+       __u32 bd_pad;
 };
 
 #define NILFS_IOCTL_IDENT              'n'
@@ -795,60 +809,9 @@ struct nilfs_wait_cond {
        _IOWR(NILFS_IOCTL_IDENT, 0x87, struct nilfs_argv)
 #define NILFS_IOCTL_CLEAN_SEGMENTS  \
        _IOW(NILFS_IOCTL_IDENT, 0x88, struct nilfs_argv[5])
-#define NILFS_IOCTL_TIMEDWAIT  \
-       _IOWR(NILFS_IOCTL_IDENT, 0x89, struct nilfs_wait_cond)
 #define NILFS_IOCTL_SYNC  \
        _IOR(NILFS_IOCTL_IDENT, 0x8A, __u64)
 #define NILFS_IOCTL_RESIZE  \
        _IOW(NILFS_IOCTL_IDENT, 0x8B, __u64)
 
-/* compat_ioctl */
-#ifdef CONFIG_COMPAT
-#include <linux/compat.h>
-
-struct nilfs_cpmode32 {
-       __u64 cm_cno;
-       compat_int_t cm_mode;
-};
-
-struct nilfs_argv32 {
-       compat_caddr_t v_base;
-       compat_size_t v_nmembs;
-       compat_size_t v_size;
-       compat_int_t v_index;
-       compat_int_t v_flags;
-};
-
-struct nilfs_sustat32 {
-       __u64 ss_nsegs;
-       __u64 ss_ncleansegs;
-       __u64 ss_ndirtysegs;
-       compat_time_t ss_ctime;
-       compat_time_t ss_nongc_ctime;
-};
-
-struct nilfs_wait_cond32 {
-       compat_int_t wc_cond;
-       compat_int_t wc_flags;
-       struct compat_timespec wc_timeout;
-};
-
-#define NILFS_IOCTL32_CHANGE_CPMODE  \
-       _IOW(NILFS_IOCTL_IDENT, 0x80, struct nilfs_cpmode32)
-#define NILFS_IOCTL32_GET_CPINFO  \
-       _IOR(NILFS_IOCTL_IDENT, 0x82, struct nilfs_argv32)
-#define NILFS_IOCTL32_GET_SUINFO  \
-       _IOR(NILFS_IOCTL_IDENT, 0x84, struct nilfs_argv32)
-#define NILFS_IOCTL32_GET_SUSTAT  \
-       _IOR(NILFS_IOCTL_IDENT, 0x85, struct nilfs_sustat32)
-#define NILFS_IOCTL32_GET_VINFO  \
-       _IOWR(NILFS_IOCTL_IDENT, 0x86, struct nilfs_argv32)
-#define NILFS_IOCTL32_GET_BDESCS  \
-       _IOWR(NILFS_IOCTL_IDENT, 0x87, struct nilfs_argv32)
-#define NILFS_IOCTL32_CLEAN_SEGMENTS  \
-       _IOW(NILFS_IOCTL_IDENT, 0x88, struct nilfs_argv32[5])
-#define NILFS_IOCTL32_TIMEDWAIT  \
-       _IOWR(NILFS_IOCTL_IDENT, 0x89, struct nilfs_wait_cond32)
-#endif /* CONFIG_COMPAT */
-
 #endif /* _LINUX_NILFS_FS_H */