]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blame - repair/init.c
Update copyright/license notices to match SGI legal prefered boilerplate.
[thirdparty/xfsprogs-dev.git] / repair / init.c
CommitLineData
2bd0ea18 1/*
da23017d
NS
2 * Copyright (c) 2000-2002,2005 Silicon Graphics, Inc.
3 * All Rights Reserved.
dfc130f3 4 *
da23017d
NS
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
2bd0ea18 7 * published by the Free Software Foundation.
dfc130f3 8 *
da23017d
NS
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.
dfc130f3 13 *
da23017d
NS
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
2bd0ea18
NS
17 */
18
19#include <libxfs.h>
20#include "globals.h"
21#include "agheader.h"
22#include "protos.h"
23#include "err_protos.h"
24
25void
26xfs_init(libxfs_init_t *args)
27{
28 memset(args, 0, sizeof(libxfs_init_t));
29
30 if (isa_file) {
31 args->disfile = 1;
32 args->dname = fs_name;
33 args->volname = NULL;
34 } else {
35 args->disfile = 0;
36 args->volname = fs_name;
37 args->dname = NULL;
38 }
39
40 if (log_spec) { /* External log specified */
41 args->logname = log_name;
42 args->lisfile = (isa_file?1:0);
43 /* XXX assume data file also means log file */
44 /* REVISIT: Need to do fs sanity / log validity checking */
45 }
46
42a564ab
ES
47 if (rt_spec) { /* RT device specified */
48 args->rtname = rt_name;
49 args->risfile = (isa_file?1:0);
50 /* XXX assume data file also means rt file */
51 }
52
507f4e33 53 args->notvolmsg = _("you should never get this message - %s");
2bd0ea18 54 args->notvolok = 1;
6089b6f0 55 args->setblksize = !dangerously;
2bd0ea18
NS
56
57 if (no_modify)
58 args->isreadonly = (LIBXFS_ISREADONLY | LIBXFS_ISINACTIVE);
6089b6f0 59 else if (dangerously)
c781939c 60 args->isreadonly = (LIBXFS_ISINACTIVE | LIBXFS_DANGEROUSLY);
2bd0ea18
NS
61
62 if (!libxfs_init(args))
507f4e33 63 do_error(_("couldn't initialize XFS library\n"));
2bd0ea18 64}