mirror of
https://github.com/schoebel/mars
synced 2025-01-18 05:11:35 +00:00
bio: adapt to REQ_IDLE in place of NOIDLE
This commit is contained in:
parent
e2d37327cd
commit
2176f6ee13
@ -434,14 +434,19 @@ void _bio_ref_io(struct bio_output *output, struct mref_object *mref, bool cork)
|
||||
bio_get(bio);
|
||||
|
||||
rw = mref->ref_rw & 1;
|
||||
if (brick->do_noidle && !cork) {
|
||||
if (cork) {
|
||||
// adapt to different kernel versions (TBD: improve)
|
||||
#ifdef REQ_IDLE
|
||||
rw |= REQ_IDLE;
|
||||
#else /* sorry this went clumsy over time, adaptation to _any_ kernel is a hell */
|
||||
} else {
|
||||
#if defined(BIO_RW_RQ_MASK) || defined(BIO_FLUSH)
|
||||
rw |= (1 << BIO_RW_NOIDLE);
|
||||
#elif defined(REQ_NOIDLE)
|
||||
rw |= REQ_NOIDLE;
|
||||
#else
|
||||
#warning Cannot control the NOIDLE flag
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
if (!mref->ref_skip_sync) {
|
||||
|
@ -61,7 +61,6 @@ struct bio_brick {
|
||||
int ra_pages;
|
||||
int bg_threshold;
|
||||
int bg_maxfly;
|
||||
bool do_noidle;
|
||||
bool do_sync;
|
||||
bool do_unplug;
|
||||
// readonly
|
||||
|
@ -354,7 +354,6 @@ int _set_server_bio_params(struct mars_brick *_brick, void *private)
|
||||
}
|
||||
bio_brick = (void*)_brick;
|
||||
bio_brick->ra_pages = 0;
|
||||
bio_brick->do_noidle = true;
|
||||
bio_brick->do_sync = true;
|
||||
bio_brick->do_unplug = true;
|
||||
MARS_INF("name = '%s' path = '%s'\n", _brick->brick_name, _brick->brick_path);
|
||||
|
@ -698,7 +698,6 @@ int mars_mem_gb = 16;
|
||||
|
||||
#define BIO_READAHEAD 0
|
||||
//#define BIO_READAHEAD 1
|
||||
#define BIO_NOIDLE true
|
||||
#define BIO_SYNC true
|
||||
#define BIO_UNPLUG true
|
||||
|
||||
@ -816,7 +815,6 @@ int _set_bio_params(struct mars_brick *_brick, void *private)
|
||||
}
|
||||
bio_brick = (void*)_brick;
|
||||
bio_brick->ra_pages = BIO_READAHEAD;
|
||||
bio_brick->do_noidle = BIO_NOIDLE;
|
||||
bio_brick->do_sync = BIO_SYNC;
|
||||
bio_brick->do_unplug = BIO_UNPLUG;
|
||||
bio_brick->killme = true;
|
||||
|
Loading…
Reference in New Issue
Block a user