On Wed, Aug 07, 2019 at 01:42:43PM +0200, Douglas Gilbert wrote: > Remove the fixed size array of 16 request elements per file > descriptor and replace with two linked lists per file descriptor. > One list is for active commands, the other list is a free list. > sg_request objects are now kept, available for re-use, until > their owning file descriptor is closed. The sg_request deletions > are now in sg_remove_sfp_usercontext(). Each active sg_request > has associated block request and scsi_request objects which are > released much earlier; their lifetime is the same as it was in > the v3 sg driver. The lifetime of the bio is also the same (but > is stretched in a later patch). Willy would probably want you to use an xarray. > Add an enum for request state (sg_rq_state) and collect > various flags into bit maps: one for requests (SG_FRQ_*) and > the other for file descriptors (SG_FFD_*). They join a > per sg_device bit map (SG_FDEV_*) added in an earlier > patch. > > Prior to a new sg_request object being (re-)built, information > that will be placed in it uses a new struct sg_comm_wr_t > object. > > Since the above changes touch almost every function and low > level structures, this patch is big. With so many changes, the > diff utility that generates the patch sometimes loses track. There seem to be a lot of rather unrelated changes here. Also please don't use __put_user/__get_user for that same reason that drivers should not use __copy_to_user/__copy_from_user.