Skip to content

Commit aaa2faa

Browse files
committed
Merge tag 'for-linus-5.8-ofs1' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux
Pull orangefs updates from Mike Marshall: - John Hubbard's conversion from get_user_pages() to pin_user_pages() - Colin Ian King's removal of an unneeded variable initialization * tag 'for-linus-5.8-ofs1' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux: orangefs: convert get_user_pages() --> pin_user_pages() orangefs: remove redundant assignment to variable ret
2 parents e3cea0c + 0df5564 commit aaa2faa

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

fs/orangefs/orangefs-bufmap.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,7 @@ static DEFINE_SPINLOCK(orangefs_bufmap_lock);
168168
static void
169169
orangefs_bufmap_unmap(struct orangefs_bufmap *bufmap)
170170
{
171-
int i;
172-
173-
for (i = 0; i < bufmap->page_count; i++)
174-
put_page(bufmap->page_array[i]);
171+
unpin_user_pages(bufmap->page_array, bufmap->page_count);
175172
}
176173

177174
static void
@@ -268,7 +265,7 @@ orangefs_bufmap_map(struct orangefs_bufmap *bufmap,
268265
int offset = 0, ret, i;
269266

270267
/* map the pages */
271-
ret = get_user_pages_fast((unsigned long)user_desc->ptr,
268+
ret = pin_user_pages_fast((unsigned long)user_desc->ptr,
272269
bufmap->page_count, FOLL_WRITE, bufmap->page_array);
273270

274271
if (ret < 0)
@@ -280,7 +277,7 @@ orangefs_bufmap_map(struct orangefs_bufmap *bufmap,
280277

281278
for (i = 0; i < ret; i++) {
282279
SetPageError(bufmap->page_array[i]);
283-
put_page(bufmap->page_array[i]);
280+
unpin_user_page(bufmap->page_array[i]);
284281
}
285282
return -ENOMEM;
286283
}

fs/orangefs/orangefs-mod.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ DECLARE_WAIT_QUEUE_HEAD(orangefs_request_list_waitq);
7979

8080
static int __init orangefs_init(void)
8181
{
82-
int ret = -1;
82+
int ret;
8383
__u32 i = 0;
8484

8585
if (op_timeout_secs < 0)

0 commit comments

Comments
 (0)