]>
git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - db/io.h
29ab84a2105913a6961379da9f83845ac134d9e3
2 * Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved.
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of version 2 of the GNU General Public License as
6 * published by the Free Software Foundation.
8 * This program is distributed in the hope that it would be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 * Further, this software is distributed without any warranty that it is
13 * free of the rightful claim of any third person regarding infringement
14 * or the like. Any license provided herein, whether implied or
15 * otherwise, applies only to this software file. Patent licenses, if
16 * any, provided herein do not apply to combinations of this program with
17 * other software, or any other product whatsoever.
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write the Free Software Foundation, Inc., 59
21 * Temple Place - Suite 330, Boston MA 02111-1307, USA.
23 * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
24 * Mountain View, CA 94043, or:
28 * For further information regarding this notice, see:
30 * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
35 #define BBMAP_SIZE (XFS_MAX_BLOCKSIZE / BBSIZE)
36 typedef struct bbmap
{
37 __int64_t b
[BBMAP_SIZE
];
40 typedef struct iocur
{
41 __int64_t bb
; /* BB number in filesystem of buf */
42 int blen
; /* length of "buf", bb's */
43 int boff
; /* data - buf */
44 void *buf
; /* base address of buffer */
45 void *data
; /* current interesting data */
46 xfs_ino_t dirino
; /* current directory inode number */
47 xfs_ino_t ino
; /* current inode number */
48 int len
; /* length of "data", bytes */
49 __uint16_t mode
; /* current inode's mode */
50 xfs_off_t off
; /* fs offset of "data" in bytes */
51 const struct typ
*typ
; /* type of "data" */
52 int use_bbmap
; /* set if bbmap is valid */
53 bbmap_t bbmap
; /* map daddr if fragmented */
56 #define DB_RING_ADD 1 /* add to ring on set_cur */
57 #define DB_RING_IGN 0 /* do not add to ring on set_cur */
59 extern iocur_t
*iocur_base
; /* base of stack */
60 extern iocur_t
*iocur_top
; /* top element of stack */
61 extern int iocur_sp
; /* current top of stack */
62 extern int iocur_len
; /* length of stack array */
64 extern void io_init(void);
65 extern void off_cur(int off
, int len
);
66 extern void pop_cur(void);
67 extern void print_iocur(char *tag
, iocur_t
*ioc
);
68 extern void push_cur(void);
69 extern int read_bbs(__int64_t daddr
, int count
, void **bufp
,
71 extern int write_bbs(__int64_t daddr
, int count
, void *bufp
,
73 extern void write_cur(void);
74 extern void set_cur(const struct typ
*t
, __int64_t d
, int c
, int ring_add
,
76 extern void ring_add(void);