1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
4 * This file is part of Lustre, http://www.lustre.org
7 * See also lustre_idl.h for wire formats of requests.
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>
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>
28 #error Unsupported operating system.
31 struct ldlm_lock_desc;
33 struct ptlrpc_connection;
36 struct ptlrpc_request;
40 struct mds_update_record {
42 struct ll_fid *ur_fid1;
43 struct ll_fid *ur_fid2;
51 struct llog_cookie *ur_logcookies;
52 struct iattr ur_iattr;
53 struct lvfs_ucred ur_uc;
58 struct lvfs_grp_hash_entry *ur_grp_entry;
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 */
68 struct dentry *mfd_dentry;
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))
77 #define LUSTRE_POSIX_ACL_MAX_SIZE 0
83 int mds_reint_rec(struct mds_update_record *r, int offset,
84 struct ptlrpc_request *req, struct lustre_handle *);
86 int md_lov_connect(struct obd_device *obd, struct md_lov_info *mli,
87 char *lov_name, struct obd_uuid *uuid,
88 struct md_lov_ops *mlo, const void *ctxt);
89 int md_lov_notity_pre(struct obd_device *obd, struct md_lov_info *mli,
90 struct obd_device *watched, enum obd_notify_event ev,
92 int md_lov_start_synchronize(struct obd_device *obd, struct md_lov_info *mli,
93 struct obd_device *watched,
94 void *data, int nonblock, const void *ctxt);
95 int mds_log_op_unlink(struct obd_device *obd, struct inode *inode,
96 struct lov_mds_md *lmm, int lmm_size,
97 struct llog_cookie *logcookies, int cookies_size);
98 int mds_log_op_setattr(struct obd_device *obd, struct inode *inode,
99 struct lov_mds_md *lmm, int lmm_size,
100 struct llog_cookie *logcookies, int cookies_size);
102 /* ioctls for trying requests */
103 #define IOC_REQUEST_TYPE 'f'
104 #define IOC_REQUEST_MIN_NR 30
106 #define IOC_REQUEST_GETATTR _IOWR('f', 30, long)
107 #define IOC_REQUEST_READPAGE _IOWR('f', 31, long)
108 #define IOC_REQUEST_SETATTR _IOWR('f', 32, long)
109 #define IOC_REQUEST_CREATE _IOWR('f', 33, long)
110 #define IOC_REQUEST_OPEN _IOWR('f', 34, long)
111 #define IOC_REQUEST_CLOSE _IOWR('f', 35, long)
112 #define IOC_REQUEST_MAX_NR 35
114 #define MDS_LOV_MD_NAME "trusted.lov"
115 #define MDD_OBD_NAME "mdd_obd"
116 #define MDD_OBD_UUID "mdd_obd_uuid"
117 #define MDD_OBD_TYPE "mds"
118 #define MDD_OBD_PROFILE "lustre-MDT0000"