[BACK]Return to btblock.h CVS log [TXT][DIR] Up to [Development] / xfs-cmds / xfsprogs / db

File: [Development] / xfs-cmds / xfsprogs / db / btblock.h (download)

Revision 1.1, Fri Oct 3 04:35:04 2008 UTC (9 years ago) by bnaujok.longdrop.melbourne.sgi.com
Branch: MAIN
CVS Tags: HEAD

Consolidate btree block handling for xfs_db

Currently xfs_db has five different implementations for poking at btree
blocks, even duplicating code for btree blocks with entirely identical
layout (bmapbta vs bmapbtd and bno vs cnt).  Merge all these into
a single implementation that uses a table of btree characteristics keyed
of their magic number.

There's probably a way to further consolidate the magic arrays for the
different types, but I don't quite understand xfs_db's table driven
command parser for that.


Signed-off-by: Christoph Hellwig <hch@lst.de>
Merge of master-melb:xfs-cmds:32248a by kenmcd.

  Consolidate btree block handling for xfs_db

/*
 * Copyright (c) 2000-2001,2005 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
 */

extern const struct field	bmapbta_flds[];
extern const struct field	bmapbta_hfld[];
extern const struct field	bmapbta_key_flds[];
extern const struct field	bmapbta_rec_flds[];

extern const struct field	bmapbtd_flds[];
extern const struct field	bmapbtd_hfld[];
extern const struct field	bmapbtd_key_flds[];
extern const struct field	bmapbtd_rec_flds[];

extern const struct field	inobt_flds[];
extern const struct field	inobt_hfld[];
extern const struct field	inobt_key_flds[];
extern const struct field	inobt_rec_flds[];

extern const struct field	bnobt_flds[];
extern const struct field	bnobt_hfld[];
extern const struct field	bnobt_key_flds[];
extern const struct field	bnobt_rec_flds[];

extern const struct field	cntbt_flds[];
extern const struct field	cntbt_hfld[];
extern const struct field	cntbt_key_flds[];
extern const struct field	cntbt_rec_flds[];

extern int	btblock_size(void *obj, int startoff, int idx);