[BACK]Return to node.h CVS log [TXT][DIR] Up to [Development] / xfs-cmds / xfsdump / restore

File: [Development] / xfs-cmds / xfsdump / restore / node.h (download)

Revision 1.7, Tue Jan 31 15:47:31 2006 UTC (11 years, 8 months ago) by wkendall
Branch: MAIN
CVS Tags: HEAD
Changes since 1.6: +1 -2 lines

This mod adds a number of optimizations to increase the
performance of xfsdump and xfsrestore, especially on filesystems
with millions of inodes. Many small changes were made to
minimize the number of system calls required per inode.
Significant changes to xfsdump:
- Cache the gen number of each inode during the initial inode
  scan so that a bulkstat single does not need to be done for
  each inode when dumping directories.
- No longer retrieve the DMF attribute when estimating the dump
  size of a file. Use information from the bulkstat instead.
- Retrieve DMF attribute by handle instead of doing
  open/attr_getf/close.
- In determining where to split multi-stream dumps, take into
  consideration the number of files and not just the file size.
  This allows filesystems with large amounts of inodes but
  relatively little data (DMF filesystem) to be split correctly.
Significant changes to xfsrestore:
- Buffer writes to the namreg file to eliminate 2 very small
  write system calls per directory entry.
- Buffer writes to dirattr file to eliminate a small write system
  call per directory.
- Speedup the check to see if a particular window of the tree
  file is mapped. This allows xfsrestore to use more, smaller
  windows which is beneficial if we can't fit them all in memory
  and have to start unmapping them. This also makes the -w
  option obsolete so that option now has no effect.
- Change the hash function to give a better distribution among
  the hash buckets.
- Do not make an unnecessary unlink call if the file being
  restored does not already exist.

/*
 * Copyright (c) 2000-2001 Silicon Graphics, Inc.
 * All Rights Reserved.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it would be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write the Free Software Foundation,
 * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
#ifndef NODE_H
#define NODE_H

/* node.[ch] - abstract pool of nodes
 *
 * operators alloc, free, map, and unmap nodes.
 */

typedef size32_t nh_t;
#define NH_NULL	SIZE32MAX

/* node_init - creates a new node abstraction.
 * user reserves one byte per node for use by the node abstraction
 */
extern bool_t node_init( intgen_t fd,		/* backing store */
		         off64_t off,		/* offset into backing store */
		         size_t nodesz,		/* node size */
		         ix_t nodehkix,		/* my housekeeping byte */
		         size_t alignsz,	/* node alignment requirement */
		         size64_t vmsz,		/* abstractions's share of VM */
		         size64_t dir_nondir);	/* num of dirs + nondirs */

/* node_sync - syncs up with existing node abstraction persistent state
 */
extern bool_t node_sync( intgen_t fd, off64_t off );

/* node_alloc - allocates a node, returning a handle.
 * returns NULL handle if no space left.
 */
extern nh_t node_alloc( void );

/* node_map - returns a pointer to the node identified by the node handle.
 * pointer remains valid until node_unmap called.
 */
extern void *node_map( nh_t node_handle );

/* node_unmap - unmaps the node.
 * SIDE-EFFECT: sets *nodepp to 0.
 */
extern void node_unmap( nh_t node_handle, void **nodepp );

/* node_free - frees a previously allocated node.
 * SIDE-EFFECT: sets *node_handlep to NODE_HANDLE_NULL.
 */
extern void node_free( nh_t *node_handlep );

#endif /* NODE_H */