2 * volume_id - reads partition label and uuid
4 * Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org>
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation version 2 of the License.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 675 Mass Ave, Cambridge, MA 02139, USA.
24 #define VOLUME_ID_VERSION 001
26 #define VOLUME_ID_LABEL_SIZE 16
27 #define VOLUME_ID_UUID_SIZE 16
28 #define VOLUME_ID_UUID_STRING_SIZE 37
29 #define VOLUME_ID_PATH_MAX 255
32 enum filesystem_type {
46 char label[VOLUME_ID_LABEL_SIZE];
47 char label_string[VOLUME_ID_LABEL_SIZE+1];
48 unsigned char uuid[VOLUME_ID_UUID_SIZE];
49 char uuid_string[VOLUME_ID_UUID_STRING_SIZE];
50 enum filesystem_type fs_type;
57 /* open volume by already open file descriptor */
58 extern struct volume_id *volume_id_open_fd(int fd);
60 /* open volume by device node */
61 extern struct volume_id *volume_id_open_node(const char *path);
63 /* open volume by major/minor */
64 extern struct volume_id *volume_id_open_dev_t(dev_t devt);
66 /* probe volume for filesystem type and try to read label/uuid */
67 extern int volume_id_probe(struct volume_id *id, enum filesystem_type fs_type);
69 /* free allocated device info */
70 extern void volume_id_close(struct volume_id *id);