]>
Commit | Line | Data |
---|---|---|
3d93ccb7 | 1 | /* |
f302e9e4 NS |
2 | * Copyright (c) 2005 Silicon Graphics, Inc. |
3 | * All Rights Reserved. | |
3d93ccb7 | 4 | * |
f302e9e4 NS |
5 | * This program is free software; you can redistribute it and/or |
6 | * modify it under the terms of the GNU General Public License as | |
3d93ccb7 NS |
7 | * published by the Free Software Foundation. |
8 | * | |
f302e9e4 NS |
9 | * This program is distributed in the hope that it would be useful, |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | * GNU General Public License for more details. | |
3d93ccb7 | 13 | * |
f302e9e4 NS |
14 | * You should have received a copy of the GNU General Public License |
15 | * along with this program; if not, write the Free Software Foundation, | |
16 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
3d93ccb7 | 17 | */ |
0717a7db NS |
18 | #ifndef __PATH_H__ |
19 | #define __PATH_H__ | |
3d93ccb7 | 20 | |
dcabd4e7 | 21 | #include "platform_defs.h" |
3d93ccb7 NS |
22 | |
23 | /* | |
24 | * XFS Filesystem Paths | |
25 | * | |
26 | * Utility routines for iterating and searching through the list | |
27 | * of known mounted filesystems and project paths. | |
28 | */ | |
29 | ||
30 | #define FS_MOUNT_POINT (1<<0) | |
31 | #define FS_PROJECT_PATH (1<<1) | |
29647c8d | 32 | #define FS_FOREIGN (1<<2) |
3d93ccb7 NS |
33 | |
34 | typedef struct fs_path { | |
35 | char *fs_name; /* Data device for filesystem */ | |
36 | dev_t fs_datadev; | |
37 | char *fs_log; /* External log device, if any */ | |
38 | dev_t fs_logdev; | |
39 | char *fs_rt; /* Realtime device, if any */ | |
40 | dev_t fs_rtdev; | |
41 | char *fs_dir; /* Directory / mount point */ | |
e83469ba | 42 | uint fs_flags; /* FS_{MOUNT_POINT,PROJECT_PATH}*/ |
3d93ccb7 NS |
43 | uint fs_prid; /* Project ID for tree root */ |
44 | } fs_path_t; | |
45 | ||
46 | extern int fs_count; /* number of entries in fs table */ | |
bb80e3d6 | 47 | extern int xfs_fs_count; /* number of xfs entries in fs table */ |
3d93ccb7 NS |
48 | extern fs_path_t *fs_table; /* array of entries in fs table */ |
49 | extern fs_path_t *fs_path; /* current entry in the fs table */ | |
50 | extern char *mtab_file; | |
51 | ||
0900efe4 | 52 | extern void fs_table_initialise(int, char *[], int, char *[]); |
3d93ccb7 NS |
53 | extern void fs_table_destroy(void); |
54 | ||
02b26a6d AM |
55 | extern void fs_table_insert_project_path(char *__dir, uint __projid); |
56 | ||
3d93ccb7 NS |
57 | |
58 | extern fs_path_t *fs_table_lookup(const char *__dir, uint __flags); | |
b97815a0 | 59 | extern fs_path_t *fs_table_lookup_mount(const char *__dir); |
3d93ccb7 NS |
60 | |
61 | typedef struct fs_cursor { | |
62 | uint count; /* total count of mount entries */ | |
63 | uint index; /* current position in table */ | |
64 | uint flags; /* iterator flags: mounts/trees */ | |
65 | fs_path_t *table; /* local/global table pointer */ | |
66 | fs_path_t local; /* space for single-entry table */ | |
67 | } fs_cursor_t; | |
68 | ||
69 | extern void fs_cursor_initialise(char *__dir, uint __flags, fs_cursor_t *__cp); | |
70 | extern fs_path_t *fs_cursor_next_entry(fs_cursor_t *__cp); | |
71 | ||
0717a7db | 72 | #endif /* __PATH_H__ */ |