Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1503010
| From | Lorenzo Stoakes <lstoakes@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 04/10] mm: replace get_user_pages_locked() write/force parameters with gup_flags |
| Date | 2016-10-18 16:00 +0200 |
| Message-ID | <stD5T-2pf-7@gated-at.bofh.it> (permalink) |
| References | <srC4h-3JZ-3@gated-at.bofh.it> <srHnj-87T-11@gated-at.bofh.it> <stC9Q-1M3-31@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Tue, Oct 18, 2016 at 02:54:25PM +0200, Jan Kara wrote: > > @@ -1282,7 +1282,7 @@ long get_user_pages(unsigned long start, unsigned long nr_pages, > > int write, int force, struct page **pages, > > struct vm_area_struct **vmas); > > long get_user_pages_locked(unsigned long start, unsigned long nr_pages, > > - int write, int force, struct page **pages, int *locked); > > + unsigned int gup_flags, struct page **pages, int *locked); > > Hum, the prototype is inconsistent with e.g. __get_user_pages_unlocked() > where gup_flags come after **pages argument. Actually it makes more sense > to have it before **pages so that input arguments come first and output > arguments second but I don't care that much. But it definitely should be > consistent... It was difficult to decide quite how to arrange parameters as there was inconsitency with regards to parameter ordering already - for example __get_user_pages() places its flags argument before pages whereas, as you note, __get_user_pages_unlocked() puts them afterwards. I ended up compromising by trying to match the existing ordering of the function as much as I could by replacing write, force pairs with gup_flags in the same location (with the exception of get_user_pages_unlocked() which I felt should match __get_user_pages_unlocked() in signature) or if there was already a gup_flags parameter as in the case of __get_user_pages_unlocked() I simply removed the write, force pair and left the flags as the last parameter. I am happy to rearrange parameters as needed, however I am not sure if it'd be worthwhile for me to do so (I am keen to try to avoid adding too much noise here :) If we were to rearrange parameters for consistency I'd suggest adjusting __get_user_pages_unlocked() to put gup_flags before pages and do the same with get_user_pages_unlocked(), let me know what you think.
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 04/10] mm: replace get_user_pages_locked() write/force parameters with gup_flags Lorenzo Stoakes <lstoakes@gmail.com> - 2016-10-13 08:10 +0200
Re: [PATCH 04/10] mm: replace get_user_pages_locked() write/force parameters with gup_flags Jan Kara <jack@suse.cz> - 2016-10-18 15:00 +0200
Re: [PATCH 04/10] mm: replace get_user_pages_locked() write/force parameters with gup_flags Lorenzo Stoakes <lstoakes@gmail.com> - 2016-10-18 16:00 +0200
Re: [PATCH 04/10] mm: replace get_user_pages_locked() write/force parameters with gup_flags Jan Kara <jack@suse.cz> - 2016-10-19 09:40 +0200
Re: [PATCH 04/10] mm: replace get_user_pages_locked() write/force parameters with gup_flags Jan Kara <jack@suse.cz> - 2016-10-19 17:30 +0200
csiph-web