2
* Copyright (c) 2000-2003 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/
34
* An on-disk allocation group header is composed of 4 structures,
35
* each of which is 1 disk sector long where the sector size is at
36
* least 512 bytes long (BBSIZE).
38
* There's one ag_header per ag and the superblock in the first ag
39
* is the contains the real data for the entire filesystem (although
40
* most of the relevant data won't change anyway even on a growfs).
42
* The filesystem superblock specifies the number of AG's and
43
* the AG size. That splits the filesystem up into N pieces,
44
* each of which is an AG and has an ag_header at the beginning.
46
typedef struct ag_header {
47
xfs_sb_t *xfs_sb; /* superblock for filesystem or AG */
48
xfs_agf_t *xfs_agf; /* free space info */
49
xfs_agi_t *xfs_agi; /* free inode info */
50
xfs_agfl_t *xfs_agfl; /* AG freelist */
56
* The position/buf_position, length/buf_length, data/buffer pairs
57
* exist because of alignment constraints for direct I/O and dealing
58
* with scenarios where either the source or target or both is a file
59
* and the blocksize of the filesystem where file resides is different
60
* from that of the filesystem image being duplicated. You can get
61
* alignment problems resulting from things like AG's starting on
62
* non-aligned points in the filesystem. So you have to be able
63
* to read from points "before" the requested starting point and
64
* read in more data than requested.
68
int id; /* buffer ID */
69
size_t size; /* size of buffer -- fixed */
70
size_t min_io_size; /* for direct I/O */
71
xfs_off_t position; /* requested position (bytes) */
72
size_t length; /* requested length (bytes) */
73
char *data; /* pointer to data buffer */
74
struct t_args *owner; /* for non-parallel writes */
77
typedef struct t_args {
85
pthread_mutex_t mutex;
90
typedef int thread_id;
91
typedef int tm_index; /* index into thread mask array */
92
typedef __uint32_t thread_mask; /* a thread mask */