Print this page
3744 zfs shouldn't ignore errors unmounting snapshots
Submitted by:   Will Andrews <willa@spectralogic.com>
Reviewed by:    Matthew Ahrens <mahrens@delphix.com>


 327 
 328 #define ZFSDEV_MAX_MINOR        (1 << 16)
 329 #define ZFS_MIN_MINOR   (ZFSDEV_MAX_MINOR + 1)
 330 
 331 #define ZPOOL_EXPORT_AFTER_SPLIT 0x1
 332 
 333 #ifdef _KERNEL
 334 
 335 typedef struct zfs_creat {
 336         nvlist_t        *zct_zplprops;
 337         nvlist_t        *zct_props;
 338 } zfs_creat_t;
 339 
 340 extern dev_info_t *zfs_dip;
 341 
 342 extern int zfs_secpolicy_snapshot_perms(const char *name, cred_t *cr);
 343 extern int zfs_secpolicy_rename_perms(const char *from,
 344     const char *to, cred_t *cr);
 345 extern int zfs_secpolicy_destroy_perms(const char *name, cred_t *cr);
 346 extern int zfs_busy(void);
 347 extern void zfs_unmount_snap(const char *);
 348 extern void zfs_destroy_unmount_origin(const char *);
 349 
 350 /*
 351  * ZFS minor numbers can refer to either a control device instance or
 352  * a zvol. Depending on the value of zss_type, zss_data points to either
 353  * a zvol_state_t or a zfs_onexit_t.
 354  */
 355 enum zfs_soft_state_type {
 356         ZSST_ZVOL,
 357         ZSST_CTLDEV
 358 };
 359 
 360 typedef struct zfs_soft_state {
 361         enum zfs_soft_state_type zss_type;
 362         void *zss_data;
 363 } zfs_soft_state_t;
 364 
 365 extern void *zfsdev_get_soft_state(minor_t minor,
 366     enum zfs_soft_state_type which);
 367 extern minor_t zfsdev_minor_alloc(void);


 327 
 328 #define ZFSDEV_MAX_MINOR        (1 << 16)
 329 #define ZFS_MIN_MINOR   (ZFSDEV_MAX_MINOR + 1)
 330 
 331 #define ZPOOL_EXPORT_AFTER_SPLIT 0x1
 332 
 333 #ifdef _KERNEL
 334 
 335 typedef struct zfs_creat {
 336         nvlist_t        *zct_zplprops;
 337         nvlist_t        *zct_props;
 338 } zfs_creat_t;
 339 
 340 extern dev_info_t *zfs_dip;
 341 
 342 extern int zfs_secpolicy_snapshot_perms(const char *name, cred_t *cr);
 343 extern int zfs_secpolicy_rename_perms(const char *from,
 344     const char *to, cred_t *cr);
 345 extern int zfs_secpolicy_destroy_perms(const char *name, cred_t *cr);
 346 extern int zfs_busy(void);
 347 extern int zfs_unmount_snap(const char *);
 348 extern void zfs_destroy_unmount_origin(const char *);
 349 
 350 /*
 351  * ZFS minor numbers can refer to either a control device instance or
 352  * a zvol. Depending on the value of zss_type, zss_data points to either
 353  * a zvol_state_t or a zfs_onexit_t.
 354  */
 355 enum zfs_soft_state_type {
 356         ZSST_ZVOL,
 357         ZSST_CTLDEV
 358 };
 359 
 360 typedef struct zfs_soft_state {
 361         enum zfs_soft_state_type zss_type;
 362         void *zss_data;
 363 } zfs_soft_state_t;
 364 
 365 extern void *zfsdev_get_soft_state(minor_t minor,
 366     enum zfs_soft_state_type which);
 367 extern minor_t zfsdev_minor_alloc(void);