diff options
author | Theodore Ts'o <tytso@mit.edu> | 2003-01-25 18:44:33 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2003-01-25 18:44:33 -0500 |
commit | 0f3ac480c76d4574b9274de22784e76fd627ad6a (patch) | |
tree | 08092749b9d987926b4fb2788fb996ae5ad233d2 /lib/blkid/devname.c | |
parent | d3f917989badf78d1f97654e46d60d1f3d25cd17 (diff) | |
download | e2fsprogs-0f3ac480c76d4574b9274de22784e76fd627ad6a.tar.gz |
devname.c: Add support for EVMS to the blkid library.
Diffstat (limited to 'lib/blkid/devname.c')
-rw-r--r-- | lib/blkid/devname.c | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/lib/blkid/devname.c b/lib/blkid/devname.c index cbbf50df..e1c2c1d8 100644 --- a/lib/blkid/devname.c +++ b/lib/blkid/devname.c @@ -2,7 +2,7 @@ * devname.c - get a dev by its device inode name * * Copyright (C) Andries Brouwer - * Copyright (C) 1999, 2000, 2001 Theodore Ts'o + * Copyright (C) 1999, 2000, 2001, 2002, 2003 Theodore Ts'o * Copyright (C) 2001 Andreas Dilger * * %Begin-Header% @@ -234,6 +234,34 @@ exit: } #endif +#define PROC_EVMS_VOLUMES "/proc/evms/volumes" + +static int +evms_probe_all(blkid_cache **cache) +{ + char line[100]; + int ma, mi, sz, num = 0; + FILE *procpt; + char device[110]; + + procpt = fopen(PROC_EVMS_VOLUMES, "r"); + if (!procpt) + return 0; + while (fgets(line, sizeof(line), procpt)) { + if (sscanf (line, " %d %d %d %*s %*s %[^\n ]", + &ma, &mi, &sz, device) != 4) + continue; + + DBG(printf("Checking partition %s (%d, %d)\n", + device, ma, mi)); + + probe_one(*cache, device, ma, mi, sz << 10); + num++; + } + fclose(procpt); + return num; +} + /* * Read the device data for all available block devices in the system. */ @@ -255,6 +283,9 @@ int blkid_probe_all(blkid_cache **cache) time(0) - (*cache)->bic_time < BLKID_PROBE_INTERVAL) return 0; + if (evms_probe_all(cache)) + goto finish; + #ifdef VG_DIR lvm_probe_all(cache); #endif @@ -333,6 +364,7 @@ int blkid_probe_all(blkid_cache **cache) } fclose(proc); +finish: (*cache)->bic_time = time(0); (*cache)->bic_flags |= BLKID_BIC_FL_PROBED; |