diff options
Diffstat (limited to 'net/rds/rdma.c')
-rw-r--r-- | net/rds/rdma.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/net/rds/rdma.c b/net/rds/rdma.c index 8dc83d2caa58..971b5a668458 100644 --- a/net/rds/rdma.c +++ b/net/rds/rdma.c | |||
@@ -317,6 +317,30 @@ int rds_get_mr(struct rds_sock *rs, char __user *optval, int optlen) | |||
317 | return __rds_rdma_map(rs, &args, NULL, NULL); | 317 | return __rds_rdma_map(rs, &args, NULL, NULL); |
318 | } | 318 | } |
319 | 319 | ||
320 | int rds_get_mr_for_dest(struct rds_sock *rs, char __user *optval, int optlen) | ||
321 | { | ||
322 | struct rds_get_mr_for_dest_args args; | ||
323 | struct rds_get_mr_args new_args; | ||
324 | |||
325 | if (optlen != sizeof(struct rds_get_mr_for_dest_args)) | ||
326 | return -EINVAL; | ||
327 | |||
328 | if (copy_from_user(&args, (struct rds_get_mr_for_dest_args __user *)optval, | ||
329 | sizeof(struct rds_get_mr_for_dest_args))) | ||
330 | return -EFAULT; | ||
331 | |||
332 | /* | ||
333 | * Initially, just behave like get_mr(). | ||
334 | * TODO: Implement get_mr as wrapper around this | ||
335 | * and deprecate it. | ||
336 | */ | ||
337 | new_args.vec = args.vec; | ||
338 | new_args.cookie_addr = args.cookie_addr; | ||
339 | new_args.flags = args.flags; | ||
340 | |||
341 | return __rds_rdma_map(rs, &new_args, NULL, NULL); | ||
342 | } | ||
343 | |||
320 | /* | 344 | /* |
321 | * Free the MR indicated by the given R_Key | 345 | * Free the MR indicated by the given R_Key |
322 | */ | 346 | */ |