]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - libfrog/paths.h
libfrog: fix bitmap error communication problems
[thirdparty/xfsprogs-dev.git] / libfrog / paths.h
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3 * Copyright (c) 2005 Silicon Graphics, Inc.
4 * All Rights Reserved.
5 */
6 #ifndef __LIBFROG_PATH_H__
7 #define __LIBFROG_PATH_H__
8
9 #include "platform_defs.h"
10
11 /*
12 * XFS Filesystem Paths
13 *
14 * Utility routines for iterating and searching through the list
15 * of known mounted filesystems and project paths.
16 */
17
18 #define FS_MOUNT_POINT (1<<0)
19 #define FS_PROJECT_PATH (1<<1)
20 #define FS_FOREIGN (1<<2)
21
22 typedef struct fs_path {
23 char *fs_name; /* Data device for filesystem */
24 dev_t fs_datadev;
25 char *fs_log; /* External log device, if any */
26 dev_t fs_logdev;
27 char *fs_rt; /* Realtime device, if any */
28 dev_t fs_rtdev;
29 char *fs_dir; /* Directory / mount point */
30 uint fs_flags; /* FS_{MOUNT_POINT,PROJECT_PATH}*/
31 uint fs_prid; /* Project ID for tree root */
32 } fs_path_t;
33
34 extern int fs_count; /* number of entries in fs table */
35 extern int xfs_fs_count; /* number of xfs entries in fs table */
36 extern fs_path_t *fs_table; /* array of entries in fs table */
37 extern fs_path_t *fs_path; /* current entry in the fs table */
38 extern char *mtab_file;
39
40 extern void fs_table_initialise(int, char *[], int, char *[]);
41 extern void fs_table_destroy(void);
42
43 extern void fs_table_insert_project_path(char *__dir, uint __projid);
44
45
46 extern fs_path_t *fs_table_lookup(const char *__dir, uint __flags);
47 extern fs_path_t *fs_table_lookup_mount(const char *__dir);
48 extern fs_path_t *fs_table_lookup_blkdev(const char *bdev);
49
50 typedef struct fs_cursor {
51 uint count; /* total count of mount entries */
52 uint index; /* current position in table */
53 uint flags; /* iterator flags: mounts/trees */
54 fs_path_t *table; /* local/global table pointer */
55 fs_path_t local; /* space for single-entry table */
56 } fs_cursor_t;
57
58 extern void fs_cursor_initialise(char *__dir, uint __flags, fs_cursor_t *__cp);
59 extern fs_path_t *fs_cursor_next_entry(fs_cursor_t *__cp);
60
61 #endif /* __LIBFROG_PATH_H__ */