Print this page
3742 zfs comments need cleaner, more consistent style
Submitted by:   Will Andrews <willa@spectralogic.com>
Submitted by:   Alan Somers <alans@spectralogic.com>
Reviewed by:    Matthew Ahrens <mahrens@delphix.com>
Reviewed by:    George Wilson <george.wilson@delphix.com>
Reviewed by:    Eric Schrock <eric.schrock@delphix.com>


 228 #define VDEV_UBERBLOCK_SIZE(vd)         (1ULL << VDEV_UBERBLOCK_SHIFT(vd))
 229 
 230 typedef struct vdev_phys {
 231         char            vp_nvlist[VDEV_PHYS_SIZE - sizeof (zio_eck_t)];
 232         zio_eck_t       vp_zbt;
 233 } vdev_phys_t;
 234 
 235 typedef struct vdev_label {
 236         char            vl_pad1[VDEV_PAD_SIZE];                 /*  8K */
 237         char            vl_pad2[VDEV_PAD_SIZE];                 /*  8K */
 238         vdev_phys_t     vl_vdev_phys;                           /* 112K */
 239         char            vl_uberblock[VDEV_UBERBLOCK_RING];      /* 128K */
 240 } vdev_label_t;                                                 /* 256K total */
 241 
 242 /*
 243  * vdev_dirty() flags
 244  */
 245 #define VDD_METASLAB    0x01
 246 #define VDD_DTL         0x02
 247 


 248 /*
 249  * Size and offset of embedded boot loader region on each label.
 250  * The total size of the first two labels plus the boot area is 4MB.
 251  */
 252 #define VDEV_BOOT_OFFSET        (2 * sizeof (vdev_label_t))
 253 #define VDEV_BOOT_SIZE          (7ULL << 19)                      /* 3.5M */
 254 
 255 /*
 256  * Size of label regions at the start and end of each leaf device.
 257  */
 258 #define VDEV_LABEL_START_SIZE   (2 * sizeof (vdev_label_t) + VDEV_BOOT_SIZE)
 259 #define VDEV_LABEL_END_SIZE     (2 * sizeof (vdev_label_t))
 260 #define VDEV_LABELS             4
 261 #define VDEV_BEST_LABEL         VDEV_LABELS
 262 
 263 #define VDEV_ALLOC_LOAD         0
 264 #define VDEV_ALLOC_ADD          1
 265 #define VDEV_ALLOC_SPARE        2
 266 #define VDEV_ALLOC_L2CACHE      3
 267 #define VDEV_ALLOC_ROOTPOOL     4
 268 #define VDEV_ALLOC_SPLIT        5
 269 #define VDEV_ALLOC_ATTACH       6
 270 
 271 /*
 272  * Allocate or free a vdev


 300  * Available vdev types.
 301  */
 302 extern vdev_ops_t vdev_root_ops;
 303 extern vdev_ops_t vdev_mirror_ops;
 304 extern vdev_ops_t vdev_replacing_ops;
 305 extern vdev_ops_t vdev_raidz_ops;
 306 extern vdev_ops_t vdev_disk_ops;
 307 extern vdev_ops_t vdev_file_ops;
 308 extern vdev_ops_t vdev_missing_ops;
 309 extern vdev_ops_t vdev_hole_ops;
 310 extern vdev_ops_t vdev_spare_ops;
 311 
 312 /*
 313  * Common size functions
 314  */
 315 extern uint64_t vdev_default_asize(vdev_t *vd, uint64_t psize);
 316 extern uint64_t vdev_get_min_asize(vdev_t *vd);
 317 extern void vdev_set_min_asize(vdev_t *vd);
 318 
 319 /*
 320  * zdb uses this tunable, so it must be declared here to make lint happy.
 321  */

 322 extern int zfs_vdev_cache_size;
 323 
 324 /*
 325  * The vdev_buf_t is used to translate between zio_t and buf_t, and back again.
 326  */
 327 typedef struct vdev_buf {
 328         buf_t   vb_buf;         /* buffer that describes the io */
 329         zio_t   *vb_io;         /* pointer back to the original zio_t */
 330 } vdev_buf_t;
 331 
 332 #ifdef  __cplusplus
 333 }
 334 #endif
 335 
 336 #endif  /* _SYS_VDEV_IMPL_H */


 228 #define VDEV_UBERBLOCK_SIZE(vd)         (1ULL << VDEV_UBERBLOCK_SHIFT(vd))
 229 
 230 typedef struct vdev_phys {
 231         char            vp_nvlist[VDEV_PHYS_SIZE - sizeof (zio_eck_t)];
 232         zio_eck_t       vp_zbt;
 233 } vdev_phys_t;
 234 
 235 typedef struct vdev_label {
 236         char            vl_pad1[VDEV_PAD_SIZE];                 /*  8K */
 237         char            vl_pad2[VDEV_PAD_SIZE];                 /*  8K */
 238         vdev_phys_t     vl_vdev_phys;                           /* 112K */
 239         char            vl_uberblock[VDEV_UBERBLOCK_RING];      /* 128K */
 240 } vdev_label_t;                                                 /* 256K total */
 241 
 242 /*
 243  * vdev_dirty() flags
 244  */
 245 #define VDD_METASLAB    0x01
 246 #define VDD_DTL         0x02
 247 
 248 /* Offset of embedded boot loader region on each label */
 249 #define VDEV_BOOT_OFFSET        (2 * sizeof (vdev_label_t))
 250 /*
 251  * Size of embedded boot loader region on each label.
 252  * The total size of the first two labels plus the boot area is 4MB.
 253  */

 254 #define VDEV_BOOT_SIZE          (7ULL << 19)                      /* 3.5M */
 255 
 256 /*
 257  * Size of label regions at the start and end of each leaf device.
 258  */
 259 #define VDEV_LABEL_START_SIZE   (2 * sizeof (vdev_label_t) + VDEV_BOOT_SIZE)
 260 #define VDEV_LABEL_END_SIZE     (2 * sizeof (vdev_label_t))
 261 #define VDEV_LABELS             4
 262 #define VDEV_BEST_LABEL         VDEV_LABELS
 263 
 264 #define VDEV_ALLOC_LOAD         0
 265 #define VDEV_ALLOC_ADD          1
 266 #define VDEV_ALLOC_SPARE        2
 267 #define VDEV_ALLOC_L2CACHE      3
 268 #define VDEV_ALLOC_ROOTPOOL     4
 269 #define VDEV_ALLOC_SPLIT        5
 270 #define VDEV_ALLOC_ATTACH       6
 271 
 272 /*
 273  * Allocate or free a vdev


 301  * Available vdev types.
 302  */
 303 extern vdev_ops_t vdev_root_ops;
 304 extern vdev_ops_t vdev_mirror_ops;
 305 extern vdev_ops_t vdev_replacing_ops;
 306 extern vdev_ops_t vdev_raidz_ops;
 307 extern vdev_ops_t vdev_disk_ops;
 308 extern vdev_ops_t vdev_file_ops;
 309 extern vdev_ops_t vdev_missing_ops;
 310 extern vdev_ops_t vdev_hole_ops;
 311 extern vdev_ops_t vdev_spare_ops;
 312 
 313 /*
 314  * Common size functions
 315  */
 316 extern uint64_t vdev_default_asize(vdev_t *vd, uint64_t psize);
 317 extern uint64_t vdev_get_min_asize(vdev_t *vd);
 318 extern void vdev_set_min_asize(vdev_t *vd);
 319 
 320 /*
 321  * Global variables
 322  */
 323 /* zdb uses this tunable, so it must be declared here to make lint happy. */
 324 extern int zfs_vdev_cache_size;
 325 
 326 /*
 327  * The vdev_buf_t is used to translate between zio_t and buf_t, and back again.
 328  */
 329 typedef struct vdev_buf {
 330         buf_t   vb_buf;         /* buffer that describes the io */
 331         zio_t   *vb_io;         /* pointer back to the original zio_t */
 332 } vdev_buf_t;
 333 
 334 #ifdef  __cplusplus
 335 }
 336 #endif
 337 
 338 #endif  /* _SYS_VDEV_IMPL_H */