Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations
nilfs2_fs.h File Reference
#include <linux/types.h>
#include <linux/ioctl.h>
#include <linux/magic.h>
#include <linux/bug.h>

Go to the source code of this file.

Data Structures

struct  nilfs_inode
 
struct  nilfs_super_root
 
struct  nilfs_super_block
 
struct  nilfs_dir_entry
 
struct  nilfs_finfo
 
struct  nilfs_binfo_v
 
struct  nilfs_binfo_dat
 
union  nilfs_binfo
 
struct  nilfs_segment_summary
 
struct  nilfs_btree_node
 
struct  nilfs_palloc_group_desc
 
struct  nilfs_dat_entry
 
struct  nilfs_snapshot_list
 
struct  nilfs_checkpoint
 
struct  nilfs_cpinfo
 
struct  nilfs_cpfile_header
 
struct  nilfs_segment_usage
 
struct  nilfs_sufile_header
 
struct  nilfs_suinfo
 
struct  nilfs_cpmode
 
struct  nilfs_argv
 
struct  nilfs_period
 
struct  nilfs_cpstat
 
struct  nilfs_sustat
 
struct  nilfs_vinfo
 
struct  nilfs_vdesc
 
struct  nilfs_bdesc
 

Macros

#define NILFS_INODE_BMAP_SIZE   7
 
#define i_device_code   i_bmap[0]
 
#define NILFS_SR_MDT_OFFSET(inode_size, i)
 
#define NILFS_SR_DAT_OFFSET(inode_size)   NILFS_SR_MDT_OFFSET(inode_size, 0)
 
#define NILFS_SR_CPFILE_OFFSET(inode_size)   NILFS_SR_MDT_OFFSET(inode_size, 1)
 
#define NILFS_SR_SUFILE_OFFSET(inode_size)   NILFS_SR_MDT_OFFSET(inode_size, 2)
 
#define NILFS_SR_BYTES(inode_size)   NILFS_SR_MDT_OFFSET(inode_size, 3)
 
#define NILFS_DFL_MAX_MNT_COUNT   50 /* 50 mounts */
 
#define NILFS_VALID_FS   0x0001 /* Unmounted cleanly */
 
#define NILFS_ERROR_FS   0x0002 /* Errors detected */
 
#define NILFS_RESIZE_FS   0x0004 /* Resize required */
 
#define NILFS_MOUNT_ERROR_MODE   0x0070 /* Error mode mask */
 
#define NILFS_MOUNT_ERRORS_CONT   0x0010 /* Continue on errors */
 
#define NILFS_MOUNT_ERRORS_RO   0x0020 /* Remount fs ro on errors */
 
#define NILFS_MOUNT_ERRORS_PANIC   0x0040 /* Panic on errors */
 
#define NILFS_MOUNT_BARRIER   0x1000 /* Use block barriers */
 
#define NILFS_MOUNT_STRICT_ORDER
 
#define NILFS_MOUNT_NORECOVERY
 
#define NILFS_MOUNT_DISCARD   0x8000 /* Issue DISCARD requests */
 
#define NILFS_OS_LINUX   0
 
#define NILFS_CURRENT_REV   2 /* current major revision */
 
#define NILFS_MINOR_REV   0 /* minor revision */
 
#define NILFS_MIN_SUPP_REV   2 /* minimum supported revision */
 
#define NILFS_FEATURE_COMPAT_RO_BLOCK_COUNT   0x00000001ULL
 
#define NILFS_FEATURE_COMPAT_SUPP   0ULL
 
#define NILFS_FEATURE_COMPAT_RO_SUPP   NILFS_FEATURE_COMPAT_RO_BLOCK_COUNT
 
#define NILFS_FEATURE_INCOMPAT_SUPP   0ULL
 
#define NILFS_SB_BYTES   ((long)&((struct nilfs_super_block *)0)->s_reserved)
 
#define NILFS_ROOT_INO   2 /* Root file inode */
 
#define NILFS_DAT_INO   3 /* DAT file */
 
#define NILFS_CPFILE_INO   4 /* checkpoint file */
 
#define NILFS_SUFILE_INO   5 /* segment usage file */
 
#define NILFS_IFILE_INO   6 /* ifile */
 
#define NILFS_ATIME_INO   7 /* Atime file (reserved) */
 
#define NILFS_XATTR_INO   8 /* Xattribute file (reserved) */
 
#define NILFS_SKETCH_INO   10 /* Sketch file */
 
#define NILFS_USER_INO   11 /* Fisrt user's file inode number */
 
#define NILFS_SB_OFFSET_BYTES   1024 /* byte offset of nilfs superblock */
 
#define NILFS_SEG_MIN_BLOCKS
 
#define NILFS_PSEG_MIN_BLOCKS
 
#define NILFS_MIN_NRSVSEGS
 
#define NILFS_ROOT_METADATA_FILE(ino)   ((ino) >= NILFS_DAT_INO && (ino) <= NILFS_SUFILE_INO)
 
#define NILFS_SB2_OFFSET_BYTES(devsize)   ((((devsize) >> 12) - 1) << 12)
 
#define NILFS_LINK_MAX   32000
 
#define NILFS_NAME_LEN   255
 
#define NILFS_MIN_BLOCK_SIZE   1024
 
#define NILFS_MAX_BLOCK_SIZE   65536
 
#define NILFS_DIR_PAD   8
 
#define NILFS_DIR_ROUND   (NILFS_DIR_PAD - 1)
 
#define NILFS_DIR_REC_LEN(name_len)
 
#define NILFS_MAX_REC_LEN   ((1<<16)-1)
 
#define NILFS_SEGSUM_MAGIC   0x1eaffa11 /* segment summary magic number */
 
#define NILFS_SS_LOGBGN   0x0001 /* begins a logical segment */
 
#define NILFS_SS_LOGEND   0x0002 /* ends a logical segment */
 
#define NILFS_SS_SR   0x0004 /* has super root */
 
#define NILFS_SS_SYNDT   0x0008 /* includes data only updates */
 
#define NILFS_SS_GC   0x0010 /* segment written for cleaner operation */
 
#define NILFS_BTREE_NODE_ROOT   0x01
 
#define NILFS_BTREE_LEVEL_DATA   0
 
#define NILFS_BTREE_LEVEL_NODE_MIN   (NILFS_BTREE_LEVEL_DATA + 1)
 
#define NILFS_BTREE_LEVEL_MAX   14
 
#define NILFS_CHECKPOINT_FNS(flag, name)
 
#define NILFS_CPINFO_FNS(flag, name)
 
#define NILFS_CPFILE_FIRST_CHECKPOINT_OFFSET
 
#define NILFS_SEGMENT_USAGE_FNS(flag, name)
 
#define NILFS_SUFILE_FIRST_SEGMENT_USAGE_OFFSET
 
#define NILFS_SUINFO_FNS(flag, name)
 
#define NILFS_IOCTL_IDENT   'n'
 
#define NILFS_IOCTL_CHANGE_CPMODE   _IOW(NILFS_IOCTL_IDENT, 0x80, struct nilfs_cpmode)
 
#define NILFS_IOCTL_DELETE_CHECKPOINT   _IOW(NILFS_IOCTL_IDENT, 0x81, __u64)
 
#define NILFS_IOCTL_GET_CPINFO   _IOR(NILFS_IOCTL_IDENT, 0x82, struct nilfs_argv)
 
#define NILFS_IOCTL_GET_CPSTAT   _IOR(NILFS_IOCTL_IDENT, 0x83, struct nilfs_cpstat)
 
#define NILFS_IOCTL_GET_SUINFO   _IOR(NILFS_IOCTL_IDENT, 0x84, struct nilfs_argv)
 
#define NILFS_IOCTL_GET_SUSTAT   _IOR(NILFS_IOCTL_IDENT, 0x85, struct nilfs_sustat)
 
#define NILFS_IOCTL_GET_VINFO   _IOWR(NILFS_IOCTL_IDENT, 0x86, struct nilfs_argv)
 
#define NILFS_IOCTL_GET_BDESCS   _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_SYNC   _IOR(NILFS_IOCTL_IDENT, 0x8A, __u64)
 
#define NILFS_IOCTL_RESIZE   _IOW(NILFS_IOCTL_IDENT, 0x8B, __u64)
 
#define NILFS_IOCTL_SET_ALLOC_RANGE   _IOW(NILFS_IOCTL_IDENT, 0x8C, __u64[2])
 

Enumerations

enum  {
  NILFS_FT_UNKNOWN, NILFS_FT_REG_FILE, NILFS_FT_DIR, NILFS_FT_CHRDEV,
  NILFS_FT_BLKDEV, NILFS_FT_FIFO, NILFS_FT_SOCK, NILFS_FT_SYMLINK,
  NILFS_FT_MAX
}
 
enum  { NILFS_CHECKPOINT_SNAPSHOT, NILFS_CHECKPOINT_INVALID, NILFS_CHECKPOINT_SKETCH, NILFS_CHECKPOINT_MINOR }
 
enum  { NILFS_SEGMENT_USAGE_ACTIVE, NILFS_SEGMENT_USAGE_DIRTY, NILFS_SEGMENT_USAGE_ERROR }
 
enum  { NILFS_CHECKPOINT, NILFS_SNAPSHOT }
 

Macro Definition Documentation

#define i_device_code   i_bmap[0]

Definition at line 79 of file nilfs2_fs.h.

#define NILFS_ATIME_INO   7 /* Atime file (reserved) */

Definition at line 239 of file nilfs2_fs.h.

#define NILFS_BTREE_LEVEL_DATA   0

Definition at line 454 of file nilfs2_fs.h.

#define NILFS_BTREE_LEVEL_MAX   14

Definition at line 456 of file nilfs2_fs.h.

#define NILFS_BTREE_LEVEL_NODE_MIN   (NILFS_BTREE_LEVEL_DATA + 1)

Definition at line 455 of file nilfs2_fs.h.

#define NILFS_BTREE_NODE_ROOT   0x01

Definition at line 451 of file nilfs2_fs.h.

#define NILFS_CHECKPOINT_FNS (   flag,
  name 
)
Value:
static inline void \
nilfs_checkpoint_set_##name(struct nilfs_checkpoint *cp) \
{ \
cp->cp_flags = cpu_to_le32(le32_to_cpu(cp->cp_flags) | \
(1UL << NILFS_CHECKPOINT_##flag)); \
} \
static inline void \
nilfs_checkpoint_clear_##name(struct nilfs_checkpoint *cp) \
{ \
cp->cp_flags = cpu_to_le32(le32_to_cpu(cp->cp_flags) & \
~(1UL << NILFS_CHECKPOINT_##flag)); \
} \
static inline int \
nilfs_checkpoint_##name(const struct nilfs_checkpoint *cp) \
{ \
return !!(le32_to_cpu(cp->cp_flags) & \
(1UL << NILFS_CHECKPOINT_##flag)); \
}

Definition at line 526 of file nilfs2_fs.h.

#define NILFS_CPFILE_FIRST_CHECKPOINT_OFFSET
Value:

Definition at line 596 of file nilfs2_fs.h.

#define NILFS_CPFILE_INO   4 /* checkpoint file */

Definition at line 236 of file nilfs2_fs.h.

#define NILFS_CPINFO_FNS (   flag,
  name 
)
Value:
static inline int \
nilfs_cpinfo_##name(const struct nilfs_cpinfo *cpinfo) \
{ \
return !!(cpinfo->ci_flags & (1UL << NILFS_CHECKPOINT_##flag)); \
}

Definition at line 572 of file nilfs2_fs.h.

#define NILFS_CURRENT_REV   2 /* current major revision */

Definition at line 209 of file nilfs2_fs.h.

#define NILFS_DAT_INO   3 /* DAT file */

Definition at line 235 of file nilfs2_fs.h.

#define NILFS_DFL_MAX_MNT_COUNT   50 /* 50 mounts */

Definition at line 116 of file nilfs2_fs.h.

#define NILFS_DIR_PAD   8

Definition at line 317 of file nilfs2_fs.h.

#define NILFS_DIR_REC_LEN (   name_len)
Value:
(((name_len) + 12 + NILFS_DIR_ROUND) & \
~NILFS_DIR_ROUND)

Definition at line 319 of file nilfs2_fs.h.

#define NILFS_DIR_ROUND   (NILFS_DIR_PAD - 1)

Definition at line 318 of file nilfs2_fs.h.

#define NILFS_ERROR_FS   0x0002 /* Errors detected */

Definition at line 122 of file nilfs2_fs.h.

#define NILFS_FEATURE_COMPAT_RO_BLOCK_COUNT   0x00000001ULL

Definition at line 219 of file nilfs2_fs.h.

#define NILFS_FEATURE_COMPAT_RO_SUPP   NILFS_FEATURE_COMPAT_RO_BLOCK_COUNT

Definition at line 222 of file nilfs2_fs.h.

#define NILFS_FEATURE_COMPAT_SUPP   0ULL

Definition at line 221 of file nilfs2_fs.h.

#define NILFS_FEATURE_INCOMPAT_SUPP   0ULL

Definition at line 223 of file nilfs2_fs.h.

#define NILFS_IFILE_INO   6 /* ifile */

Definition at line 238 of file nilfs2_fs.h.

#define NILFS_INODE_BMAP_SIZE   7

Definition at line 47 of file nilfs2_fs.h.

#define NILFS_IOCTL_CHANGE_CPMODE   _IOW(NILFS_IOCTL_IDENT, 0x80, struct nilfs_cpmode)

Definition at line 837 of file nilfs2_fs.h.

#define NILFS_IOCTL_CLEAN_SEGMENTS   _IOW(NILFS_IOCTL_IDENT, 0x88, struct nilfs_argv[5])

Definition at line 853 of file nilfs2_fs.h.

#define NILFS_IOCTL_DELETE_CHECKPOINT   _IOW(NILFS_IOCTL_IDENT, 0x81, __u64)

Definition at line 839 of file nilfs2_fs.h.

#define NILFS_IOCTL_GET_BDESCS   _IOWR(NILFS_IOCTL_IDENT, 0x87, struct nilfs_argv)

Definition at line 851 of file nilfs2_fs.h.

#define NILFS_IOCTL_GET_CPINFO   _IOR(NILFS_IOCTL_IDENT, 0x82, struct nilfs_argv)

Definition at line 841 of file nilfs2_fs.h.

#define NILFS_IOCTL_GET_CPSTAT   _IOR(NILFS_IOCTL_IDENT, 0x83, struct nilfs_cpstat)

Definition at line 843 of file nilfs2_fs.h.

#define NILFS_IOCTL_GET_SUINFO   _IOR(NILFS_IOCTL_IDENT, 0x84, struct nilfs_argv)

Definition at line 845 of file nilfs2_fs.h.

#define NILFS_IOCTL_GET_SUSTAT   _IOR(NILFS_IOCTL_IDENT, 0x85, struct nilfs_sustat)

Definition at line 847 of file nilfs2_fs.h.

#define NILFS_IOCTL_GET_VINFO   _IOWR(NILFS_IOCTL_IDENT, 0x86, struct nilfs_argv)

Definition at line 849 of file nilfs2_fs.h.

#define NILFS_IOCTL_IDENT   'n'

Definition at line 835 of file nilfs2_fs.h.

#define NILFS_IOCTL_RESIZE   _IOW(NILFS_IOCTL_IDENT, 0x8B, __u64)

Definition at line 857 of file nilfs2_fs.h.

#define NILFS_IOCTL_SET_ALLOC_RANGE   _IOW(NILFS_IOCTL_IDENT, 0x8C, __u64[2])

Definition at line 859 of file nilfs2_fs.h.

#define NILFS_IOCTL_SYNC   _IOR(NILFS_IOCTL_IDENT, 0x8A, __u64)

Definition at line 855 of file nilfs2_fs.h.

#define NILFS_LINK_MAX   32000

Definition at line 266 of file nilfs2_fs.h.

#define NILFS_MAX_BLOCK_SIZE   65536

Definition at line 279 of file nilfs2_fs.h.

#define NILFS_MAX_REC_LEN   ((1<<16)-1)

Definition at line 321 of file nilfs2_fs.h.

#define NILFS_MIN_BLOCK_SIZE   1024

Definition at line 278 of file nilfs2_fs.h.

#define NILFS_MIN_NRSVSEGS
Value:
8 /* Minimum number of reserved
segments */

Definition at line 248 of file nilfs2_fs.h.

#define NILFS_MIN_SUPP_REV   2 /* minimum supported revision */

Definition at line 211 of file nilfs2_fs.h.

#define NILFS_MINOR_REV   0 /* minor revision */

Definition at line 210 of file nilfs2_fs.h.

#define NILFS_MOUNT_BARRIER   0x1000 /* Use block barriers */

Definition at line 132 of file nilfs2_fs.h.

#define NILFS_MOUNT_DISCARD   0x8000 /* Issue DISCARD requests */

Definition at line 135 of file nilfs2_fs.h.

#define NILFS_MOUNT_ERROR_MODE   0x0070 /* Error mode mask */

Definition at line 128 of file nilfs2_fs.h.

#define NILFS_MOUNT_ERRORS_CONT   0x0010 /* Continue on errors */

Definition at line 129 of file nilfs2_fs.h.

#define NILFS_MOUNT_ERRORS_PANIC   0x0040 /* Panic on errors */

Definition at line 131 of file nilfs2_fs.h.

#define NILFS_MOUNT_ERRORS_RO   0x0020 /* Remount fs ro on errors */

Definition at line 130 of file nilfs2_fs.h.

#define NILFS_MOUNT_NORECOVERY
Value:
0x4000 /* Disable write access during
mount-time recovery */

Definition at line 134 of file nilfs2_fs.h.

#define NILFS_MOUNT_STRICT_ORDER
Value:
0x2000 /* Apply strict in-order
semantics also for data */

Definition at line 133 of file nilfs2_fs.h.

#define NILFS_NAME_LEN   255

Definition at line 273 of file nilfs2_fs.h.

#define NILFS_OS_LINUX   0

Definition at line 203 of file nilfs2_fs.h.

#define NILFS_PSEG_MIN_BLOCKS
Value:
2 /* Minimum number of blocks in
a partial segment */

Definition at line 247 of file nilfs2_fs.h.

#define NILFS_RESIZE_FS   0x0004 /* Resize required */

Definition at line 123 of file nilfs2_fs.h.

#define NILFS_ROOT_INO   2 /* Root file inode */

Definition at line 234 of file nilfs2_fs.h.

#define NILFS_ROOT_METADATA_FILE (   ino)    ((ino) >= NILFS_DAT_INO && (ino) <= NILFS_SUFILE_INO)

Definition at line 255 of file nilfs2_fs.h.

#define NILFS_SB2_OFFSET_BYTES (   devsize)    ((((devsize) >> 12) - 1) << 12)

Definition at line 261 of file nilfs2_fs.h.

#define NILFS_SB_BYTES   ((long)&((struct nilfs_super_block *)0)->s_reserved)

Definition at line 228 of file nilfs2_fs.h.

#define NILFS_SB_OFFSET_BYTES   1024 /* byte offset of nilfs superblock */

Definition at line 244 of file nilfs2_fs.h.

#define NILFS_SEG_MIN_BLOCKS
Value:
16 /* Minimum number of blocks in
a full segment */

Definition at line 246 of file nilfs2_fs.h.

#define NILFS_SEGMENT_USAGE_FNS (   flag,
  name 
)
Value:
static inline void \
nilfs_segment_usage_set_##name(struct nilfs_segment_usage *su) \
{ \
su->su_flags = cpu_to_le32(le32_to_cpu(su->su_flags) | \
(1UL << NILFS_SEGMENT_USAGE_##flag));\
} \
static inline void \
nilfs_segment_usage_clear_##name(struct nilfs_segment_usage *su) \
{ \
su->su_flags = \
cpu_to_le32(le32_to_cpu(su->su_flags) & \
~(1UL << NILFS_SEGMENT_USAGE_##flag)); \
} \
static inline int \
nilfs_segment_usage_##name(const struct nilfs_segment_usage *su) \
{ \
return !!(le32_to_cpu(su->su_flags) & \
(1UL << NILFS_SEGMENT_USAGE_##flag)); \
}

Definition at line 622 of file nilfs2_fs.h.

#define NILFS_SEGSUM_MAGIC   0x1eaffa11 /* segment summary magic number */

Definition at line 425 of file nilfs2_fs.h.

#define NILFS_SKETCH_INO   10 /* Sketch file */

Definition at line 241 of file nilfs2_fs.h.

#define NILFS_SR_BYTES (   inode_size)    NILFS_SR_MDT_OFFSET(inode_size, 3)

Definition at line 111 of file nilfs2_fs.h.

#define NILFS_SR_CPFILE_OFFSET (   inode_size)    NILFS_SR_MDT_OFFSET(inode_size, 1)

Definition at line 109 of file nilfs2_fs.h.

#define NILFS_SR_DAT_OFFSET (   inode_size)    NILFS_SR_MDT_OFFSET(inode_size, 0)

Definition at line 108 of file nilfs2_fs.h.

#define NILFS_SR_MDT_OFFSET (   inode_size,
  i 
)
Value:
((unsigned long)&((struct nilfs_super_root *)0)->sr_dat + \
(inode_size) * (i))

Definition at line 105 of file nilfs2_fs.h.

#define NILFS_SR_SUFILE_OFFSET (   inode_size)    NILFS_SR_MDT_OFFSET(inode_size, 2)

Definition at line 110 of file nilfs2_fs.h.

#define NILFS_SS_GC   0x0010 /* segment written for cleaner operation */

Definition at line 434 of file nilfs2_fs.h.

#define NILFS_SS_LOGBGN   0x0001 /* begins a logical segment */

Definition at line 430 of file nilfs2_fs.h.

#define NILFS_SS_LOGEND   0x0002 /* ends a logical segment */

Definition at line 431 of file nilfs2_fs.h.

#define NILFS_SS_SR   0x0004 /* has super root */

Definition at line 432 of file nilfs2_fs.h.

#define NILFS_SS_SYNDT   0x0008 /* includes data only updates */

Definition at line 433 of file nilfs2_fs.h.

#define NILFS_SUFILE_FIRST_SEGMENT_USAGE_OFFSET
Value:

Definition at line 674 of file nilfs2_fs.h.

#define NILFS_SUFILE_INO   5 /* segment usage file */

Definition at line 237 of file nilfs2_fs.h.

#define NILFS_SUINFO_FNS (   flag,
  name 
)
Value:
static inline int \
nilfs_suinfo_##name(const struct nilfs_suinfo *si) \
{ \
return si->sui_flags & (1UL << NILFS_SEGMENT_USAGE_##flag); \
}

Definition at line 691 of file nilfs2_fs.h.

#define NILFS_USER_INO   11 /* Fisrt user's file inode number */

Definition at line 242 of file nilfs2_fs.h.

#define NILFS_VALID_FS   0x0001 /* Unmounted cleanly */

Definition at line 121 of file nilfs2_fs.h.

#define NILFS_XATTR_INO   8 /* Xattribute file (reserved) */

Definition at line 240 of file nilfs2_fs.h.

Enumeration Type Documentation

anonymous enum
Enumerator:
NILFS_FT_UNKNOWN 
NILFS_FT_REG_FILE 
NILFS_FT_DIR 
NILFS_FT_CHRDEV 
NILFS_FT_BLKDEV 
NILFS_FT_FIFO 
NILFS_FT_SOCK 
NILFS_FT_SYMLINK 
NILFS_FT_MAX 

Definition at line 300 of file nilfs2_fs.h.

anonymous enum
Enumerator:
NILFS_CHECKPOINT_SNAPSHOT 
NILFS_CHECKPOINT_INVALID 
NILFS_CHECKPOINT_SKETCH 
NILFS_CHECKPOINT_MINOR 

Definition at line 519 of file nilfs2_fs.h.

anonymous enum
Enumerator:
NILFS_SEGMENT_USAGE_ACTIVE 
NILFS_SEGMENT_USAGE_DIRTY 
NILFS_SEGMENT_USAGE_ERROR 

Definition at line 614 of file nilfs2_fs.h.

anonymous enum
Enumerator:
NILFS_CHECKPOINT 
NILFS_SNAPSHOT 

Definition at line 708 of file nilfs2_fs.h.