Skip to content

Commit

Permalink
SQUASH: Final reworking
Browse files Browse the repository at this point in the history
Signed-off-by: Brian Atkinson <[email protected]>
  • Loading branch information
bwatkinson committed Jan 29, 2025
1 parent c87ca35 commit a5b237e
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions module/os/linux/zfs/zfs_uio.c
Original file line number Diff line number Diff line change
Expand Up @@ -479,11 +479,11 @@ zfs_uio_free_dio_pages(zfs_uio_t *uio, zfs_uio_rw_t rw)
ASSERT(uio->uio_extflg & UIO_DIRECT);
ASSERT3P(uio->uio_dio.pages, !=, NULL);

#if defined(HAVE_PIN_USER_PAGES_UNLOCKED)
if (uio->uio_dio.pinned) {
#if defined(HAVE_PIN_USER_PAGES_UNLOCKED)
unpin_user_pages(uio->uio_dio.pages, uio->uio_dio.npages);
} else {
#endif
} else {
for (long i = 0; i < uio->uio_dio.npages; i++) {
struct page *p = uio->uio_dio.pages[i];

Expand All @@ -495,9 +495,7 @@ zfs_uio_free_dio_pages(zfs_uio_t *uio, zfs_uio_rw_t rw)

put_page(p);
}
#if defined(HAVE_PIN_USER_PAGES_UNLOCKED)
}
#endif

vmem_free(uio->uio_dio.pages,
uio->uio_dio.npages * sizeof (struct page *));
Expand Down Expand Up @@ -648,17 +646,15 @@ zfs_uio_get_dio_pages_alloc(zfs_uio_t *uio, zfs_uio_rw_t rw)
ASSERT3S(uio->uio_dio.npages, >=, 0);

if (error) {
#if defined(HAVE_PIN_USER_PAGES_UNLOCKED)
if (uio->uio_dio.pinned) {
#if defined(HAVE_PIN_USER_PAGES_UNLOCKED)
unpin_user_pages(uio->uio_dio.pages,
uio->uio_dio.npages);
} else {
#endif
} else {
for (long i = 0; i < uio->uio_dio.npages; i++)
put_page(uio->uio_dio.pages[i]);
#if defined(HAVE_PIN_USER_PAGES_UNLOCKED)
}
#endif

vmem_free(uio->uio_dio.pages, size);
return (error);
Expand Down

0 comments on commit a5b237e

Please sign in to comment.