Skip to content

Commit

Permalink
L2arc ioctl update
Browse files Browse the repository at this point in the history
  • Loading branch information
datacore-skumar committed Jul 15, 2022
1 parent 8d9eb87 commit 19c9c4e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 4 additions & 3 deletions module/os/windows/spl/spl-kstat.c
Original file line number Diff line number Diff line change
Expand Up @@ -2261,9 +2261,10 @@ int spl_kstat_write(PDEVICE_OBJECT DiskDevice, PIRP Irp,
return (0);
}

uint64_t
getL2ArcAllocSize(arc_stats_t* arc_ptr) {
return arc_ptr->arcstat_l2_psize.value.ui64;
void
getL2ArcAllocSize(uint64_t* l2arc,arc_stats_t* arc_ptr)
{
*l2arc = arc_ptr->arcstat_l2_psize.value.ui64;
}

// Added comments inline referring to perl arcstat.pl
Expand Down
4 changes: 3 additions & 1 deletion module/os/windows/zfs/zfs_ioctl_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,12 @@ NTSTATUS zpool_zfs_get_metrics(PDEVICE_OBJECT DeviceObject, PIRP Irp, PIO_STACK_
else
perf->zfs_volSize = getZvolSize(perf->name);

uint64_t l2arc=0;
KSTAT_ENTER(perf_arc_ksp);
int error = KSTAT_UPDATE(perf_arc_ksp, KSTAT_READ);
if (!error)
perf->l2arc_alloc_size = getL2ArcAllocSize(perf_arc_ksp->ks_data);
getL2ArcAllocSize(&l2arc, perf_arc_ksp->ks_data);
perf->l2arc_alloc_size = l2arc;
KSTAT_EXIT(perf_arc_ksp);

Irp->IoStatus.Information = sizeof(zpool_zfs_metrics);
Expand Down

0 comments on commit 19c9c4e

Please sign in to comment.