2 * Amanda, The Advanced Maryland Automatic Network Disk Archiver
3 * Copyright (c) 2009, 2010 Zmanda, Inc. All Rights Reserved.
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 as published
7 * by the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300
19 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
27 #include "xfer-dest-taper.h"
29 /* A transfer source that reads from a Device. The device must be positioned
30 * at the start of a file before the transfer is started. The transfer will
31 * continue until the end of the file.
33 * Implemented in xfer-source-device.c
35 * @param device: Device object to read from
36 * @return: new element
38 XferElement *xfer_source_device(
41 /* A transfer destination that writes bytes to a Device. The device should have a
42 * file started, ready for a device_write_block call. On completion of the transfer,
43 * the file will be finished. If a device error occurs, the transfer will be cancelled.
45 * If cancel_at_leom is true, then the transfer will also be cancelled on LEOM, with
46 * the error message containing the string "LEOM detected" (this is used by amtapetype).
48 * Implemented in xfer-dest-device.c
50 * @param device: the Device to write to, with a file started
51 * @param canel_at_leom: if true, the element will cancel the transfer at LEOM.
52 * @return: new element
54 XferElement *xfer_dest_device(
56 gboolean canel_at_leom);
58 /* Constructor for XferDestTaperSplitter, which writes data to devices block by
59 * block and splitting parts but no caching.
61 * @param first_device: the first device that will be used with this xfer, used
62 * to calculate some internal parameters
63 * @param max_memory: total amount of memory to use for buffers, or zero
64 * for a reasonable default.
65 * @param part_size: the desired size of each part
66 * @param expect_cache_inform: TRUE if this element will get cache_inform messages
67 * @return: new element
70 xfer_dest_taper_splitter(
74 gboolean expect_cache_inform);
76 /* Constructor for XferDestTaperCacher, which writes data to devices block by
77 * block and handles caching and splitting parts.
79 * @param first_device: the first device that will be used with this xfer, used
80 * to calculate some internal parameters
81 * @param max_memory: total amount of memory to use for buffers, or zero
82 * for a reasonable default.
83 * @param part_size: the desired size of each part
84 * @param use_mem_cache: if true, use the memory cache
85 * @param disk_cache_dirname: if not NULL, this is the directory in which the disk
86 * cache should be created
87 * @return: new element
90 xfer_dest_taper_cacher(
94 gboolean use_mem_cache,
95 const char *disk_cache_dirname);
97 /* Constructor for XferDestTaperDirectTCP, which uses DirectTCP to transfer data
98 * to devices (which must support the feature).
100 * @param first_device: the first device that will be used with this xfer, used
101 * to calculate some internal parameters
102 * @param part_size: the desired size of each part
103 * @return: new element
106 xfer_dest_taper_directtcp(
107 Device *first_device,
114 /* Create a new XferSourceRecovery object. Like XferDestTaper instances, this object
115 * will not start transferring data until xfer_source_recovery_start_part is called to
116 * give the device from which the data should flow.
118 * @param first device: teh first device that will be used with this xfer
119 * @returns: new element
122 xfer_source_recovery(
123 Device *first_device);
125 /* Start an XferSourceRecovery reading from a particular, pre-positioned device
127 * @param self: XferSourceRecovery object
128 * @param device: device to read from
131 xfer_source_recovery_start_part(
135 /* Prepare to read subsequent parts from the given device. The device must
136 * not be started yet. It is not necessary to call this method for the first
137 * device used in a transfer.
139 * @param self: the XferSourceRecovery object
140 * @param device: the device
142 void xfer_source_recovery_use_device(