mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-25 18:59:33 +03:00
Removing old code for k(un)map_atomic
It used to be required to pass a enum km_type to kmap_atomic() and kunmap_atomic(), however this is no longer necessary and the wrappers zfs_k(un)map_atomic removed these. This is confusing in the ABD code as the struct abd_iter member iter_km no longer exists and the wrapper macros simply compile them out. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Adam Moss <c@yotes.com> Signed-off-by: Brian Atkinson <batkinson@lanl.gov> Closes #11768
This commit is contained in:
parent
793c958f6f
commit
f52124dce8
@ -30,8 +30,8 @@
|
|||||||
#include <linux/uaccess.h>
|
#include <linux/uaccess.h>
|
||||||
|
|
||||||
/* 2.6.37 API change */
|
/* 2.6.37 API change */
|
||||||
#define zfs_kmap_atomic(page, km_type) kmap_atomic(page)
|
#define zfs_kmap_atomic(page) kmap_atomic(page)
|
||||||
#define zfs_kunmap_atomic(addr, km_type) kunmap_atomic(addr)
|
#define zfs_kunmap_atomic(addr) kunmap_atomic(addr)
|
||||||
|
|
||||||
/* 5.0 API change - no more 'type' argument for access_ok() */
|
/* 5.0 API change - no more 'type' argument for access_ok() */
|
||||||
#ifdef HAVE_ACCESS_OK_TYPE
|
#ifdef HAVE_ACCESS_OK_TYPE
|
||||||
|
@ -490,8 +490,8 @@ abd_alloc_zero_scatter(void)
|
|||||||
#define PAGE_SHIFT (highbit64(PAGESIZE)-1)
|
#define PAGE_SHIFT (highbit64(PAGESIZE)-1)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define zfs_kmap_atomic(chunk, km) ((void *)chunk)
|
#define zfs_kmap_atomic(chunk) ((void *)chunk)
|
||||||
#define zfs_kunmap_atomic(addr, km) do { (void)(addr); } while (0)
|
#define zfs_kunmap_atomic(addr) do { (void)(addr); } while (0)
|
||||||
#define local_irq_save(flags) do { (void)(flags); } while (0)
|
#define local_irq_save(flags) do { (void)(flags); } while (0)
|
||||||
#define local_irq_restore(flags) do { (void)(flags); } while (0)
|
#define local_irq_restore(flags) do { (void)(flags); } while (0)
|
||||||
#define nth_page(pg, i) \
|
#define nth_page(pg, i) \
|
||||||
@ -879,8 +879,7 @@ abd_iter_map(struct abd_iter *aiter)
|
|||||||
aiter->iter_mapsize = MIN(aiter->iter_sg->length - offset,
|
aiter->iter_mapsize = MIN(aiter->iter_sg->length - offset,
|
||||||
aiter->iter_abd->abd_size - aiter->iter_pos);
|
aiter->iter_abd->abd_size - aiter->iter_pos);
|
||||||
|
|
||||||
paddr = zfs_kmap_atomic(sg_page(aiter->iter_sg),
|
paddr = zfs_kmap_atomic(sg_page(aiter->iter_sg));
|
||||||
km_table[aiter->iter_km]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
aiter->iter_mapaddr = (char *)paddr + offset;
|
aiter->iter_mapaddr = (char *)paddr + offset;
|
||||||
@ -899,8 +898,7 @@ abd_iter_unmap(struct abd_iter *aiter)
|
|||||||
|
|
||||||
if (!abd_is_linear(aiter->iter_abd)) {
|
if (!abd_is_linear(aiter->iter_abd)) {
|
||||||
/* LINTED E_FUNC_SET_NOT_USED */
|
/* LINTED E_FUNC_SET_NOT_USED */
|
||||||
zfs_kunmap_atomic(aiter->iter_mapaddr - aiter->iter_offset,
|
zfs_kunmap_atomic(aiter->iter_mapaddr - aiter->iter_offset);
|
||||||
km_table[aiter->iter_km]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ASSERT3P(aiter->iter_mapaddr, !=, NULL);
|
ASSERT3P(aiter->iter_mapaddr, !=, NULL);
|
||||||
|
@ -136,12 +136,12 @@ zfs_uiomove_bvec(void *p, size_t n, zfs_uio_rw_t rw, zfs_uio_t *uio)
|
|||||||
void *paddr;
|
void *paddr;
|
||||||
cnt = MIN(bv->bv_len - skip, n);
|
cnt = MIN(bv->bv_len - skip, n);
|
||||||
|
|
||||||
paddr = zfs_kmap_atomic(bv->bv_page, KM_USER1);
|
paddr = zfs_kmap_atomic(bv->bv_page);
|
||||||
if (rw == UIO_READ)
|
if (rw == UIO_READ)
|
||||||
bcopy(p, paddr + bv->bv_offset + skip, cnt);
|
bcopy(p, paddr + bv->bv_offset + skip, cnt);
|
||||||
else
|
else
|
||||||
bcopy(paddr + bv->bv_offset + skip, p, cnt);
|
bcopy(paddr + bv->bv_offset + skip, p, cnt);
|
||||||
zfs_kunmap_atomic(paddr, KM_USER1);
|
zfs_kunmap_atomic(paddr);
|
||||||
|
|
||||||
skip += cnt;
|
skip += cnt;
|
||||||
if (skip == bv->bv_len) {
|
if (skip == bv->bv_len) {
|
||||||
|
Loading…
Reference in New Issue
Block a user