3
* -- this is fallback for old systems where the toplogy information is not
6
* Copyright (C) 2009 Karel Zak <kzak@redhat.com>
8
* This file may be redistributed under the terms of the
9
* GNU Lesser General Public License.
18
#include <sys/ioctl.h>
20
#include <sys/types.h>
25
#define EVMS_MAJOR 117
27
#ifndef _IOT__IOTBASE_u_int32_t
28
#define _IOT__IOTBASE_u_int32_t IOT_SIMPLE(uint32_t)
30
#define _IOT_evms_stripe_info _IOT (_IOTS(uint32_t), 2, 0, 0, 0, 0)
31
#define EVMS_GET_STRIPE_INFO _IOR(EVMS_MAJOR, 0xF0, struct evms_stripe_info)
33
struct evms_stripe_info {
34
uint32_t size; /* stripe unit 512-byte blocks */
35
uint32_t width; /* the number of stripe members or RAID data disks */
38
static int is_evms_device(dev_t devno)
40
if (major(devno) == EVMS_MAJOR)
42
return blkid_driver_has_major("evms", major(devno));
45
static int probe_evms_tp(blkid_probe pr,
46
const struct blkid_idmag *mag __attribute__((__unused__)))
48
struct evms_stripe_info evms;
49
dev_t devno = blkid_probe_get_devno(pr);
52
goto nothing; /* probably not a block device */
54
if (!is_evms_device(devno))
57
memset(&evms, 0, sizeof(evms));
59
if (ioctl(pr->fd, EVMS_GET_STRIPE_INFO, &evms))
62
blkid_topology_set_minimum_io_size(pr, evms.size << 9);
63
blkid_topology_set_optimal_io_size(pr, (evms.size * evms.width) << 9);
71
const struct blkid_idinfo evms_tp_idinfo =
74
.probefunc = probe_evms_tp,
75
.magics = BLKID_NONE_MAGIC