2 * Copyright (c) 2004 The DragonFly Project. All rights reserved.
4 * This code is derived from software contributed to The DragonFly Project
5 * by Matthew Dillon <dillon@backplane.com>
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
17 * 3. Neither the name of The DragonFly Project nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific, prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
29 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
30 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
31 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * $DragonFly: src/sys/sys/mountctl.h,v 1.1 2004/12/24 05:00:22 dillon Exp $
38 * Data structures for the journaling API
41 #define MOUNTCTL_INSTALL_VFS_JOURNAL 1
42 #define MOUNTCTL_REMOVE_VFS_JOURNAL 2
43 #define MOUNTCTL_RESYNC_VFS_JOURNAL 3
44 #define MOUNTCTL_JOURNAL_VFS_STATUS 4
46 #define MOUNTCTL_INSTALL_BLK_JOURNAL 8
47 #define MOUNTCTL_REMOVE_BLK_JOURNAL 9
48 #define MOUNTCTL_RESYNC_BLK_JOURNAL 10
49 #define MOUNTCTL_JOURNAL_BLK_STATUS 11
51 struct mountctl_install_journal {
52 int id; /* journal identifier */
53 int flags; /* journaling flags */
54 int fd; /* streaming descriptor (-1 to close) */
56 int64_t membufsize; /* backing store */
57 int64_t swapbufsize; /* backing store */
58 int64_t transid; /* starting with specified transaction id */
60 int stallwarn; /* stall warning (seconds) */
61 int stallerror; /* stall error (seconds) */
66 #define MC_JOURNAL_REVERSABLE 0x00000001 /* reversable log */
67 #define MC_JOURNAL_BINARY 0x00000002 /* use binary format */
68 #define MC_JOURNAL_UNUSED04 0x00000004
69 #define MC_JOURNAL_STREAM_TWO_WAY 0x00000008 /* trans id ack */
70 #define MC_JOURNAL_FD_PROVIDED 0x00000100 /* stream desc */
71 #define MC_JOURNAL_MBSIZE_PROVIDED 0x00000200 /* data space */
72 #define MC_JOURNAL_SWSIZE_PROVIDED 0x00000400 /* data space */
73 #define MC_JOURNAL_TRANSID_PROVIDED 0x00000800 /* restart transid */
74 #define MC_JOURNAL_STALLWARN_PROVIDED 0x00001000 /* restart transid */
75 #define MC_JOURNAL_STALLERROR_PROVIDED 0x00002000 /* restart transid */
77 struct mountctl_remove_journal {
82 #define MC_JOURNAL_REMOVE_TRASH 0x00000001 /* data -> trash */
83 #define MC_JOURNAL_REMOVE_ASSYNC 0x00000002 /* asynchronous op */
85 struct mountctl_journal_status {
94 int64_t swapbufqueued;
96 int64_t transidcurrent;
97 int64_t transidqueued;
101 struct timeval lastack;
104 #define MC_JOURNAL_STATUS_NEXT 0x80000000 /* find next id */