Whamcloud - gitweb
b=13128
[fs/lustre-release.git] / lustre / include / lustre / liblustreapi.h
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  *
4  *   This file is part of Lustre, http://www.lustre.org
5  */
6 #ifndef _LIBLUSTREAPI_H_
7 #define _LIBLUSTREAPI_H_
8
9 #include <lustre/lustre_user.h>
10
11 typedef void (*llapi_cb_t)(char *obd_type_name, char *obd_name, char *obd_uuid, void *args);
12
13 /* liblustreapi.c */
14 extern int llapi_file_create(const char *name, unsigned long stripe_size,
15                              int stripe_offset, int stripe_count,
16                              int stripe_pattern);
17 extern int llapi_file_open(const char *name, int flags, int mode,
18                            unsigned long stripe_size, int stripe_offset,
19                            int stripe_count, int stripe_pattern);
20 extern int llapi_file_get_stripe(const char *path, struct lov_user_md *lum);
21 #define HAVE_LLAPI_FILE_LOOKUP
22 extern int llapi_file_lookup(int dirfd, const char *name);
23  
24 struct find_param {
25         unsigned int maxdepth;
26         time_t  atime;
27         time_t  mtime;
28         time_t  ctime;
29         int     asign;
30         int     csign;
31         int     msign;
32         int     type;
33
34         unsigned zeroend:1, recursive:1, got_uuids:1, obds_printed:1, exclude_pattern:1, exclude_type:1;
35
36         int     verbose;
37         int     quiet;
38
39         /* regular expression */
40         char   *pattern;
41
42         char   *print_fmt;
43
44         struct  obd_uuid        *obduuid;
45         int     obdindex;
46
47         int     lumlen;
48         struct  lov_user_mds_data *lmd;
49
50         /* In-precess parameters. */
51         unsigned int depth;
52         dev_t   st_dev;
53 };
54
55 extern int llapi_getstripe(char *path, struct find_param *param);
56 extern int llapi_find(char *path, struct find_param *param);
57
58 extern int llapi_obd_statfs(char *path, __u32 type, __u32 index,
59                      struct obd_statfs *stat_buf,
60                      struct obd_uuid *uuid_buf);
61 extern int llapi_ping(char *obd_type, char *obd_name);
62 extern int llapi_target_check(int num_types, char **obd_types, char *dir);
63 extern int llapi_catinfo(char *dir, char *keyword, char *node_name);
64 extern int llapi_lov_get_uuids(int fd, struct obd_uuid *uuidp, int *ost_count);
65 extern int llapi_is_lustre_mnttype(const char *type);
66 struct mntent;
67 #define HAVE_LLAPI_IS_LUSTRE_MNT
68 extern int llapi_is_lustre_mnt(struct mntent *mnt);
69 extern int llapi_quotachown(char *path, int flag);
70 extern int llapi_quotacheck(char *mnt, int check_type);
71 extern int llapi_poll_quotacheck(char *mnt, struct if_quotacheck *qchk);
72 extern int llapi_quotactl(char *mnt, struct if_quotactl *qctl);
73 extern int llapi_target_iterate(int type_num, char **obd_type, void *args, llapi_cb_t cb);
74 extern int llapi_getfacl(char *fname, char *cmd);
75 extern int llapi_setfacl(char *fname, char *cmd);
76 #endif