Whamcloud - gitweb
- update from b1_4_mountconf
[fs/lustre-release.git] / lustre / include / lustre_mds.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  * MDS data structures.
7  * See also lustre_idl.h for wire formats of requests.
8  */
9
10 #ifndef _LUSTRE_MDS_H
11 #define _LUSTRE_MDS_H
12
13 #include <lustre_handles.h>
14 #include <libcfs/kp30.h>
15 #include <lustre/lustre_idl.h>
16 #include <lustre_lib.h>
17 #include <lustre_dlm.h>
18 #include <lustre_log.h>
19 #include <lustre_export.h>
20
21 #if defined(__linux__)
22 #include <linux/lustre_mds.h>
23 #elif defined(__APPLE__)
24 #include <darwin/lustre_mds.h>
25 #elif defined(__WINNT__)
26 #include <winnt/lustre_mds.h>
27 #else
28 #error Unsupported operating system.
29 #endif
30
31 struct ldlm_lock_desc;
32 struct mds_obd;
33 struct ptlrpc_connection;
34 struct ptlrpc_client;
35 struct obd_export;
36 struct ptlrpc_request;
37 struct obd_device;
38 struct ll_file_data;
39
40 struct mds_update_record {
41         __u32 ur_opcode;
42         struct ll_fid *ur_fid1;
43         struct ll_fid *ur_fid2;
44         int ur_namelen;
45         char *ur_name;
46         int ur_tgtlen;
47         char *ur_tgt;
48         int ur_eadatalen;
49         void *ur_eadata;
50         int ur_cookielen;
51         struct llog_cookie *ur_logcookies;
52         struct iattr ur_iattr;
53         struct lvfs_ucred ur_uc;
54         __u64 ur_rdev;
55         __u64 ur_time;
56         __u32 ur_mode;
57         __u32 ur_flags;
58         struct lvfs_grp_hash_entry *ur_grp_entry;
59 };
60
61 /* file data for open files on MDS */
62 struct mds_file_data {
63         struct portals_handle mfd_handle; /* must be first */
64         atomic_t              mfd_refcount;
65         struct list_head      mfd_list; /* protected by med_open_lock */
66         __u64                 mfd_xid;
67         int                   mfd_mode;
68         struct dentry        *mfd_dentry;
69 };
70
71 /* ACL */
72 #ifdef CONFIG_FS_POSIX_ACL
73 #define LUSTRE_POSIX_ACL_MAX_ENTRIES    (32)
74 #define LUSTRE_POSIX_ACL_MAX_SIZE       \
75                 (xattr_acl_size(LUSTRE_POSIX_ACL_MAX_ENTRIES))
76 #else
77 #define LUSTRE_POSIX_ACL_MAX_SIZE       0
78 #endif
79
80 /* mds/mds_reint.c */
81 int mds_reint_rec(struct mds_update_record *r, int offset,
82                   struct ptlrpc_request *req, struct lustre_handle *);
83
84 /* ioctls for trying requests */
85 #define IOC_REQUEST_TYPE                   'f'
86 #define IOC_REQUEST_MIN_NR                 30
87
88 #define IOC_REQUEST_GETATTR             _IOWR('f', 30, long)
89 #define IOC_REQUEST_READPAGE            _IOWR('f', 31, long)
90 #define IOC_REQUEST_SETATTR             _IOWR('f', 32, long)
91 #define IOC_REQUEST_CREATE              _IOWR('f', 33, long)
92 #define IOC_REQUEST_OPEN                _IOWR('f', 34, long)
93 #define IOC_REQUEST_CLOSE               _IOWR('f', 35, long)
94 #define IOC_REQUEST_MAX_NR               35
95
96 #endif