Thu Jun 24 10:20:08 2010 UTC ()
Update NiLFS(2) on-disc structures from Linux version


(reinoud)
diff -r1.1 -r1.2 src/sys/fs/nilfs/nilfs_fs.h

cvs diff -r1.1 -r1.2 src/sys/fs/nilfs/nilfs_fs.h (expand / switch to unified diff)

--- src/sys/fs/nilfs/nilfs_fs.h 2009/07/18 16:31:42 1.1
+++ src/sys/fs/nilfs/nilfs_fs.h 2010/06/24 10:20:08 1.2
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: nilfs_fs.h,v 1.1 2009/07/18 16:31:42 reinoud Exp $ */ 1/* $NetBSD: nilfs_fs.h,v 1.2 2010/06/24 10:20:08 reinoud Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2008, 2009 Reinoud Zandijk 4 * Copyright (c) 2008, 2009 Reinoud Zandijk
5 * All rights reserved. 5 * All rights reserved.
6 *  6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -266,28 +266,27 @@ struct nilfs_super_block { @@ -266,28 +266,27 @@ struct nilfs_super_block {
266 266
267 uint32_t s_checkinterval; /* max. time between checks */ 267 uint32_t s_checkinterval; /* max. time between checks */
268 uint32_t s_creator_os; /* OS that created it */ 268 uint32_t s_creator_os; /* OS that created it */
269 uint16_t s_def_resuid; /* default uid for reserv. blocks */ 269 uint16_t s_def_resuid; /* default uid for reserv. blocks */
270 uint16_t s_def_resgid; /* default gid for reserv. blocks */ 270 uint16_t s_def_resgid; /* default gid for reserv. blocks */
271 uint32_t s_first_ino; /* first non-reserved inode */ 271 uint32_t s_first_ino; /* first non-reserved inode */
272 272
273 uint16_t s_inode_size; /* size of an inode */ 273 uint16_t s_inode_size; /* size of an inode */
274 uint16_t s_dat_entry_size; /* size of a dat entry */ 274 uint16_t s_dat_entry_size; /* size of a dat entry */
275 uint16_t s_checkpoint_size; /* size of a checkpoint */ 275 uint16_t s_checkpoint_size; /* size of a checkpoint */
276 uint16_t s_segment_usage_size; /* size of a segment usage */ 276 uint16_t s_segment_usage_size; /* size of a segment usage */
277 277
278 uint8_t s_uuid[16]; /* 128-bit uuid for volume */ 278 uint8_t s_uuid[16]; /* 128-bit uuid for volume */
279 char s_volume_name[16]; /* volume name */ 279 char s_volume_name[80]; /* volume name */
280 char s_last_mounted[64]; /* directory where last mounted */ 
281 280
282 uint32_t s_c_interval; /* commit interval of segment */ 281 uint32_t s_c_interval; /* commit interval of segment */
283 uint32_t s_c_block_max; /* threshold of data amount for 282 uint32_t s_c_block_max; /* threshold of data amount for
284 the segment construction */ 283 the segment construction */
285 uint32_t s_reserved[192]; /* padding to end of the block */ 284 uint32_t s_reserved[192]; /* padding to end of the block */
286}; 285};
287 286
288#define NILFS_SUPER_MAGIC 0x3434 /* NILFS filesystem magic number */ 287#define NILFS_SUPER_MAGIC 0x3434 /* NILFS filesystem magic number */
289#define NILFS_SB_OFFSET_BYTES 1024 /* byte offset of nilfs superblock */ 288#define NILFS_SB_OFFSET_BYTES 1024 /* byte offset of nilfs superblock */
290#define NILFS_SB2_OFFSET_BYTES(devsize) ((((devsize) >> 12) - 1) << 12) 289#define NILFS_SB2_OFFSET_BYTES(devsize) ((((devsize) >> 12) - 1) << 12)
291 290
292 291
293/* codes for operating systems in superblock */ 292/* codes for operating systems in superblock */
@@ -413,26 +412,27 @@ union nilfs_binfo { @@ -413,26 +412,27 @@ union nilfs_binfo {
413struct nilfs_segment_summary { 412struct nilfs_segment_summary {
414 uint32_t ss_datasum; /* CRC of complete data block */ 413 uint32_t ss_datasum; /* CRC of complete data block */
415 uint32_t ss_sumsum; /* CRC of segment summary only */ 414 uint32_t ss_sumsum; /* CRC of segment summary only */
416 uint32_t ss_magic; /* magic to identify segment summary */ 415 uint32_t ss_magic; /* magic to identify segment summary */
417 uint16_t ss_bytes; /* size of segment summary structure */ 416 uint16_t ss_bytes; /* size of segment summary structure */
418 uint16_t ss_flags; /* NILFS_SS_* flags */ 417 uint16_t ss_flags; /* NILFS_SS_* flags */
419 uint64_t ss_seq; /* sequence number of this segm. sum */ 418 uint64_t ss_seq; /* sequence number of this segm. sum */
420 uint64_t ss_create; /* creation timestamp in seconds */ 419 uint64_t ss_create; /* creation timestamp in seconds */
421 uint64_t ss_next; /* blocknumber of next segment */ 420 uint64_t ss_next; /* blocknumber of next segment */
422 uint32_t ss_nblocks; /* number of blocks follow */ 421 uint32_t ss_nblocks; /* number of blocks follow */
423 uint32_t ss_nfinfo; /* number of finfo structures follow */ 422 uint32_t ss_nfinfo; /* number of finfo structures follow */
424 uint32_t ss_sumbytes; /* total size of segment summary */ 423 uint32_t ss_sumbytes; /* total size of segment summary */
425 uint32_t ss_pad; 424 uint32_t ss_pad;
 425 uint64_t ss_cno; /* latest checkpoint number known */
426 /* stream of finfo structures */ 426 /* stream of finfo structures */
427}; 427};
428 428
429#define NILFS_SEGSUM_MAGIC 0x1eaffa11 /* segment summary magic number */ 429#define NILFS_SEGSUM_MAGIC 0x1eaffa11 /* segment summary magic number */
430 430
431/* Segment summary flags */ 431/* Segment summary flags */
432#define NILFS_SS_LOGBGN 0x0001 /* begins a logical segment */ 432#define NILFS_SS_LOGBGN 0x0001 /* begins a logical segment */
433#define NILFS_SS_LOGEND 0x0002 /* ends a logical segment */ 433#define NILFS_SS_LOGEND 0x0002 /* ends a logical segment */
434#define NILFS_SS_SR 0x0004 /* has super root */ 434#define NILFS_SS_SR 0x0004 /* has super root */
435#define NILFS_SS_SYNDT 0x0008 /* includes data only updates */ 435#define NILFS_SS_SYNDT 0x0008 /* includes data only updates */
436#define NILFS_SS_GC 0x0010 /* segment written for cleaner operation */ 436#define NILFS_SS_GC 0x0010 /* segment written for cleaner operation */
437#define NILFS_SS_FLAG_BITS "\20\1LOGBGN\2LOGEND\3SR\4SYNDT\5GC" 437#define NILFS_SS_FLAG_BITS "\20\1LOGBGN\2LOGEND\3SR\4SYNDT\5GC"
438 438