#include <lustre_disk.h>
#include <lustre_sec.h>
#include <lvfs.h>
+#include <lustre_idmap.h>
+#include <lustre_eacl.h>
/* Data stored per client in the last_rcvd file. In le32 order. */
unsigned long mdt_client_bitmap[(LR_MAX_CLIENTS >> 3) / sizeof(long)];
struct upcall_cache *mdt_identity_cache;
- struct upcall_cache *mdt_rmtacl_cache;
- /* root squash */
- struct rootsquash_info *mdt_rootsquash_info;
+ /* sptlrpc rules */
+ rwlock_t mdt_sptlrpc_lock;
+ struct sptlrpc_rule_set mdt_sptlrpc_rset;
/* capability keys */
unsigned long mdt_capa_timeout;
struct mdt_thread_info {
/*
* XXX: Part One:
- * The following members will be filled expilictly
+ * The following members will be filled explicitly
* with specific data in mdt_thread_info_init().
*/
-
- /*
- * for req-layout interface. This field should be first to be compatible
- * with "struct com_thread_info" in seq and fld.
+ /* TODO: move this into mdt_session_key(with LCT_SESSION), because
+ * request handling may migrate from one server thread to another.
*/
- struct req_capsule mti_pill;
+ struct req_capsule *mti_pill;
+
/* although we have export in req, there are cases when it is not
* available, e.g. closing files upon export destroy */
struct obd_export *mti_exp;
/*
- * number of buffers in reply message.
- */
- int mti_rep_buf_nr;
- /*
- * sizes of reply buffers.
- */
- int mti_rep_buf_size[REQ_MAX_FIELD_NR];
- /*
* A couple of lock handles.
*/
struct mdt_lock_handle mti_lh[MDT_LH_NR];
static inline struct md_object *mdt_object_child(struct mdt_object *o)
{
+ LASSERT(o);
return lu2md(lu_object_next(&o->mot_obj.mo_lu));
}
static inline struct ptlrpc_request *mdt_info_req(struct mdt_thread_info *info)
{
- return info->mti_pill.rc_req;
+ return info->mti_pill ? info->mti_pill->rc_req : NULL;
}
static inline __u64 mdt_conn_flags(struct mdt_thread_info *info)
const struct lu_attr *attr, const struct lu_fid *fid);
int mdt_getxattr(struct mdt_thread_info *info);
-int mdt_setxattr(struct mdt_thread_info *info);
+int mdt_reint_setxattr(struct mdt_thread_info *info,
+ struct mdt_lock_handle *lh);
void mdt_lock_handle_init(struct mdt_lock_handle *lh);
void mdt_lock_handle_fini(struct mdt_lock_handle *lh);
void mdt_dump_lmm(int level, const struct lov_mds_md *lmm);
int mdt_check_ucred(struct mdt_thread_info *);
-
int mdt_init_ucred(struct mdt_thread_info *, struct mdt_body *);
-
int mdt_init_ucred_reint(struct mdt_thread_info *);
-
void mdt_exit_ucred(struct mdt_thread_info *);
-int groups_from_list(struct group_info *, gid_t *);
-
-void groups_sort(struct group_info *);
-
/* mdt_idmap.c */
int mdt_init_idmap(struct mdt_thread_info *);
extern struct upcall_cache_ops mdt_identity_upcall_cache_ops;
-struct mdt_identity *mdt_identity_get(struct upcall_cache *, __u32);
+struct md_identity *mdt_identity_get(struct upcall_cache *, __u32);
-void mdt_identity_put(struct upcall_cache *, struct mdt_identity *);
+void mdt_identity_put(struct upcall_cache *, struct md_identity *);
void mdt_flush_identity(struct upcall_cache *, int);
-__u32 mdt_identity_get_setxid_perm(struct mdt_identity *, __u32, lnet_nid_t);
+__u32 mdt_identity_get_perm(struct md_identity *, __u32, lnet_nid_t);
int mdt_pack_remote_perm(struct mdt_thread_info *, struct mdt_object *, void *);
-/* mdt/mdt_rmtacl.c */
-#define MDT_RMTACL_UPCALL_PATH "/usr/sbin/l_facl"
-
-extern struct upcall_cache_ops mdt_rmtacl_upcall_cache_ops;
-
-int mdt_rmtacl_upcall(struct mdt_thread_info *, char *, struct lu_buf *);
-
extern struct lu_context_key mdt_thread_key;
/* debug issues helper starts here*/
static inline void mdt_fail_write(const struct lu_env *env,