1235537Sgber/*-
2235537Sgber * Copyright (c) 2010-2012 Semihalf.
3235537Sgber * All rights reserved.
4235537Sgber *
5235537Sgber * Redistribution and use in source and binary forms, with or without
6235537Sgber * modification, are permitted provided that the following conditions
7235537Sgber * are met:
8235537Sgber * 1. Redistributions of source code must retain the above copyright
9235537Sgber *    notice, this list of conditions and the following disclaimer.
10235537Sgber * 2. Redistributions in binary form must reproduce the above copyright
11235537Sgber *    notice, this list of conditions and the following disclaimer in the
12235537Sgber *    documentation and/or other materials provided with the distribution.
13235537Sgber *
14235537Sgber * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15235537Sgber * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16235537Sgber * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17235537Sgber * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18235537Sgber * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19235537Sgber * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20235537Sgber * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21235537Sgber * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22235537Sgber * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23235537Sgber * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24235537Sgber * SUCH DAMAGE.
25235537Sgber *
26235537Sgber * $FreeBSD$
27235537Sgber */
28235537Sgber
29235537Sgber#ifndef	_LIBNANDFS_NANDFS_H
30235537Sgber#define	_LIBNANDFS_NANDFS_H
31235537Sgber
32235537Sgberstruct nandfs {
33235537Sgber	struct nandfs_fsdata		n_fsdata;
34235537Sgber	struct nandfs_super_block	n_sb;
35235537Sgber	char				n_ioc[MNAMELEN];
36235537Sgber	char				n_dev[MNAMELEN];
37235537Sgber	int				n_iocfd;
38235537Sgber	int				n_devfd;
39235537Sgber	int				n_flags;
40235537Sgber	char				n_errmsg[120];
41235537Sgber};
42235537Sgber
43235537Sgberint nandfs_iserror(struct nandfs *);
44235537Sgberconst char *nandfs_errmsg(struct nandfs *);
45235537Sgber
46235537Sgbervoid nandfs_init(struct nandfs *, const char *);
47235537Sgbervoid nandfs_destroy(struct nandfs *);
48235537Sgber
49235537Sgberconst char *nandfs_dev(struct nandfs *);
50235537Sgber
51235537Sgberint nandfs_open(struct nandfs *);
52235537Sgbervoid nandfs_close(struct nandfs *);
53235537Sgber
54235537Sgberint nandfs_get_cpstat(struct nandfs *, struct nandfs_cpstat *);
55235537Sgber
56235537Sgberssize_t nandfs_get_cp(struct nandfs *, uint64_t,
57235537Sgber    struct nandfs_cpinfo *, size_t);
58235537Sgber
59235537Sgberssize_t nandfs_get_snap(struct nandfs *, uint64_t,
60235537Sgber    struct nandfs_cpinfo *, size_t);
61235537Sgber
62235537Sgberint nandfs_make_snap(struct nandfs *, uint64_t *);
63235537Sgberint nandfs_delete_snap(struct nandfs *, uint64_t);
64235537Sgber
65235537Sgber#endif	/* _LIBNANDFS_NANDFS_H */
66