Add ability to scrub from last scrubbed txg
[zfs.git] / include / os / linux / spl / sys / zone.h
blob5978a6285fa1f5cb5742aa8a83394d1018ad8572
1 /*
2 * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC.
3 * Copyright (C) 2007 The Regents of the University of California.
4 * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
5 * Written by Brian Behlendorf <behlendorf1@llnl.gov>.
6 * UCRL-CODE-235197
8 * This file is part of the SPL, Solaris Porting Layer.
10 * The SPL is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
15 * The SPL is distributed in the hope that it will be useful, but WITHOUT
16 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 * for more details.
20 * You should have received a copy of the GNU General Public License along
21 * with the SPL. If not, see <http://www.gnu.org/licenses/>.
24 #ifndef _SPL_ZONE_H
25 #define _SPL_ZONE_H
27 #include <sys/byteorder.h>
28 #include <sys/cred.h>
30 #include <linux/cred.h>
31 #include <linux/user_namespace.h>
34 * Attach the given dataset to the given user namespace.
36 extern int zone_dataset_attach(cred_t *, const char *, int);
39 * Detach the given dataset from the given user namespace.
41 extern int zone_dataset_detach(cred_t *, const char *, int);
44 * Returns true if the named pool/dataset is visible in the current zone.
46 extern int zone_dataset_visible(const char *dataset, int *write);
48 int spl_zone_init(void);
49 void spl_zone_fini(void);
51 extern unsigned int crgetzoneid(const cred_t *);
52 extern unsigned int global_zoneid(void);
53 extern boolean_t inglobalzone(proc_t *);
55 #define INGLOBALZONE(x) inglobalzone(x)
56 #define GLOBAL_ZONEID global_zoneid()
58 #endif /* SPL_ZONE_H */