FreeBSD ZFS
The Zettabyte File System
Data Structures | Defines | Typedefs | Enumerations | Functions | Variables

zfs_ioctl.c File Reference

#include <sys/types.h>
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/conf.h>
#include <sys/kernel.h>
#include <sys/lock.h>
#include <sys/malloc.h>
#include <sys/mutex.h>
#include <sys/proc.h>
#include <sys/errno.h>
#include <sys/uio.h>
#include <sys/buf.h>
#include <sys/file.h>
#include <sys/kmem.h>
#include <sys/cmn_err.h>
#include <sys/stat.h>
#include <sys/zfs_ioctl.h>
#include <sys/zfs_vfsops.h>
#include <sys/zfs_znode.h>
#include <sys/zap.h>
#include <sys/spa.h>
#include <sys/spa_impl.h>
#include <sys/vdev.h>
#include <sys/dmu.h>
#include <sys/dsl_dir.h>
#include <sys/dsl_dataset.h>
#include <sys/dsl_prop.h>
#include <sys/dsl_deleg.h>
#include <sys/dmu_objset.h>
#include <sys/dmu_impl.h>
#include <sys/sunddi.h>
#include <sys/policy.h>
#include <sys/zone.h>
#include <sys/nvpair.h>
#include <sys/mount.h>
#include <sys/taskqueue.h>
#include <sys/sdt.h>
#include <sys/varargs.h>
#include <sys/fs/zfs.h>
#include <sys/zfs_ctldir.h>
#include <sys/zfs_dir.h>
#include <sys/zfs_onexit.h>
#include <sys/zvol.h>
#include <sys/dsl_scan.h>
#include "zfs_namecheck.h"
#include "zfs_prop.h"
#include "zfs_deleg.h"
#include "zfs_comutil.h"
#include "zfs_ioctl_compat.h"
Include dependency graph for zfs_ioctl.c:

Go to the source code of this file.

Data Structures

struct  zfs_ioc_vec

Defines

#define ZFS_PROP_UNDEFINED   ((uint64_t)-1)

Typedefs

typedef int zfs_ioc_func_t (zfs_cmd_t *)
typedef int zfs_secpolicy_func_t (zfs_cmd_t *, cred_t *)
typedef struct zfs_ioc_vec zfs_ioc_vec_t

Enumerations

enum  zfs_ioc_namecheck_t { NO_NAME, POOL_NAME, DATASET_NAME }

Functions

 CTASSERT (sizeof(zfs_cmd_t)< IOCPARM_MAX)
 SYSCTL_DECL (_vfs_zfs)
 TUNABLE_INT ("vfs.zfs.snapshot_list_prefetch",&snapshot_list_prefetch)
 SYSCTL_INT (_vfs_zfs, OID_AUTO, snapshot_list_prefetch, CTLFLAG_RW,&snapshot_list_prefetch, 0,"Prefetch data when listing snapshots")
void zfs_init (void)
void zfs_fini (void)
static int zfs_ioc_userspace_upgrade (zfs_cmd_t *zc)
 inputs:

  • zc_name name of filesystem

static int zfs_check_settable (const char *name, nvpair_t *property, cred_t *cr)
static int zfs_check_clearable (char *dataset, nvlist_t *props, nvlist_t **errlist)
 Removes properties from the given props list that fail permission checks needed to clear them and to restore them in case of a receive error.
static int zfs_fill_zplprops_root (uint64_t, nvlist_t *, nvlist_t *, boolean_t *)
int zfs_set_prop_nvlist (const char *dsname, zprop_source_t source, nvlist_t *nvl, nvlist_t **errlist)
 This function is best effort.
static void zfsdev_close (void *data)
void __dprintf (const char *file, const char *func, int line, const char *fmt,...)
static void history_str_free (char *buf)
static char * history_str_get (zfs_cmd_t *zc)
static boolean_t zfs_is_bootfs (const char *name)
 Check to see if the named dataset is currently defined as bootable.
static int zfs_earlier_version (const char *name, int version)
static boolean_t zpl_earlier_version (const char *name, int version)
static void zfs_log_history (zfs_cmd_t *zc)
static int zfs_secpolicy_none (zfs_cmd_t *zc, cred_t *cr)
 Policy for top-level read operations (list pools).
static int zfs_secpolicy_read (zfs_cmd_t *zc, cred_t *cr)
 Policy for dataset read operations (list children, get statistics).
static int zfs_dozonecheck_impl (const char *dataset, uint64_t zoned, cred_t *cr)
static int zfs_dozonecheck (const char *dataset, cred_t *cr)
static int zfs_dozonecheck_ds (const char *dataset, dsl_dataset_t *ds, cred_t *cr)
int zfs_secpolicy_write_perms (const char *name, const char *perm, cred_t *cr)
int zfs_secpolicy_write_perms_ds (const char *name, dsl_dataset_t *ds, const char *perm, cred_t *cr)
static int zfs_secpolicy_setprop (const char *dsname, zfs_prop_t prop, nvpair_t *propval, cred_t *cr)
int zfs_secpolicy_fsacl (zfs_cmd_t *zc, cred_t *cr)
int zfs_secpolicy_rollback (zfs_cmd_t *zc, cred_t *cr)
int zfs_secpolicy_send (zfs_cmd_t *zc, cred_t *cr)
static int zfs_secpolicy_deleg_share (zfs_cmd_t *zc, cred_t *cr)
int zfs_secpolicy_share (zfs_cmd_t *zc, cred_t *cr)
int zfs_secpolicy_smb_acl (zfs_cmd_t *zc, cred_t *cr)
static int zfs_get_parent (const char *datasetname, char *parent, int parentsize)
int zfs_secpolicy_destroy_perms (const char *name, cred_t *cr)
static int zfs_secpolicy_destroy (zfs_cmd_t *zc, cred_t *cr)
static int zfs_secpolicy_destroy_recursive (zfs_cmd_t *zc, cred_t *cr)
 Destroying snapshots with delegated permissions requires descendent mount and destroy permissions.
int zfs_secpolicy_rename_perms (const char *from, const char *to, cred_t *cr)
static int zfs_secpolicy_rename (zfs_cmd_t *zc, cred_t *cr)
static int zfs_secpolicy_promote (zfs_cmd_t *zc, cred_t *cr)
static int zfs_secpolicy_receive (zfs_cmd_t *zc, cred_t *cr)
int zfs_secpolicy_snapshot_perms (const char *name, cred_t *cr)
static int zfs_secpolicy_snapshot (zfs_cmd_t *zc, cred_t *cr)
static int zfs_secpolicy_create (zfs_cmd_t *zc, cred_t *cr)
static int zfs_secpolicy_umount (zfs_cmd_t *zc, cred_t *cr)
static int zfs_secpolicy_config (zfs_cmd_t *zc, cred_t *cr)
 Policy for pool operations - create/destroy pools, add vdevs, etc.
static int zfs_secpolicy_diff (zfs_cmd_t *zc, cred_t *cr)
 Policy for object to name lookups.
static int zfs_secpolicy_inject (zfs_cmd_t *zc, cred_t *cr)
 Policy for fault injection.
static int zfs_secpolicy_inherit (zfs_cmd_t *zc, cred_t *cr)
static int zfs_secpolicy_userspace_one (zfs_cmd_t *zc, cred_t *cr)
static int zfs_secpolicy_userspace_many (zfs_cmd_t *zc, cred_t *cr)
static int zfs_secpolicy_userspace_upgrade (zfs_cmd_t *zc, cred_t *cr)
static int zfs_secpolicy_hold (zfs_cmd_t *zc, cred_t *cr)
static int zfs_secpolicy_release (zfs_cmd_t *zc, cred_t *cr)
static int zfs_secpolicy_tmp_snapshot (zfs_cmd_t *zc, cred_t *cr)
 Policy for allowing temporary snapshots to be taken or released.
static int get_nvlist (uint64_t nvl, uint64_t size, int iflag, nvlist_t **nvp)
 Returns the nvlist as specified by the user in the zfs_cmd_t.
static int fit_error_list (zfs_cmd_t *zc, nvlist_t **errors)
static int put_nvlist (zfs_cmd_t *zc, nvlist_t *nvl)
static int getzfsvfs (const char *dsname, zfsvfs_t **zfvp)
static int zfsvfs_hold (const char *name, void *tag, zfsvfs_t **zfvp, boolean_t writer)
 Find a zfsvfs_t for a mounted filesystem, or create our own, in which case its z_vfs will be NULL, and it will be opened as the owner.
static void zfsvfs_rele (zfsvfs_t *zfsvfs, void *tag)
static int zfs_ioc_pool_create (zfs_cmd_t *zc)
static int zfs_ioc_pool_destroy (zfs_cmd_t *zc)
static int zfs_ioc_pool_import (zfs_cmd_t *zc)
static int zfs_ioc_pool_export (zfs_cmd_t *zc)
static int zfs_ioc_pool_configs (zfs_cmd_t *zc)
static int zfs_ioc_pool_stats (zfs_cmd_t *zc)
static int zfs_ioc_pool_tryimport (zfs_cmd_t *zc)
 Try to import the given pool, returning pool stats as appropriate so that user land knows which devices are available and overall pool health.
static int zfs_ioc_pool_scan (zfs_cmd_t *zc)
 inputs:

  • zc_name name of the pool
  • zc_cookie scan func (pool_scan_func_t)

static int zfs_ioc_pool_freeze (zfs_cmd_t *zc)
static int zfs_ioc_pool_upgrade (zfs_cmd_t *zc)
static int zfs_ioc_pool_get_history (zfs_cmd_t *zc)
static int zfs_ioc_pool_reguid (zfs_cmd_t *zc)
static int zfs_ioc_dsobj_to_dsname (zfs_cmd_t *zc)
static int zfs_ioc_obj_to_path (zfs_cmd_t *zc)
 inputs:

  • zc_name name of filesystem
  • zc_obj object to find

static int zfs_ioc_obj_to_stats (zfs_cmd_t *zc)
 inputs:

  • zc_name name of filesystem
  • zc_obj object to find

static int zfs_ioc_vdev_add (zfs_cmd_t *zc)
static int zfs_ioc_vdev_remove (zfs_cmd_t *zc)
 inputs:

  • zc_name name of the pool
  • zc_nvlist_conf nvlist of devices to remove
  • zc_cookie to stop the remove?

static int zfs_ioc_vdev_set_state (zfs_cmd_t *zc)
static int zfs_ioc_vdev_attach (zfs_cmd_t *zc)
static int zfs_ioc_vdev_detach (zfs_cmd_t *zc)
static int zfs_ioc_vdev_split (zfs_cmd_t *zc)
static int zfs_ioc_vdev_setpath (zfs_cmd_t *zc)
static int zfs_ioc_vdev_setfru (zfs_cmd_t *zc)
static int zfs_ioc_objset_stats_impl (zfs_cmd_t *zc, objset_t *os)
static int zfs_ioc_objset_stats (zfs_cmd_t *zc)
 inputs:

  • zc_name name of filesystem
  • zc_nvlist_dst_size size of buffer for property nvlist

static int zfs_ioc_objset_recvd_props (zfs_cmd_t *zc)
 Gets received properties (distinct from local properties on or after SPA_VERSION_RECVD_PROPS) for callers who want to differentiate received from local property values.
static int nvl_add_zplprop (objset_t *os, nvlist_t *props, zfs_prop_t prop)
static int zfs_ioc_objset_zplprops (zfs_cmd_t *zc)
 inputs:

  • zc_name name of filesystem
  • zc_nvlist_dst_size size of buffer for zpl property nvlist

boolean_t dataset_name_hidden (const char *name)
static int zfs_ioc_dataset_list_next (zfs_cmd_t *zc)
 inputs:

  • zc_name name of filesystem
  • zc_cookie zap cursor
  • zc_nvlist_dst_size size of buffer for property nvlist

static int zfs_ioc_snapshot_list_next (zfs_cmd_t *zc)
 inputs: zc_name name of filesystem zc_cookie zap cursor zc_nvlist_dst_size size of buffer for property nvlist zc_simple when set, only name is requested
static int zfs_prop_set_userquota (const char *dsname, nvpair_t *pair)
static int zfs_prop_set_special (const char *dsname, zprop_source_t source, nvpair_t *pair)
 If the named property is one that has a special function to set its value, return 0 on success and a positive error code on failure; otherwise if it is not one of the special properties handled by this function, return -1.
static int zfs_check_userprops (char *fsname, nvlist_t *nvl)
 Check that all the properties are valid user properties.
static void props_skip (nvlist_t *props, nvlist_t *skipped, nvlist_t **newprops)
static int clear_received_props (objset_t *os, const char *fs, nvlist_t *props, nvlist_t *skipped)
static int zfs_ioc_set_prop (zfs_cmd_t *zc)
 inputs:

  • zc_name name of filesystem
  • zc_value name of property to set
  • zc_nvlist_src{_size} nvlist of properties to apply
  • zc_cookie received properties flag

static int zfs_ioc_inherit_prop (zfs_cmd_t *zc)
 inputs:

  • zc_name name of filesystem
  • zc_value name of property to inherit
  • zc_cookie revert to received value if TRUE

static int zfs_ioc_pool_set_props (zfs_cmd_t *zc)
static int zfs_ioc_pool_get_props (zfs_cmd_t *zc)
static int zfs_ioc_set_fsacl (zfs_cmd_t *zc)
 inputs:

  • zc_name name of filesystem
  • zc_nvlist_src{_size} nvlist of delegated permissions
  • zc_perm_action allow/unallow flag

static int zfs_ioc_get_fsacl (zfs_cmd_t *zc)
 inputs:

  • zc_name name of filesystem

static vfs_t * zfs_get_vfs (const char *resource)
 Search the vfs list for a specified resource.
static void zfs_create_cb (objset_t *os, void *arg, cred_t *cr, dmu_tx_t *tx)
static int zfs_fill_zplprops_impl (objset_t *os, uint64_t zplver, boolean_t fuids_ok, boolean_t sa_ok, nvlist_t *createprops, nvlist_t *zplprops, boolean_t *is_ci)
 Determine the settings for utf8only, normalization and casesensitivity.
static int zfs_fill_zplprops (const char *dataset, nvlist_t *createprops, nvlist_t *zplprops, boolean_t *is_ci)
static int zfs_ioc_create (zfs_cmd_t *zc)
 inputs:

  • zc_objset_type type of objset to create (fs vs zvol)
  • zc_name name of new objset
  • zc_value name of snapshot to clone from (may be empty)
  • zc_nvlist_src{_size} nvlist of properties to apply

static int zfs_ioc_snapshot (zfs_cmd_t *zc)
 inputs:

  • zc_name name of filesystem
  • zc_value short name of snapshot
  • zc_cookie recursive flag
  • zc_nvlist_src[_size] property list

int zfs_unmount_snap (const char *name, void *arg)
static int zfs_ioc_destroy_snaps_nvl (zfs_cmd_t *zc)
 inputs:

  • zc_name name of filesystem, snaps must be under it
  • zc_nvlist_src[_size] full names of snapshots to destroy
  • zc_defer_destroy mark for deferred destroy

static int zfs_ioc_destroy (zfs_cmd_t *zc)
 inputs:

  • zc_name name of dataset to destroy
  • zc_objset_type type of objset
  • zc_defer_destroy mark for deferred destroy

static int zfs_ioc_rollback (zfs_cmd_t *zc)
 inputs:

  • zc_name name of dataset to rollback (to most recent snapshot)

static int zfs_ioc_rename (zfs_cmd_t *zc)
 inputs:

  • zc_name old name of dataset
  • zc_value new name of dataset
  • zc_cookie recursive flag (only valid for snapshots)

static boolean_t propval_equals (nvpair_t *p1, nvpair_t *p2)
static void props_reduce (nvlist_t *props, nvlist_t *origprops)
 Remove properties from props if they are not going to change (as determined by comparison with origprops).
static int zfs_ioc_recv (zfs_cmd_t *zc)
 inputs:

  • zc_name name of containing filesystem
  • zc_nvlist_src{_size} nvlist of properties to apply
  • zc_value name of snapshot to create
  • zc_string name of clone origin (if DRR_FLAG_CLONE)
  • zc_cookie file descriptor to recv from
  • zc_begin_record the BEGIN record of the stream (not byteswapped)
  • zc_guid force flag
  • zc_cleanup_fd cleanup-on-exit file descriptor
  • zc_action_handle handle for this guid/ds mapping (or zero on first call)

static int zfs_ioc_send (zfs_cmd_t *zc)
 inputs:

  • zc_name name of snapshot to send
  • zc_cookie file descriptor to send stream to
  • zc_obj fromorigin flag (mutually exclusive with zc_fromobj)
  • zc_sendobj objsetid of snapshot to send
  • zc_fromobj objsetid of incremental fromsnap (may be zero)
  • zc_guid if set, estimate size of stream only.

static int zfs_ioc_send_progress (zfs_cmd_t *zc)
static int zfs_ioc_inject_fault (zfs_cmd_t *zc)
static int zfs_ioc_clear_fault (zfs_cmd_t *zc)
static int zfs_ioc_inject_list_next (zfs_cmd_t *zc)
static int zfs_ioc_error_log (zfs_cmd_t *zc)
static int zfs_ioc_clear (zfs_cmd_t *zc)
static int zfs_ioc_pool_reopen (zfs_cmd_t *zc)
static int zfs_ioc_promote (zfs_cmd_t *zc)
 inputs:

  • zc_name name of filesystem
  • zc_value name of origin snapshot

static int zfs_ioc_userspace_one (zfs_cmd_t *zc)
 Retrieve a single {user|group}{used|quota}@...
static int zfs_ioc_userspace_many (zfs_cmd_t *zc)
 inputs:

  • zc_name name of filesystem
  • zc_cookie zap cursor
  • zc_objset_type zfs_userquota_prop_t
  • zc_nvlist_dst[_size] buffer to fill (not really an nvlist)

static int zfs_ioc_share (zfs_cmd_t *zc)
static int zfs_ioc_next_obj (zfs_cmd_t *zc)
 inputs:

  • zc_name name of containing filesystem
  • zc_obj object # beyond which we want next in-use object #

static int zfs_ioc_tmp_snapshot (zfs_cmd_t *zc)
 inputs:

  • zc_name name of filesystem
  • zc_value prefix name for snapshot
  • zc_cleanup_fd cleanup-on-exit file descriptor for calling process

static int zfs_ioc_diff (zfs_cmd_t *zc)
 inputs:

  • zc_name name of "to" snapshot
  • zc_value name of "from" snapshot
  • zc_cookie file descriptor to write diff data on

static int zfs_ioc_smb_acl (zfs_cmd_t *zc)
static int zfs_ioc_hold (zfs_cmd_t *zc)
 inputs:

  • zc_name name of filesystem
  • zc_value short name of snap
  • zc_string user-supplied tag for this hold
  • zc_cookie recursive flag
  • zc_temphold set if hold is temporary
  • zc_cleanup_fd cleanup-on-exit file descriptor for calling process
  • zc_sendobj if non-zero, the objid for zc_name
  • zc_createtxg if zc_sendobj is non-zero, snap must have zc_createtxg

static int zfs_ioc_release (zfs_cmd_t *zc)
 inputs:

  • zc_name name of dataset from which we're releasing a user hold
  • zc_value short name of snap
  • zc_string user-supplied tag for this hold
  • zc_cookie recursive flag

static int zfs_ioc_get_holds (zfs_cmd_t *zc)
 inputs:

  • zc_name name of filesystem

static int zfs_ioc_space_written (zfs_cmd_t *zc)
 inputs:

  • zc_name name of new filesystem or snapshot
  • zc_value full name of old snapshot

static int zfs_ioc_space_snaps (zfs_cmd_t *zc)
static int zfs_ioc_jail (zfs_cmd_t *zc)
 pool create, destroy, and export don't log the history as part of zfsdev_ioctl, but rather zfs_ioc_pool_create, and zfs_ioc_pool_export do the logging of those commands.
static int zfs_ioc_unjail (zfs_cmd_t *zc)
int pool_status_check (const char *name, zfs_ioc_namecheck_t type)
minor_t zfsdev_minor_alloc (void)
 Find a free minor number.
static int zfs_ctldev_init (struct cdev *devp)
static void zfs_ctldev_destroy (zfs_onexit_t *zo, minor_t minor)
void * zfsdev_get_soft_state (minor_t minor, enum zfs_soft_state_type which)
static int zfsdev_open (struct cdev *devp, int flag, int mode, struct thread *td)
static int zfsdev_ioctl (struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
static void zfsdev_init (void)
static void zfsdev_fini (void)
static int zfs_modevent (module_t mod, int type, void *unused __unused)
 DECLARE_MODULE (zfsctrl, zfs_mod, SI_SUB_VFS, SI_ORDER_ANY)
 MODULE_DEPEND (zfsctrl, opensolaris, 1, 1, 1)
 MODULE_DEPEND (zfsctrl, krpc, 1, 1, 1)
 MODULE_DEPEND (zfsctrl, acl_nfs4, 1, 1, 1)

Variables

static int snapshot_list_prefetch
static struct cdev * zfsdev
static const char * userquota_perms []
 This array is indexed by zfs_userquota_prop_t.
kmutex_t zfs_share_lock
ace_t full_access []
static zfs_ioc_vec_t zfs_ioc_vec []
static struct cdevsw zfs_cdevsw
static struct root_hold_token * zfs_root_token
struct proc * zfsproc
uint_t zfs_fsyncer_key
uint_t rrw_tsd_key
 global key for TSD
static moduledata_t zfs_mod

Define Documentation

#define ZFS_PROP_UNDEFINED   ((uint64_t)-1)

Definition at line 2812 of file zfs_ioctl.c.


Typedef Documentation

typedef int zfs_ioc_func_t(zfs_cmd_t *)

Definition at line 98 of file zfs_ioctl.c.

typedef struct zfs_ioc_vec zfs_ioc_vec_t
typedef int zfs_secpolicy_func_t(zfs_cmd_t *, cred_t *)

Definition at line 99 of file zfs_ioctl.c.


Enumeration Type Documentation

Enumerator:
NO_NAME 
POOL_NAME 
DATASET_NAME 

Definition at line 101 of file zfs_ioctl.c.


Function Documentation

void __dprintf ( const char *  file,
const char *  func,
int  line,
const char *  fmt,
  ... 
)

Definition at line 136 of file zfs_ioctl.c.

static int clear_received_props ( objset_t os,
const char *  fs,
nvlist_t *  props,
nvlist_t *  skipped 
) [static]

Definition at line 2490 of file zfs_ioctl.c.

CTASSERT ( )
boolean_t dataset_name_hidden ( const char *  name)

Definition at line 1975 of file zfs_ioctl.c.

DECLARE_MODULE ( zfsctrl  ,
zfs_mod  ,
SI_SUB_VFS  ,
SI_ORDER_ANY   
)
static int fit_error_list ( zfs_cmd_t zc,
nvlist_t **  errors 
) [static]

Definition at line 1080 of file zfs_ioctl.c.

static int get_nvlist ( uint64_t  nvl,
uint64_t  size,
int  iflag,
nvlist_t **  nvp 
) [static]

Returns the nvlist as specified by the user in the zfs_cmd_t.

Definition at line 1048 of file zfs_ioctl.c.

static int getzfsvfs ( const char *  dsname,
zfsvfs_t **  zfvp 
) [static]

Definition at line 1148 of file zfs_ioctl.c.

static void history_str_free ( char *  buf) [static]

Definition at line 171 of file zfs_ioctl.c.

static char* history_str_get ( zfs_cmd_t zc) [static]

Definition at line 177 of file zfs_ioctl.c.

MODULE_DEPEND ( zfsctrl  ,
opensolaris  ,
,
,
 
)
MODULE_DEPEND ( zfsctrl  ,
krpc  ,
,
,
 
)
MODULE_DEPEND ( zfsctrl  ,
acl_nfs4  ,
,
,
 
)
static int nvl_add_zplprop ( objset_t os,
nvlist_t *  props,
zfs_prop_t  prop 
) [static]

Definition at line 1914 of file zfs_ioctl.c.

int pool_status_check ( const char *  name,
zfs_ioc_namecheck_t  type 
)

Definition at line 5056 of file zfs_ioctl.c.

static void props_reduce ( nvlist_t *  props,
nvlist_t *  origprops 
) [static]

Remove properties from props if they are not going to change (as determined by comparison with origprops).

Remove them from origprops as well, since we do not need to clear or restore properties that won't change.

Definition at line 3621 of file zfs_ioctl.c.

static void props_skip ( nvlist_t *  props,
nvlist_t *  skipped,
nvlist_t **  newprops 
) [static]

Definition at line 2474 of file zfs_ioctl.c.

static boolean_t propval_equals ( nvpair_t *  p1,
nvpair_t *  p2 
) [static]

Definition at line 3580 of file zfs_ioctl.c.

static int put_nvlist ( zfs_cmd_t zc,
nvlist_t *  nvl 
) [static]

Definition at line 1115 of file zfs_ioctl.c.

SYSCTL_DECL ( _vfs_zfs  )
SYSCTL_INT ( _vfs_zfs  ,
OID_AUTO  ,
snapshot_list_prefetch  ,
CTLFLAG_RW  ,
snapshot_list_prefetch,
,
"Prefetch data when listing snapshots"   
)
TUNABLE_INT ( "vfs.zfs.snapshot_list_prefetch"  ,
snapshot_list_prefetch 
)
static int zfs_check_clearable ( char *  dataset,
nvlist_t *  props,
nvlist_t **  errlist 
) [static]

Removes properties from the given props list that fail permission checks needed to clear them and to restore them in case of a receive error.

For each property, make sure we have both set and inherit permissions.

Returns the first error encountered if any permission checks fail. If the caller provides a non-NULL errlist, it also gives the complete list of names of all the properties that failed a permission check along with the corresponding error numbers. The caller is responsible for freeing the returned errlist.

If every property checks out successfully, zero is returned and the list pointed at by errlist is NULL.

Definition at line 3535 of file zfs_ioctl.c.

static int zfs_check_settable ( const char *  name,
nvpair_t *  property,
cred_t *  cr 
) [static]

Definition at line 3397 of file zfs_ioctl.c.

static int zfs_check_userprops ( char *  fsname,
nvlist_t *  nvl 
) [static]

Check that all the properties are valid user properties.

Definition at line 2446 of file zfs_ioctl.c.

static void zfs_create_cb ( objset_t os,
void *  arg,
cred_t *  cr,
dmu_tx_t tx 
) [static]

Definition at line 2805 of file zfs_ioctl.c.

static void zfs_ctldev_destroy ( zfs_onexit_t zo,
minor_t  minor 
) [static]

Definition at line 5120 of file zfs_ioctl.c.

static int zfs_ctldev_init ( struct cdev *  devp) [static]

Definition at line 5096 of file zfs_ioctl.c.

static int zfs_dozonecheck ( const char *  dataset,
cred_t *  cr 
) [static]

Definition at line 333 of file zfs_ioctl.c.

static int zfs_dozonecheck_ds ( const char *  dataset,
dsl_dataset_t ds,
cred_t *  cr 
) [static]

Definition at line 344 of file zfs_ioctl.c.

static int zfs_dozonecheck_impl ( const char *  dataset,
uint64_t  zoned,
cred_t *  cr 
) [static]

Definition at line 299 of file zfs_ioctl.c.

static int zfs_earlier_version ( const char *  name,
int  version 
) [static]
Returns:
non-zero if the spa version is less than requested version.

Definition at line 217 of file zfs_ioctl.c.

static int zfs_fill_zplprops ( const char *  dataset,
nvlist_t *  createprops,
nvlist_t *  zplprops,
boolean_t *  is_ci 
) [static]

Definition at line 2911 of file zfs_ioctl.c.

static int zfs_fill_zplprops_impl ( objset_t os,
uint64_t  zplver,
boolean_t  fuids_ok,
boolean_t  sa_ok,
nvlist_t *  createprops,
nvlist_t *  zplprops,
boolean_t *  is_ci 
) [static]

Determine the settings for utf8only, normalization and casesensitivity.

Specific values may have been requested by the creator and/or we can inherit values from the parent dataset. If the file system is of too early a vintage, a creator can not request settings for these properties, even if the requested setting is the default value. We don't actually want to create dsl properties for these, so remove them from the source nvlist after processing.

Parameters:
[in]osparent objset pointer (NULL if root fs)
[in]oszpl version to use if unspecified in createprops
[in]osfuids allowed in this version of the spa?
[in]oslist of properties requested by creator
[out]zplpropsvalues for the zplprops we attach to the master node object
[out]is_citrue if requested file system will be purely case-insensitive

Definition at line 2834 of file zfs_ioctl.c.

static int zfs_fill_zplprops_root ( uint64_t  spa_vers,
nvlist_t *  createprops,
nvlist_t *  zplprops,
boolean_t *  is_ci 
) [static]

Definition at line 2951 of file zfs_ioctl.c.

void zfs_fini ( void  )

Definition at line 2337 of file zfs_vfsops.c.

static int zfs_get_parent ( const char *  datasetname,
char *  parent,
int  parentsize 
) [static]

Definition at line 673 of file zfs_ioctl.c.

static vfs_t* zfs_get_vfs ( const char *  resource) [static]

Search the vfs list for a specified resource.

Returns a pointer to it or NULL if no suitable entry is found. The caller of this routine is responsible for releasing the returned vfs pointer.

Definition at line 2788 of file zfs_ioctl.c.

void zfs_init ( void  )

Definition at line 2311 of file zfs_vfsops.c.

static int zfs_ioc_clear ( zfs_cmd_t zc) [static]

Definition at line 4077 of file zfs_ioctl.c.

static int zfs_ioc_clear_fault ( zfs_cmd_t zc) [static]

Definition at line 4035 of file zfs_ioctl.c.

static int zfs_ioc_create ( zfs_cmd_t zc) [static]

inputs:

  • zc_objset_type type of objset to create (fs vs zvol)
  • zc_name name of new objset
  • zc_value name of snapshot to clone from (may be empty)
  • zc_nvlist_src{_size} nvlist of properties to apply

outputs: none

Definition at line 2978 of file zfs_ioctl.c.

static int zfs_ioc_dataset_list_next ( zfs_cmd_t zc) [static]

inputs:

  • zc_name name of filesystem
  • zc_cookie zap cursor
  • zc_nvlist_dst_size size of buffer for property nvlist

outputs:

  • zc_name name of next filesystem
  • zc_cookie zap cursor
  • zc_objset_stats stats
  • zc_nvlist_dst property nvlist
  • zc_nvlist_dst_size size of property nvlist

Definition at line 2005 of file zfs_ioctl.c.

static int zfs_ioc_destroy ( zfs_cmd_t zc) [static]

inputs:

  • zc_name name of dataset to destroy
  • zc_objset_type type of objset
  • zc_defer_destroy mark for deferred destroy

outputs: none

Definition at line 3259 of file zfs_ioctl.c.

static int zfs_ioc_destroy_snaps_nvl ( zfs_cmd_t zc) [static]

inputs:

  • zc_name name of filesystem, snaps must be under it
  • zc_nvlist_src[_size] full names of snapshots to destroy
  • zc_defer_destroy mark for deferred destroy

outputs:

  • zc_name on failure, name of failed snapshot

Definition at line 3199 of file zfs_ioctl.c.

static int zfs_ioc_diff ( zfs_cmd_t zc) [static]

inputs:

  • zc_name name of "to" snapshot
  • zc_value name of "from" snapshot
  • zc_cookie file descriptor to write diff data on

outputs:

  • dmu_diff_record_t's to the file descriptor

Definition at line 4534 of file zfs_ioctl.c.

static int zfs_ioc_dsobj_to_dsname ( zfs_cmd_t zc) [static]

Definition at line 1531 of file zfs_ioctl.c.

static int zfs_ioc_error_log ( zfs_cmd_t zc) [static]

Definition at line 4055 of file zfs_ioctl.c.

static int zfs_ioc_get_fsacl ( zfs_cmd_t zc) [static]

inputs:

  • zc_name name of filesystem

outputs:

  • zc_nvlist_src{_size} nvlist of delegated permissions

Definition at line 2769 of file zfs_ioctl.c.

static int zfs_ioc_get_holds ( zfs_cmd_t zc) [static]

inputs:

  • zc_name name of filesystem

outputs:

  • zc_nvlist_src{_size} nvlist of snapshot holds

Definition at line 4835 of file zfs_ioctl.c.

static int zfs_ioc_hold ( zfs_cmd_t zc) [static]

inputs:

  • zc_name name of filesystem
  • zc_value short name of snap
  • zc_string user-supplied tag for this hold
  • zc_cookie recursive flag
  • zc_temphold set if hold is temporary
  • zc_cleanup_fd cleanup-on-exit file descriptor for calling process
  • zc_sendobj if non-zero, the objid for zc_name
  • zc_createtxg if zc_sendobj is non-zero, snap must have zc_createtxg

outputs: none

Definition at line 4741 of file zfs_ioctl.c.

static int zfs_ioc_inherit_prop ( zfs_cmd_t zc) [static]

inputs:

  • zc_name name of filesystem
  • zc_value name of property to inherit
  • zc_cookie revert to received value if TRUE

outputs: none

Definition at line 2569 of file zfs_ioctl.c.

static int zfs_ioc_inject_fault ( zfs_cmd_t zc) [static]

Definition at line 4021 of file zfs_ioctl.c.

static int zfs_ioc_inject_list_next ( zfs_cmd_t zc) [static]

Definition at line 4041 of file zfs_ioctl.c.

static int zfs_ioc_jail ( zfs_cmd_t zc) [static]

pool create, destroy, and export don't log the history as part of zfsdev_ioctl, but rather zfs_ioc_pool_create, and zfs_ioc_pool_export do the logging of those commands.

Definition at line 4918 of file zfs_ioctl.c.

static int zfs_ioc_next_obj ( zfs_cmd_t zc) [static]

inputs:

  • zc_name name of containing filesystem
  • zc_obj object # beyond which we want next in-use object #

outputs:

  • zc_obj next in-use object #

Definition at line 4474 of file zfs_ioctl.c.

static int zfs_ioc_obj_to_path ( zfs_cmd_t zc) [static]

inputs:

  • zc_name name of filesystem
  • zc_obj object to find

outputs:

  • zc_value name of object

Definition at line 1550 of file zfs_ioctl.c.

static int zfs_ioc_obj_to_stats ( zfs_cmd_t zc) [static]

inputs:

  • zc_name name of filesystem
  • zc_obj object to find

outputs:

  • zc_stat stats on object
  • zc_value path to object

Definition at line 1579 of file zfs_ioctl.c.

static int zfs_ioc_objset_recvd_props ( zfs_cmd_t zc) [static]

Gets received properties (distinct from local properties on or after SPA_VERSION_RECVD_PROPS) for callers who want to differentiate received from local property values.

inputs:

  • zc_name name of filesystem
  • zc_nvlist_dst_size size of buffer for property nvlist

outputs:

  • zc_nvlist_dst received property nvlist
  • zc_nvlist_dst_size size of received property nvlist

Definition at line 1884 of file zfs_ioctl.c.

static int zfs_ioc_objset_stats ( zfs_cmd_t zc) [static]

inputs:

  • zc_name name of filesystem
  • zc_nvlist_dst_size size of buffer for property nvlist

outputs:

  • zc_objset_stats stats
  • zc_nvlist_dst property nvlist
  • zc_nvlist_dst_size size of property nvlist

Definition at line 1852 of file zfs_ioctl.c.

static int zfs_ioc_objset_stats_impl ( zfs_cmd_t zc,
objset_t os 
) [static]

Definition at line 1810 of file zfs_ioctl.c.

static int zfs_ioc_objset_zplprops ( zfs_cmd_t zc) [static]

inputs:

  • zc_name name of filesystem
  • zc_nvlist_dst_size size of buffer for zpl property nvlist

outputs:

  • zc_nvlist_dst zpl property nvlist
  • zc_nvlist_dst_size size of zpl property nvlist

Definition at line 1939 of file zfs_ioctl.c.

static int zfs_ioc_pool_configs ( zfs_cmd_t zc) [static]

Definition at line 1350 of file zfs_ioctl.c.

static int zfs_ioc_pool_create ( zfs_cmd_t zc) [static]

Definition at line 1216 of file zfs_ioctl.c.

static int zfs_ioc_pool_destroy ( zfs_cmd_t zc) [static]

Definition at line 1286 of file zfs_ioctl.c.

static int zfs_ioc_pool_export ( zfs_cmd_t zc) [static]

Definition at line 1336 of file zfs_ioctl.c.

static int zfs_ioc_pool_freeze ( zfs_cmd_t zc) [static]

Definition at line 1450 of file zfs_ioctl.c.

static int zfs_ioc_pool_get_history ( zfs_cmd_t zc) [static]

Definition at line 1485 of file zfs_ioctl.c.

static int zfs_ioc_pool_get_props ( zfs_cmd_t zc) [static]

Definition at line 2681 of file zfs_ioctl.c.

static int zfs_ioc_pool_import ( zfs_cmd_t zc) [static]

Definition at line 1297 of file zfs_ioctl.c.

static int zfs_ioc_pool_reguid ( zfs_cmd_t zc) [static]

Definition at line 1517 of file zfs_ioctl.c.

static int zfs_ioc_pool_reopen ( zfs_cmd_t zc) [static]

Definition at line 4155 of file zfs_ioctl.c.

static int zfs_ioc_pool_scan ( zfs_cmd_t zc) [static]

inputs:

  • zc_name name of the pool
  • zc_cookie scan func (pool_scan_func_t)

Definition at line 1431 of file zfs_ioctl.c.

static int zfs_ioc_pool_set_props ( zfs_cmd_t zc) [static]

Definition at line 2636 of file zfs_ioctl.c.

static int zfs_ioc_pool_stats ( zfs_cmd_t zc) [static]

Definition at line 1372 of file zfs_ioctl.c.

static int zfs_ioc_pool_tryimport ( zfs_cmd_t zc) [static]

Try to import the given pool, returning pool stats as appropriate so that user land knows which devices are available and overall pool health.

Definition at line 1403 of file zfs_ioctl.c.

static int zfs_ioc_pool_upgrade ( zfs_cmd_t zc) [static]

Definition at line 1464 of file zfs_ioctl.c.

static int zfs_ioc_promote ( zfs_cmd_t zc) [static]

inputs:

  • zc_name name of filesystem
  • zc_value name of origin snapshot

outputs:

  • zc_string name of conflicting snapshot, if there is one

Definition at line 4190 of file zfs_ioctl.c.

static int zfs_ioc_recv ( zfs_cmd_t zc) [static]

inputs:

  • zc_name name of containing filesystem
  • zc_nvlist_src{_size} nvlist of properties to apply
  • zc_value name of snapshot to create
  • zc_string name of clone origin (if DRR_FLAG_CLONE)
  • zc_cookie file descriptor to recv from
  • zc_begin_record the BEGIN record of the stream (not byteswapped)
  • zc_guid force flag
  • zc_cleanup_fd cleanup-on-exit file descriptor
  • zc_action_handle handle for this guid/ds mapping (or zero on first call)

outputs:

  • zc_cookie number of bytes read
  • zc_nvlist_dst{_size} error for each unapplied received property
  • zc_obj zprop_errflags_t
  • zc_action_handle handle for this guid/ds mapping

Definition at line 3671 of file zfs_ioctl.c.

static int zfs_ioc_release ( zfs_cmd_t zc) [static]

inputs:

  • zc_name name of dataset from which we're releasing a user hold
  • zc_value short name of snap
  • zc_string user-supplied tag for this hold
  • zc_cookie recursive flag

outputs: none

Definition at line 4816 of file zfs_ioctl.c.

static int zfs_ioc_rename ( zfs_cmd_t zc) [static]

inputs:

  • zc_name old name of dataset
  • zc_value new name of dataset
  • zc_cookie recursive flag (only valid for snapshots)

outputs: none

Definition at line 3367 of file zfs_ioctl.c.

static int zfs_ioc_rollback ( zfs_cmd_t zc) [static]

inputs:

  • zc_name name of dataset to rollback (to most recent snapshot)

outputs: none

Definition at line 3281 of file zfs_ioctl.c.

static int zfs_ioc_send ( zfs_cmd_t zc) [static]

inputs:

  • zc_name name of snapshot to send
  • zc_cookie file descriptor to send stream to
  • zc_obj fromorigin flag (mutually exclusive with zc_fromobj)
  • zc_sendobj objsetid of snapshot to send
  • zc_fromobj objsetid of incremental fromsnap (may be zero)
  • zc_guid if set, estimate size of stream only.

zc_cookie is ignored. output size in zc_objset_type.

outputs: none

Definition at line 3900 of file zfs_ioctl.c.

static int zfs_ioc_send_progress ( zfs_cmd_t zc) [static]

Definition at line 3986 of file zfs_ioctl.c.

static int zfs_ioc_set_fsacl ( zfs_cmd_t zc) [static]

inputs:

  • zc_name name of filesystem
  • zc_nvlist_src{_size} nvlist of delegated permissions
  • zc_perm_action allow/unallow flag

outputs: none

Definition at line 2720 of file zfs_ioctl.c.

static int zfs_ioc_set_prop ( zfs_cmd_t zc) [static]

inputs:

  • zc_name name of filesystem
  • zc_value name of property to set
  • zc_nvlist_src{_size} nvlist of properties to apply
  • zc_cookie received properties flag

outputs:

  • zc_nvlist_dst{_size} error for each unapplied received property

Definition at line 2520 of file zfs_ioctl.c.

static int zfs_ioc_share ( zfs_cmd_t zc) [static]

Definition at line 4363 of file zfs_ioctl.c.

static int zfs_ioc_smb_acl ( zfs_cmd_t zc) [static]

Definition at line 4597 of file zfs_ioctl.c.

static int zfs_ioc_snapshot ( zfs_cmd_t zc) [static]

inputs:

  • zc_name name of filesystem
  • zc_value short name of snapshot
  • zc_cookie recursive flag
  • zc_nvlist_src[_size] property list

outputs:

  • zc_value short snapname (i.e. part after the '@')

Definition at line 3124 of file zfs_ioctl.c.

static int zfs_ioc_snapshot_list_next ( zfs_cmd_t zc) [static]

inputs: zc_name name of filesystem zc_cookie zap cursor zc_nvlist_dst_size size of buffer for property nvlist zc_simple when set, only name is requested

outputs:

  • zc_name name of next snapshot
  • zc_objset_stats stats
  • zc_nvlist_dst property nvlist
  • zc_nvlist_dst_size size of property nvlist

Definition at line 2076 of file zfs_ioctl.c.

static int zfs_ioc_space_snaps ( zfs_cmd_t zc) [static]

Definition at line 4891 of file zfs_ioctl.c.

static int zfs_ioc_space_written ( zfs_cmd_t zc) [static]

inputs:

  • zc_name name of new filesystem or snapshot
  • zc_value full name of old snapshot

outputs:

  • zc_cookie space in bytes
  • zc_objset_type compressed space in bytes
  • zc_perm_action uncompressed space in bytes

Definition at line 4859 of file zfs_ioctl.c.

static int zfs_ioc_tmp_snapshot ( zfs_cmd_t zc) [static]

inputs:

  • zc_name name of filesystem
  • zc_value prefix name for snapshot
  • zc_cleanup_fd cleanup-on-exit file descriptor for calling process

outputs:

Definition at line 4499 of file zfs_ioctl.c.

static int zfs_ioc_unjail ( zfs_cmd_t zc) [static]

Definition at line 4926 of file zfs_ioctl.c.

static int zfs_ioc_userspace_many ( zfs_cmd_t zc) [static]

inputs:

  • zc_name name of filesystem
  • zc_cookie zap cursor
  • zc_objset_type zfs_userquota_prop_t
  • zc_nvlist_dst[_size] buffer to fill (not really an nvlist)

outputs:

  • zc_nvlist_dst[_size] data buffer (array of zfs_useracct_t)
  • zc_cookie zap cursor

Definition at line 4250 of file zfs_ioctl.c.

static int zfs_ioc_userspace_one ( zfs_cmd_t zc) [static]

Retrieve a single {user|group}{used|quota}@...

property.

inputs:

  • zc_name name of filesystem
  • zc_objset_type zfs_userquota_prop_t
  • zc_value domain name (eg. "S-1-234-567-89")
  • zc_guid RID/UID/GID

outputs:

  • zc_cookie property value

Definition at line 4219 of file zfs_ioctl.c.

static int zfs_ioc_userspace_upgrade ( zfs_cmd_t zc) [static]

inputs:

  • zc_name name of filesystem

outputs: none

Definition at line 4286 of file zfs_ioctl.c.

static int zfs_ioc_vdev_add ( zfs_cmd_t zc) [static]

Definition at line 1599 of file zfs_ioctl.c.

static int zfs_ioc_vdev_attach ( zfs_cmd_t zc) [static]

Definition at line 1705 of file zfs_ioctl.c.

static int zfs_ioc_vdev_detach ( zfs_cmd_t zc) [static]

Definition at line 1726 of file zfs_ioctl.c.

static int zfs_ioc_vdev_remove ( zfs_cmd_t zc) [static]

inputs:

  • zc_name name of the pool
  • zc_nvlist_conf nvlist of devices to remove
  • zc_cookie to stop the remove?

Definition at line 1649 of file zfs_ioctl.c.

static int zfs_ioc_vdev_set_state ( zfs_cmd_t zc) [static]

Definition at line 1663 of file zfs_ioctl.c.

static int zfs_ioc_vdev_setfru ( zfs_cmd_t zc) [static]

Definition at line 1793 of file zfs_ioctl.c.

static int zfs_ioc_vdev_setpath ( zfs_cmd_t zc) [static]

Definition at line 1776 of file zfs_ioctl.c.

static int zfs_ioc_vdev_split ( zfs_cmd_t zc) [static]

Definition at line 1741 of file zfs_ioctl.c.

static boolean_t zfs_is_bootfs ( const char *  name) [static]

Check to see if the named dataset is currently defined as bootable.

Definition at line 200 of file zfs_ioctl.c.

static void zfs_log_history ( zfs_cmd_t zc) [static]

Definition at line 256 of file zfs_ioctl.c.

static int zfs_modevent ( module_t  mod,
int  type,
void *unused  __unused 
) [static]

Definition at line 5475 of file zfs_ioctl.c.

static int zfs_prop_set_special ( const char *  dsname,
zprop_source_t  source,
nvpair_t *  pair 
) [static]

If the named property is one that has a special function to set its value, return 0 on success and a positive error code on failure; otherwise if it is not one of the special properties handled by this function, return -1.

XXX: It would be better for callers of the property interface if we handled these special cases in dsl_prop.c (in the dsl layer).

Definition at line 2198 of file zfs_ioctl.c.

static int zfs_prop_set_userquota ( const char *  dsname,
nvpair_t *  pair 
) [static]

Definition at line 2145 of file zfs_ioctl.c.

static int zfs_secpolicy_config ( zfs_cmd_t zc,
cred_t *  cr 
) [static]

Policy for pool operations - create/destroy pools, add vdevs, etc.

Requires SYS_CONFIG privilege, which is not available in a local zone.

Definition at line 903 of file zfs_ioctl.c.

static int zfs_secpolicy_create ( zfs_cmd_t zc,
cred_t *  cr 
) [static]

Definition at line 860 of file zfs_ioctl.c.

static int zfs_secpolicy_deleg_share ( zfs_cmd_t zc,
cred_t *  cr 
) [static]

Definition at line 623 of file zfs_ioctl.c.

static int zfs_secpolicy_destroy ( zfs_cmd_t zc,
cred_t *  cr 
) [static]

Definition at line 707 of file zfs_ioctl.c.

int zfs_secpolicy_destroy_perms ( const char *  name,
cred_t *  cr 
)

Definition at line 695 of file zfs_ioctl.c.

static int zfs_secpolicy_destroy_recursive ( zfs_cmd_t zc,
cred_t *  cr 
) [static]

Destroying snapshots with delegated permissions requires descendent mount and destroy permissions.

Definition at line 717 of file zfs_ioctl.c.

static int zfs_secpolicy_diff ( zfs_cmd_t zc,
cred_t *  cr 
) [static]

Policy for object to name lookups.

Definition at line 916 of file zfs_ioctl.c.

int zfs_secpolicy_fsacl ( zfs_cmd_t zc,
cred_t *  cr 
)

Definition at line 563 of file zfs_ioctl.c.

static int zfs_secpolicy_hold ( zfs_cmd_t zc,
cred_t *  cr 
) [static]

Definition at line 1004 of file zfs_ioctl.c.

static int zfs_secpolicy_inherit ( zfs_cmd_t zc,
cred_t *  cr 
) [static]

Definition at line 938 of file zfs_ioctl.c.

static int zfs_secpolicy_inject ( zfs_cmd_t zc,
cred_t *  cr 
) [static]

Policy for fault injection.

Requires all privileges.

Definition at line 932 of file zfs_ioctl.c.

static int zfs_secpolicy_none ( zfs_cmd_t zc,
cred_t *  cr 
) [static]

Policy for top-level read operations (list pools).

Requires no privileges, and can be used in the local zone, as there is no associated dataset.

Definition at line 278 of file zfs_ioctl.c.

static int zfs_secpolicy_promote ( zfs_cmd_t zc,
cred_t *  cr 
) [static]

Definition at line 788 of file zfs_ioctl.c.

static int zfs_secpolicy_read ( zfs_cmd_t zc,
cred_t *  cr 
) [static]

Policy for dataset read operations (list children, get statistics).

Requires no privileges, but must be visible in the local zone.

Definition at line 289 of file zfs_ioctl.c.

static int zfs_secpolicy_receive ( zfs_cmd_t zc,
cred_t *  cr 
) [static]

Definition at line 829 of file zfs_ioctl.c.

static int zfs_secpolicy_release ( zfs_cmd_t zc,
cred_t *  cr 
) [static]

Definition at line 1011 of file zfs_ioctl.c.

static int zfs_secpolicy_rename ( zfs_cmd_t zc,
cred_t *  cr 
) [static]

Definition at line 763 of file zfs_ioctl.c.

int zfs_secpolicy_rename_perms ( const char *  from,
const char *  to,
cred_t *  cr 
)

Definition at line 734 of file zfs_ioctl.c.

int zfs_secpolicy_rollback ( zfs_cmd_t zc,
cred_t *  cr 
)

Definition at line 579 of file zfs_ioctl.c.

int zfs_secpolicy_send ( zfs_cmd_t zc,
cred_t *  cr 
)

Definition at line 586 of file zfs_ioctl.c.

static int zfs_secpolicy_setprop ( const char *  dsname,
zfs_prop_t  prop,
nvpair_t *  propval,
cred_t *  cr 
) [static]

Definition at line 507 of file zfs_ioctl.c.

int zfs_secpolicy_share ( zfs_cmd_t zc,
cred_t *  cr 
)

Definition at line 647 of file zfs_ioctl.c.

int zfs_secpolicy_smb_acl ( zfs_cmd_t zc,
cred_t *  cr 
)

Definition at line 660 of file zfs_ioctl.c.

static int zfs_secpolicy_snapshot ( zfs_cmd_t zc,
cred_t *  cr 
) [static]

Definition at line 853 of file zfs_ioctl.c.

int zfs_secpolicy_snapshot_perms ( const char *  name,
cred_t *  cr 
)

Definition at line 846 of file zfs_ioctl.c.

static int zfs_secpolicy_tmp_snapshot ( zfs_cmd_t zc,
cred_t *  cr 
) [static]

Policy for allowing temporary snapshots to be taken or released.

Definition at line 1021 of file zfs_ioctl.c.

static int zfs_secpolicy_umount ( zfs_cmd_t zc,
cred_t *  cr 
) [static]

Definition at line 886 of file zfs_ioctl.c.

static int zfs_secpolicy_userspace_many ( zfs_cmd_t zc,
cred_t *  cr 
) [static]

Definition at line 983 of file zfs_ioctl.c.

static int zfs_secpolicy_userspace_one ( zfs_cmd_t zc,
cred_t *  cr 
) [static]

Definition at line 954 of file zfs_ioctl.c.

static int zfs_secpolicy_userspace_upgrade ( zfs_cmd_t zc,
cred_t *  cr 
) [static]

Definition at line 997 of file zfs_ioctl.c.

int zfs_secpolicy_write_perms ( const char *  name,
const char *  perm,
cred_t *  cr 
)

Definition at line 362 of file zfs_ioctl.c.

int zfs_secpolicy_write_perms_ds ( const char *  name,
dsl_dataset_t ds,
const char *  perm,
cred_t *  cr 
)

Definition at line 393 of file zfs_ioctl.c.

int zfs_set_prop_nvlist ( const char *  dsname,
zprop_source_t  source,
nvlist_t *  nvl,
nvlist_t **  errlist 
)

This function is best effort.

If it fails to set any of the given properties, it continues to set as many as it can and returns the first error encountered. If the caller provides a non-NULL errlist, it also gives the complete list of names of all the properties it failed to set along with the corresponding error numbers. The caller is responsible for freeing the returned errlist.

If every property is set successfully, zero is returned and the list pointed at by errlist is NULL.

Definition at line 2281 of file zfs_ioctl.c.

int zfs_unmount_snap ( const char *  name,
void *  arg 
)

Definition at line 3157 of file zfs_ioctl.c.

static void zfsdev_close ( void *  data) [static]

Definition at line 5161 of file zfs_ioctl.c.

static void zfsdev_fini ( void  ) [static]

Definition at line 5399 of file zfs_ioctl.c.

void* zfsdev_get_soft_state ( minor_t  minor,
enum zfs_soft_state_type  which 
)

Definition at line 5129 of file zfs_ioctl.c.

static void zfsdev_init ( void  ) [static]

Definition at line 5392 of file zfs_ioctl.c.

static int zfsdev_ioctl ( struct cdev *  dev,
u_long  cmd,
caddr_t  addr,
int  flag,
struct thread *  td 
) [static]

Definition at line 5180 of file zfs_ioctl.c.

minor_t zfsdev_minor_alloc ( void  )

Find a free minor number.

Definition at line 5076 of file zfs_ioctl.c.

static int zfsdev_open ( struct cdev *  devp,
int  flag,
int  mode,
struct thread *  td 
) [static]

Definition at line 5141 of file zfs_ioctl.c.

static int zfsvfs_hold ( const char *  name,
void *  tag,
zfsvfs_t **  zfvp,
boolean_t  writer 
) [static]

Find a zfsvfs_t for a mounted filesystem, or create our own, in which case its z_vfs will be NULL, and it will be opened as the owner.

If 'writer' is set, the z_teardown_lock will be held for RW_WRITER, which prevents all vnode ops from running.

Definition at line 1180 of file zfs_ioctl.c.

static void zfsvfs_rele ( zfsvfs_t zfsvfs,
void *  tag 
) [static]

Definition at line 1203 of file zfs_ioctl.c.

static boolean_t zpl_earlier_version ( const char *  name,
int  version 
) [static]
Returns:
TRUE if the ZPL version is less than requested version.

Definition at line 235 of file zfs_ioctl.c.


Variable Documentation

ace_t full_access[]
Initial value:
 {
        {(uid_t)-1, ACE_ALL_PERMS, ACE_EVERYONE, 0}
}

Definition at line 4461 of file zfs_ioctl.c.

uint_t rrw_tsd_key

global key for TSD

Definition at line 72 of file rrwlock.c.

int snapshot_list_prefetch [static]

Definition at line 87 of file zfs_ioctl.c.

const char* userquota_perms[] [static]
Initial value:

This array is indexed by zfs_userquota_prop_t.

Definition at line 116 of file zfs_ioctl.c.

struct cdevsw zfs_cdevsw [static]
Initial value:
 {
        .d_version =    D_VERSION,
        .d_open =       zfsdev_open,
        .d_ioctl =      zfsdev_ioctl,
        .d_name =       ZFS_DEV_NAME
}

Definition at line 5384 of file zfs_ioctl.c.

Definition at line 5408 of file zfs_ioctl.c.

Definition at line 4933 of file zfs_ioctl.c.

moduledata_t zfs_mod [static]
Initial value:
 {
        "zfsctrl",
        zfs_modevent,
        0
}

Definition at line 5521 of file zfs_ioctl.c.

struct root_hold_token* zfs_root_token [static]

Definition at line 5405 of file zfs_ioctl.c.

kmutex_t zfs_share_lock

Definition at line 4338 of file zfs_ioctl.c.

struct cdev* zfsdev [static]

Definition at line 93 of file zfs_ioctl.c.

struct proc* zfsproc

Definition at line 5406 of file zfs_ioctl.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines