/*
* Copyright (c) 2008, 2009 Reinoud Zandijk
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
extern struct pool nilfs_node_pool;
struct nilfs_node;
struct nilfs_mount;
#define NILFS_MAXNAMLEN 255
/* structure and derivatives */
struct nilfs_mdt {
uint32_t entries_per_block;
uint32_t entries_per_group;
uint32_t blocks_per_group;
uint32_t groups_per_desc_block; /* desc is super group */
uint32_t blocks_per_desc_block; /* desc is super group */
};
/* all that is related to the nilfs itself */
struct nilfs_device {
/* device info */
struct vnode *devvp;
struct mount *vfs_mountp;
int refcnt;
/* meta : super block etc. */
uint64_t devsize;
uint32_t blocksize;
struct nilfs_super_block super, super2;
struct nilfs_node *dat_node;
struct nilfs_node *cp_node;
struct nilfs_node *su_node;
/* segment usage */
/* checkpoints */
/* dat structure and derivatives */
struct nilfs_mdt dat_mdt;
struct nilfs_mdt ifile_mdt;
/* running values */
int mount_state; /* ? */
uint64_t last_seg_seq; /* current segment sequence number */
uint64_t last_seg_num; /* last segment */
uint64_t next_seg_num; /* next segment to fill */
uint64_t last_cno; /* current checkpoint number */
struct nilfs_segment_summary last_segsum;
struct nilfs_super_root super_root;
/* syncing and late allocation */
int syncing; /* are we syncing? */
/* XXX sync_cv on what mutex? */
kcondvar_t sync_cv; /* sleeping on sync */
uint32_t uncomitted_bl; /* for free space */
/* a specific mountpoint; head or a checkpoint/snapshot */
struct nilfs_mount {
struct mount *vfs_mountp;
struct nilfs_device *nilfsdev;
struct nilfs_args mount_args; /* flags RO access */