Skip to content

Commit ac613e4

Browse files
Christoph Hellwigaxboe
authored andcommitted
scsi/osd: remove the gfp argument to osd_start_request
Always GFP_KERNEL, and keeping it would cause serious complications for the next change. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 058147b commit ac613e4

4 files changed

Lines changed: 18 additions & 24 deletions

File tree

‎drivers/scsi/osd/osd_initiator.c‎

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ static int _osd_get_print_system_info(struct osd_dev *od,
9999
int nelem = ARRAY_SIZE(get_attrs), a = 0;
100100
int ret;
101101

102-
or = osd_start_request(od, GFP_KERNEL);
102+
or = osd_start_request(od);
103103
if (!or)
104104
return -ENOMEM;
105105

@@ -409,16 +409,15 @@ static void _osd_request_free(struct osd_request *or)
409409
kfree(or);
410410
}
411411

412-
struct osd_request *osd_start_request(struct osd_dev *dev, gfp_t gfp)
412+
struct osd_request *osd_start_request(struct osd_dev *dev)
413413
{
414414
struct osd_request *or;
415415

416-
or = _osd_request_alloc(gfp);
416+
or = _osd_request_alloc(GFP_KERNEL);
417417
if (!or)
418418
return NULL;
419419

420420
or->osd_dev = dev;
421-
or->alloc_flags = gfp;
422421
or->timeout = dev->def_timeout;
423422
or->retries = OSD_REQ_RETRIES;
424423

@@ -546,7 +545,7 @@ static int _osd_realloc_seg(struct osd_request *or,
546545
if (seg->alloc_size >= max_bytes)
547546
return 0;
548547

549-
buff = krealloc(seg->buff, max_bytes, or->alloc_flags);
548+
buff = krealloc(seg->buff, max_bytes, GFP_KERNEL);
550549
if (!buff) {
551550
OSD_ERR("Failed to Realloc %d-bytes was-%d\n", max_bytes,
552551
seg->alloc_size);
@@ -728,7 +727,7 @@ static int _osd_req_list_objects(struct osd_request *or,
728727
_osd_req_encode_olist(or, list);
729728

730729
WARN_ON(or->in.bio);
731-
bio = bio_map_kern(q, list, len, or->alloc_flags);
730+
bio = bio_map_kern(q, list, len, GFP_KERNEL);
732731
if (IS_ERR(bio)) {
733732
OSD_ERR("!!! Failed to allocate list_objects BIO\n");
734733
return PTR_ERR(bio);
@@ -1190,14 +1189,14 @@ static int _req_append_segment(struct osd_request *or,
11901189
pad_buff = io->pad_buff;
11911190

11921191
ret = blk_rq_map_kern(io->req->q, io->req, pad_buff, padding,
1193-
or->alloc_flags);
1192+
GFP_KERNEL);
11941193
if (ret)
11951194
return ret;
11961195
io->total_bytes += padding;
11971196
}
11981197

11991198
ret = blk_rq_map_kern(io->req->q, io->req, seg->buff, seg->total_bytes,
1200-
or->alloc_flags);
1199+
GFP_KERNEL);
12011200
if (ret)
12021201
return ret;
12031202

@@ -1564,14 +1563,14 @@ static int _osd_req_finalize_data_integrity(struct osd_request *or,
15641563
* osd_finalize_request and helpers
15651564
*/
15661565
static struct request *_make_request(struct request_queue *q, bool has_write,
1567-
struct _osd_io_info *oii, gfp_t flags)
1566+
struct _osd_io_info *oii)
15681567
{
15691568
struct request *req;
15701569
struct bio *bio = oii->bio;
15711570
int ret;
15721571

15731572
req = blk_get_request(q, has_write ? REQ_OP_SCSI_OUT : REQ_OP_SCSI_IN,
1574-
flags);
1573+
GFP_KERNEL);
15751574
if (IS_ERR(req))
15761575
return req;
15771576

@@ -1589,13 +1588,12 @@ static struct request *_make_request(struct request_queue *q, bool has_write,
15891588
static int _init_blk_request(struct osd_request *or,
15901589
bool has_in, bool has_out)
15911590
{
1592-
gfp_t flags = or->alloc_flags;
15931591
struct scsi_device *scsi_device = or->osd_dev->scsi_device;
15941592
struct request_queue *q = scsi_device->request_queue;
15951593
struct request *req;
15961594
int ret;
15971595

1598-
req = _make_request(q, has_out, has_out ? &or->out : &or->in, flags);
1596+
req = _make_request(q, has_out, has_out ? &or->out : &or->in);
15991597
if (IS_ERR(req)) {
16001598
ret = PTR_ERR(req);
16011599
goto out;
@@ -1611,7 +1609,7 @@ static int _init_blk_request(struct osd_request *or,
16111609
or->out.req = req;
16121610
if (has_in) {
16131611
/* allocate bidi request */
1614-
req = _make_request(q, false, &or->in, flags);
1612+
req = _make_request(q, false, &or->in);
16151613
if (IS_ERR(req)) {
16161614
OSD_DEBUG("blk_get_request for bidi failed\n");
16171615
ret = PTR_ERR(req);

‎fs/exofs/ore.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@ int ore_create(struct ore_io_state *ios)
790790
for (i = 0; i < ios->oc->numdevs; i++) {
791791
struct osd_request *or;
792792

793-
or = osd_start_request(_ios_od(ios, i), GFP_KERNEL);
793+
or = osd_start_request(_ios_od(ios, i));
794794
if (unlikely(!or)) {
795795
ORE_ERR("%s: osd_start_request failed\n", __func__);
796796
ret = -ENOMEM;
@@ -815,7 +815,7 @@ int ore_remove(struct ore_io_state *ios)
815815
for (i = 0; i < ios->oc->numdevs; i++) {
816816
struct osd_request *or;
817817

818-
or = osd_start_request(_ios_od(ios, i), GFP_KERNEL);
818+
or = osd_start_request(_ios_od(ios, i));
819819
if (unlikely(!or)) {
820820
ORE_ERR("%s: osd_start_request failed\n", __func__);
821821
ret = -ENOMEM;
@@ -847,7 +847,7 @@ static int _write_mirror(struct ore_io_state *ios, int cur_comp)
847847
struct ore_per_dev_state *per_dev = &ios->per_dev[cur_comp];
848848
struct osd_request *or;
849849

850-
or = osd_start_request(_ios_od(ios, dev), GFP_KERNEL);
850+
or = osd_start_request(_ios_od(ios, dev));
851851
if (unlikely(!or)) {
852852
ORE_ERR("%s: osd_start_request failed\n", __func__);
853853
ret = -ENOMEM;
@@ -966,7 +966,7 @@ int _ore_read_mirror(struct ore_io_state *ios, unsigned cur_comp)
966966
return 0; /* Just an empty slot */
967967

968968
first_dev = per_dev->dev + first_dev % ios->layout->mirrors_p1;
969-
or = osd_start_request(_ios_od(ios, first_dev), GFP_KERNEL);
969+
or = osd_start_request(_ios_od(ios, first_dev));
970970
if (unlikely(!or)) {
971971
ORE_ERR("%s: osd_start_request failed\n", __func__);
972972
return -ENOMEM;
@@ -1060,7 +1060,7 @@ static int _truncate_mirrors(struct ore_io_state *ios, unsigned cur_comp,
10601060
struct ore_per_dev_state *per_dev = &ios->per_dev[cur_comp];
10611061
struct osd_request *or;
10621062

1063-
or = osd_start_request(_ios_od(ios, cur_comp), GFP_KERNEL);
1063+
or = osd_start_request(_ios_od(ios, cur_comp));
10641064
if (unlikely(!or)) {
10651065
ORE_ERR("%s: osd_start_request failed\n", __func__);
10661066
return -ENOMEM;

‎fs/exofs/super.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ void exofs_make_credential(u8 cred_a[OSD_CAP_LEN], const struct osd_obj_id *obj)
229229
static int exofs_read_kern(struct osd_dev *od, u8 *cred, struct osd_obj_id *obj,
230230
u64 offset, void *p, unsigned length)
231231
{
232-
struct osd_request *or = osd_start_request(od, GFP_KERNEL);
232+
struct osd_request *or = osd_start_request(od);
233233
/* struct osd_sense_info osi = {.key = 0};*/
234234
int ret;
235235

‎include/scsi/osd_initiator.h‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ struct osd_request {
148148
u8 *pad_buff;
149149
} out, in;
150150

151-
gfp_t alloc_flags;
152151
unsigned timeout;
153152
unsigned retries;
154153
unsigned sense_len;
@@ -202,14 +201,11 @@ static inline bool osd_req_is_ver1(struct osd_request *or)
202201
*
203202
* @osd_dev: OSD device that holds the scsi-device and default values
204203
* that the request is associated with.
205-
* @gfp: The allocation flags to use for request allocation, and all
206-
* subsequent allocations. This will be stored at
207-
* osd_request->alloc_flags, can be changed by user later
208204
*
209205
* Allocate osd_request and initialize all members to the
210206
* default/initial state.
211207
*/
212-
struct osd_request *osd_start_request(struct osd_dev *od, gfp_t gfp);
208+
struct osd_request *osd_start_request(struct osd_dev *od);
213209

214210
enum osd_req_options {
215211
OSD_REQ_FUA = 0x08, /* Force Unit Access */

0 commit comments

Comments
 (0)