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>
This commit is contained in:
Stefan Haberland
2026-08-05 13:16:00 +02:00
committed by Jens Axboe
parent feea12d1cd
commit 1edac73fa2
2 changed files with 10 additions and 2 deletions

View File

@@ -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;
}

View File

@@ -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;