- if (!o->min_bs[DDIR_READ])
- o->min_bs[DDIR_READ] = o->bs[DDIR_READ];
- if (!o->max_bs[DDIR_READ])
- o->max_bs[DDIR_READ] = o->bs[DDIR_READ];
- if (!o->min_bs[DDIR_WRITE])
- o->min_bs[DDIR_WRITE] = o->bs[DDIR_WRITE];
- if (!o->max_bs[DDIR_WRITE])
- o->max_bs[DDIR_WRITE] = o->bs[DDIR_WRITE];
- if (!o->min_bs[DDIR_TRIM])
- o->min_bs[DDIR_TRIM] = o->bs[DDIR_TRIM];
- if (!o->max_bs[DDIR_TRIM])
- o->max_bs[DDIR_TRIM] = o->bs[DDIR_TRIM];
-
- o->rw_min_bs = min(o->min_bs[DDIR_READ], o->min_bs[DDIR_WRITE]);
- o->rw_min_bs = min(o->min_bs[DDIR_TRIM], o->rw_min_bs);
+ for_each_rw_ddir(ddir) {
+ if (!o->min_bs[ddir])
+ o->min_bs[ddir] = o->bs[ddir];
+ if (!o->max_bs[ddir])
+ o->max_bs[ddir] = o->bs[ddir];
+ }
+
+ o->rw_min_bs = -1;
+ for_each_rw_ddir(ddir) {
+ o->rw_min_bs = min(o->rw_min_bs, o->min_bs[ddir]);
+ }