net/rds: Detect need of On-Demand-Paging memory registration
Add code to check if memory intended for RDMA is FS-DAX-memory. RDS will fail with error code EOPNOTSUPP if FS-DAX-memory is detected. Signed-off-by: Hans Westgaard Ry <hans.westgaard.ry@oracle.com> Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
This commit is contained in:
parent
8ffc324851
commit
c4c86abb3f
|
@ -156,11 +156,13 @@ void rds_rdma_drop_keys(struct rds_sock *rs)
|
||||||
static int rds_pin_pages(unsigned long user_addr, unsigned int nr_pages,
|
static int rds_pin_pages(unsigned long user_addr, unsigned int nr_pages,
|
||||||
struct page **pages, int write)
|
struct page **pages, int write)
|
||||||
{
|
{
|
||||||
|
unsigned int gup_flags = FOLL_LONGTERM;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = get_user_pages_fast(user_addr, nr_pages, write ? FOLL_WRITE : 0,
|
if (write)
|
||||||
pages);
|
gup_flags |= FOLL_WRITE;
|
||||||
|
|
||||||
|
ret = get_user_pages_fast(user_addr, nr_pages, gup_flags, pages);
|
||||||
if (ret >= 0 && ret < nr_pages) {
|
if (ret >= 0 && ret < nr_pages) {
|
||||||
while (ret--)
|
while (ret--)
|
||||||
put_page(pages[ret]);
|
put_page(pages[ret]);
|
||||||
|
|
Loading…
Reference in New Issue