Whamcloud - gitweb
b12a0621ec60d4ff4096a1aea404a8232551e5b3
[fs/lustre-release.git] / lustre / include / linux / obd_lov.h
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  */
4
5 #ifndef _OBD_LOV_H__
6 #define _OBD_LOV_H__
7
8 #define OBD_LOV_DEVICENAME "lov"
9
10 struct lov_brw_async_args {
11         obd_count        aa_oa_bufs;
12         struct brw_page *aa_ioarr;
13 };
14
15 struct lov_getattr_async_args {
16         struct lov_stripe_md  *aa_lsm;
17         struct obdo           *aa_oa;
18         struct obdo           *aa_stripe_oas;
19 };
20
21 static inline int lov_stripe_md_size(int stripes)
22 {
23         return sizeof(struct lov_stripe_md) + stripes*sizeof(struct lov_oinfo);
24 }
25
26 static inline int lov_mds_md_size(int stripes)
27 {
28         return sizeof(struct lov_mds_md) + stripes*sizeof(struct lov_object_id);
29 }
30
31 extern int lov_packmd(struct lustre_handle *conn, struct lov_mds_md **lmm,
32                        struct lov_stripe_md *lsm);
33 extern int lov_unpackmd(struct lustre_handle *conn, struct lov_stripe_md **lsm,
34                          struct lov_mds_md *lmm, int lmmsize);
35 extern int lov_setstripe(struct lustre_handle *conn,
36                          struct lov_stripe_md **lsmp, struct lov_mds_md *lmmu);
37 extern int lov_getstripe(struct lustre_handle *conn, 
38                          struct lov_stripe_md *lsm, struct lov_mds_md *lmmu);
39
40 #define IOC_LOV_TYPE                   'g'
41 #define IOC_LOV_MIN_NR                 50
42 #define IOC_LOV_SET_OSC_ACTIVE         _IOWR('g', 50, long)
43 #define IOC_LOV_MAX_NR                 50
44
45 #endif