Whamcloud - gitweb
b=22235 llapi_uuid_match() prints bogus error message on upgraded filesystem
[fs/lustre-release.git] / lustre / utils / obdiolib.h
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  *
4  * GPL HEADER START
5  *
6  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License version 2 only,
10  * as published by the Free Software Foundation.
11  *
12  * This program is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * General Public License version 2 for more details (a copy is included
16  * in the LICENSE file that accompanied this code).
17  *
18  * You should have received a copy of the GNU General Public License
19  * version 2 along with this program; If not, see
20  * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
21  *
22  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
23  * CA 95054 USA or visit www.sun.com if you need additional information or
24  * have any questions.
25  *
26  * GPL HEADER END
27  */
28 /*
29  * Copyright  2008 Sun Microsystems, Inc. All rights reserved
30  * Use is subject to license terms.
31  */
32 /*
33  * This file is part of Lustre, http://www.lustre.org/
34  * Lustre is a trademark of Sun Microsystems, Inc.
35  */
36
37 #ifndef _OBDIOLIB_H_
38 #define _OBDIOLIB_H_
39
40 #include <unistd.h>
41
42 #include <sys/types.h>
43 #include <sys/stat.h>
44
45 #include <lustre_lib.h>
46 #include <lustre/lustre_idl.h>
47 #include <obd_class.h>
48
49 struct obdio_conn {
50         int                    oc_fd;
51         __u32                  oc_device;
52         struct obd_ioctl_data  oc_data;
53         char                   oc_buffer[8192];
54 };
55
56 struct obdio_barrier {
57         __u64                  ob_id;
58         __u64                  ob_oid;
59         __u64                  ob_npeers;
60         __u64                  ob_ordinal;
61         __u64                  ob_count;
62 };
63
64 extern struct obdio_conn *obdio_connect(int device);
65 extern void obdio_disconnect(struct obdio_conn *conn, int flags);
66 extern int obdio_open(struct obdio_conn *conn, __u64 oid,
67                       struct lustre_handle *fh);
68 extern int obdio_close(struct obdio_conn *conn, __u64 oid,
69                        struct lustre_handle *fh);
70 extern int obdio_pread(struct obdio_conn *conn, __u64 oid,
71                        void *buffer, __u32 count, __u64 offset);
72 extern int obdio_pwrite(struct obdio_conn *conn, __u64 oid,
73                         void *buffer, __u32 count, __u64 offset);
74 extern int obdio_enqueue(struct obdio_conn *conn, __u64 oid,
75                          int mode, __u64 offset, __u32 count,
76                          struct lustre_handle *lh);
77 extern int obdio_cancel(struct obdio_conn *conn, struct lustre_handle *lh);
78 extern void *obdio_alloc_aligned_buffer(void **spacep, int size);
79 extern struct obdio_barrier *obdio_new_barrier(__u64 oid, __u64 id,
80                                                int npeers);
81 extern int obdio_setup_barrier(struct obdio_conn *conn,struct obdio_barrier *b);
82 extern int obdio_barrier(struct obdio_conn *conn, struct obdio_barrier *b);
83
84 #endif