~ubuntu-branches/ubuntu/edgy/xfsprogs/edgy

« back to all changes in this revision

Viewing changes to include/path.h

  • Committer: Bazaar Package Importer
  • Author(s): Nathan Scott
  • Date: 2005-11-16 16:32:35 UTC
  • Revision ID: james.westby@ubuntu.com-20051116163235-synnef6xjj18ny42
Tags: 2.7.7-1
* New upstream release.
* Add support for (optional) ATTR2 format extension (closes: #336350)
* Allow gcc -pedantic option for C++ <xfs.h> users (closes: #249429)
* Fix segv in xfs_db frag command (closes: #338207)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (c) 2005 Silicon Graphics, Inc.
 
3
 * All Rights Reserved.
 
4
 *
 
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
 
7
 * published by the Free Software Foundation.
 
8
 *
 
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.
 
13
 *
 
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
 
17
 */
 
18
#ifndef __PATH_H__
 
19
#define __PATH_H__
 
20
 
 
21
#include <xfs/xfs.h>
 
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)
 
32
 
 
33
typedef struct fs_path {
 
34
        char            *fs_name;       /* Data device for filesystem   */
 
35
        dev_t           fs_datadev;
 
36
        char            *fs_log;        /* External log device, if any  */
 
37
        dev_t           fs_logdev;
 
38
        char            *fs_rt;         /* Realtime device, if any      */
 
39
        dev_t           fs_rtdev;
 
40
        char            *fs_dir;        /* Directory / mount point      */
 
41
        uint            fs_flags;       /* FS_{MOUNT_POINT,PROJECT_PATH}*/
 
42
        uint            fs_prid;        /* Project ID for tree root     */
 
43
} fs_path_t;
 
44
 
 
45
extern int fs_count;            /* number of entries in fs table */
 
46
extern fs_path_t *fs_table;     /* array of entries in fs table  */
 
47
extern fs_path_t *fs_path;      /* current entry in the fs table */
 
48
extern char *mtab_file;
 
49
 
 
50
extern void fs_table_initialise(void);
 
51
extern void fs_table_destroy(void);
 
52
 
 
53
extern void fs_table_insert_mount(char *__mount);
 
54
extern void fs_table_insert_project(char *__project);
 
55
 
 
56
extern fs_path_t *fs_table_lookup(const char *__dir, uint __flags);
 
57
 
 
58
typedef struct fs_cursor {
 
59
        uint            count;          /* total count of mount entries */
 
60
        uint            index;          /* current position in table    */
 
61
        uint            flags;          /* iterator flags: mounts/trees */
 
62
        fs_path_t       *table;         /* local/global table pointer   */
 
63
        fs_path_t       local;          /* space for single-entry table */
 
64
} fs_cursor_t;
 
65
 
 
66
extern void fs_cursor_initialise(char *__dir, uint __flags, fs_cursor_t *__cp);
 
67
extern fs_path_t *fs_cursor_next_entry(fs_cursor_t *__cp);
 
68
 
 
69
#endif  /* __PATH_H__ */