855
856 /*
857 * Initialize the io for a log block.
858 */
859 static void
860 zil_lwb_write_init(zilog_t *zilog, lwb_t *lwb)
861 {
862 zbookmark_t zb;
863
864 SET_BOOKMARK(&zb, lwb->lwb_blk.blk_cksum.zc_word[ZIL_ZC_OBJSET],
865 ZB_ZIL_OBJECT, ZB_ZIL_LEVEL,
866 lwb->lwb_blk.blk_cksum.zc_word[ZIL_ZC_SEQ]);
867
868 if (zilog->zl_root_zio == NULL) {
869 zilog->zl_root_zio = zio_root(zilog->zl_spa, NULL, NULL,
870 ZIO_FLAG_CANFAIL);
871 }
872 if (lwb->lwb_zio == NULL) {
873 lwb->lwb_zio = zio_rewrite(zilog->zl_root_zio, zilog->zl_spa,
874 0, &lwb->lwb_blk, lwb->lwb_buf, BP_GET_LSIZE(&lwb->lwb_blk),
875 zil_lwb_write_done, lwb, ZIO_PRIORITY_LOG_WRITE,
876 ZIO_FLAG_CANFAIL | ZIO_FLAG_DONT_PROPAGATE, &zb);
877 }
878 }
879
880 /*
881 * Define a limited set of intent log block sizes.
882 *
883 * These must be a multiple of 4KB. Note only the amount used (again
884 * aligned to 4KB) actually gets written. However, we can't always just
885 * allocate SPA_MAXBLOCKSIZE as the slog space could be exhausted.
886 */
887 uint64_t zil_block_buckets[] = {
888 4096, /* non TX_WRITE */
889 8192+4096, /* data base */
890 32*1024 + 4096, /* NFS writes */
891 UINT64_MAX
892 };
893
894 /*
895 * Use the slog as long as the logbias is 'latency' and the current commit size
|
855
856 /*
857 * Initialize the io for a log block.
858 */
859 static void
860 zil_lwb_write_init(zilog_t *zilog, lwb_t *lwb)
861 {
862 zbookmark_t zb;
863
864 SET_BOOKMARK(&zb, lwb->lwb_blk.blk_cksum.zc_word[ZIL_ZC_OBJSET],
865 ZB_ZIL_OBJECT, ZB_ZIL_LEVEL,
866 lwb->lwb_blk.blk_cksum.zc_word[ZIL_ZC_SEQ]);
867
868 if (zilog->zl_root_zio == NULL) {
869 zilog->zl_root_zio = zio_root(zilog->zl_spa, NULL, NULL,
870 ZIO_FLAG_CANFAIL);
871 }
872 if (lwb->lwb_zio == NULL) {
873 lwb->lwb_zio = zio_rewrite(zilog->zl_root_zio, zilog->zl_spa,
874 0, &lwb->lwb_blk, lwb->lwb_buf, BP_GET_LSIZE(&lwb->lwb_blk),
875 zil_lwb_write_done, lwb, ZIO_PRIORITY_SYNC_WRITE,
876 ZIO_FLAG_CANFAIL | ZIO_FLAG_DONT_PROPAGATE, &zb);
877 }
878 }
879
880 /*
881 * Define a limited set of intent log block sizes.
882 *
883 * These must be a multiple of 4KB. Note only the amount used (again
884 * aligned to 4KB) actually gets written. However, we can't always just
885 * allocate SPA_MAXBLOCKSIZE as the slog space could be exhausted.
886 */
887 uint64_t zil_block_buckets[] = {
888 4096, /* non TX_WRITE */
889 8192+4096, /* data base */
890 32*1024 + 4096, /* NFS writes */
891 UINT64_MAX
892 };
893
894 /*
895 * Use the slog as long as the logbias is 'latency' and the current commit size
|