Re: [PATCH 04/26] net: add a new sockptr_t type

2020-07-23 Thread Christoph Hellwig
On Thu, Jul 23, 2020 at 09:40:27AM -0700, Eric Dumazet wrote: > I am not sure why you chose sockptr_t for something that really seems > generic. > > Or is it really meant to be exclusive to setsockopt() and/or getsockopt() ? > > If the first user of this had been futex code, we would have

Re: [PATCH 04/26] net: add a new sockptr_t type

2020-07-23 Thread Eric Dumazet
On Wed, Jul 22, 2020 at 11:09 PM Christoph Hellwig wrote: > > Add a uptr_t type that can hold a pointer to either a user or kernel > memory region, and simply helpers to copy to and from it. > > Signed-off-by: Christoph Hellwig > --- > include/linux/sockptr.h | 104

Re: [PATCH 04/26] net: add a new sockptr_t type

2020-07-23 Thread Jan Engelhardt
On Thursday 2020-07-23 08:08, Christoph Hellwig wrote: >+typedef struct { >+ union { >+ void*kernel; >+ void __user *user; >+ }; >+ boolis_kernel : 1; >+} sockptr_t; >+ >+static inline bool sockptr_is_null(sockptr_t sockptr)

[PATCH 04/26] net: add a new sockptr_t type

2020-07-23 Thread Christoph Hellwig
Add a uptr_t type that can hold a pointer to either a user or kernel memory region, and simply helpers to copy to and from it. Signed-off-by: Christoph Hellwig --- include/linux/sockptr.h | 104 1 file changed, 104 insertions(+) create mode 100644