[PATCH net-next v4 7/8] net: netmem: add netmem_is_pfmemalloc() helper function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The netmem_is_pfmemalloc() is a netmem version of page_is_pfmemalloc().

Tested-by: Stanislav Fomichev <sdf@xxxxxxxxxxx>
Suggested-by: Mina Almasry <almasrymina@xxxxxxxxxx>
Signed-off-by: Taehee Yoo <ap420073@xxxxxxxxx>
---

v4:
 - Patch added.

 include/net/netmem.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/include/net/netmem.h b/include/net/netmem.h
index 8a6e20be4b9d..49ae2bf05362 100644
--- a/include/net/netmem.h
+++ b/include/net/netmem.h
@@ -171,4 +171,12 @@ static inline unsigned long netmem_get_dma_addr(netmem_ref netmem)
 	return __netmem_clear_lsb(netmem)->dma_addr;
 }
 
+static inline bool netmem_is_pfmemalloc(netmem_ref netmem)
+{
+	if (netmem_is_net_iov(netmem))
+		return false;
+
+	return page_is_pfmemalloc(netmem_to_page(netmem));
+}
+
 #endif /* _NET_NETMEM_H */
-- 
2.34.1





[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux