diff options
| author | Stefan Haberland <sth@linux.ibm.com> | 2026-08-05 13:16:00 +0200 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2026-08-05 06:31:08 -0600 |
| commit | 1edac73fa2e9e8cadf19d59a49d64c681e4e45a3 (patch) | |
| tree | a0afb8ee528bca9ce6102b4bf2b9462a43f092ee | |
| parent | feea12d1cd8110aac009df32d3c6cd1daf117f95 (diff) | |
| download | linux-1edac73fa2e9e8cadf19d59a49d64c681e4e45a3.tar.gz linux-1edac73fa2e9e8cadf19d59a49d64c681e4e45a3.zip | |
s390/dasd: Add defines for the Extended Address Volume track address
The track address of an Extended Address Volume (more than 65520
cylinders) carries the high cylinder bits that do not fit the 16-bit cyl
field in the upper part of the head field. set_ch_t() open-codes the
corresponding shifts; name them so the encoding is explicit and can be
reused.
No functional change.
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Stefan Haberland <sth@linux.ibm.com>
Link: https://patch.msgid.link/20260805111612.1285190-8-sth@linux.ibm.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
| -rw-r--r-- | drivers/s390/block/dasd_eckd.c | 4 | ||||
| -rw-r--r-- | drivers/s390/block/dasd_eckd.h | 8 |
2 files changed, 10 insertions, 2 deletions
diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c index 6e2fd445688c..785aba11066b 100644 --- a/drivers/s390/block/dasd_eckd.c +++ b/drivers/s390/block/dasd_eckd.c @@ -199,8 +199,8 @@ recs_per_track(struct dasd_eckd_characteristics * rdc, static void set_ch_t(struct ch_t *geo, __u32 cyl, __u8 head) { geo->cyl = (__u16) cyl; - geo->head = cyl >> 16; - geo->head <<= 4; + geo->head = cyl >> DASD_EAV_CYL_HI_SHIFT; + geo->head <<= DASD_EAV_HEAD_HI_SHIFT; geo->head |= head; } diff --git a/drivers/s390/block/dasd_eckd.h b/drivers/s390/block/dasd_eckd.h index 763733bcc4d2..bad7ba666370 100644 --- a/drivers/s390/block/dasd_eckd.h +++ b/drivers/s390/block/dasd_eckd.h @@ -146,6 +146,14 @@ struct eckd_count { __u16 dl; } __attribute__ ((packed)); +/* + * Extended Address Volume track address: the head field carries the actual + * head in its low-order 4 bits; the cylinder bits that do not fit the 16-bit + * cyl field are shifted in just above them. + */ +#define DASD_EAV_CYL_HI_SHIFT 16 /* cylinder bits beyond the 16-bit cyl field */ +#define DASD_EAV_HEAD_HI_SHIFT 4 /* head occupies the low-order 4 bits of head */ + struct ch_t { __u16 cyl; __u16 head; |
