]>
git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - copy/xfs_copy.h
2 * Copyright (c) 2000-2003,2005 Silicon Graphics, Inc.
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope that it would be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 * An on-disk allocation group header is composed of 4 structures,
21 * each of which is 1 disk sector long where the sector size is at
22 * least 512 bytes long (BBSIZE).
24 * There's one ag_header per ag and the superblock in the first ag
25 * is the contains the real data for the entire filesystem (although
26 * most of the relevant data won't change anyway even on a growfs).
28 * The filesystem superblock specifies the number of AG's and
29 * the AG size. That splits the filesystem up into N pieces,
30 * each of which is an AG and has an ag_header at the beginning.
32 typedef struct ag_header
{
33 xfs_dsb_t
*xfs_sb
; /* superblock for filesystem or AG */
34 xfs_agf_t
*xfs_agf
; /* free space info */
35 xfs_agi_t
*xfs_agi
; /* free inode info */
36 xfs_agfl_t
*xfs_agfl
; /* AG freelist */
42 * The position/buf_position, length/buf_length, data/buffer pairs
43 * exist because of alignment constraints for direct I/O and dealing
44 * with scenarios where either the source or target or both is a file
45 * and the blocksize of the filesystem where file resides is different
46 * from that of the filesystem image being duplicated. You can get
47 * alignment problems resulting from things like AG's starting on
48 * non-aligned points in the filesystem. So you have to be able
49 * to read from points "before" the requested starting point and
50 * read in more data than requested.
54 int id
; /* buffer ID */
55 size_t size
; /* size of buffer -- fixed */
56 size_t min_io_size
; /* for direct I/O */
57 int data_align
; /* data buffer alignment */
58 xfs_off_t position
; /* requested position (bytes) */
59 size_t length
; /* requested length (bytes) */
60 char *data
; /* pointer to data buffer */
61 struct t_args
*owner
; /* for non-parallel writes */
64 typedef struct t_args
{
72 pthread_mutex_t mutex
;
77 typedef int thread_id
;
78 typedef int tm_index
; /* index into thread mask array */
79 typedef __uint32_t thread_mask
; /* a thread mask */