void lustre_swab_llog_rec(struct llog_rec_hdr *rec);
void lustre_swab_llog_id(struct llog_logid *lid);
void lustre_swab_lu_seq_range(struct lu_seq_range *range);
+#ifdef HAVE_SERVER_SUPPORT
void lustre_swab_update_ops(struct update_ops *uops, unsigned int op_count);
+#endif
void lustre_swab_lustre_cfg(struct lustre_cfg *lcfg);
void lustre_swab_cfg_marker(struct cfg_marker *marker,
int swab, int size);
OPC_RANGE(LDLM) +
OPC_RANGE(MDS) +
OPC_RANGE(OST));
+#ifdef HAVE_SERVER_SUPPORT
} else if (opc < OUT_UPDATE_LAST_OPC) {
/* update opcode */
return (opc - OUT_UPDATE_FIRST_OPC +
OPC_RANGE(LDLM) +
OPC_RANGE(MDS) +
OPC_RANGE(OST));
+#endif /* HAVE_SERVER_SUPPORT */
} else {
/* Unknown Opcode */
return -1;
}
}
+#define LUSTRE_MAX_OPCODES_CLIENT (OPC_RANGE(OST) + \
+ OPC_RANGE(MDS) + \
+ OPC_RANGE(LDLM) + \
+ OPC_RANGE(MGS) + \
+ OPC_RANGE(OBD) + \
+ OPC_RANGE(LLOG) + \
+ OPC_RANGE(SEC) + \
+ OPC_RANGE(SEQ) + \
+ OPC_RANGE(SEC) + \
+ OPC_RANGE(FLD))
-#define LUSTRE_MAX_OPCODES (OPC_RANGE(OST) + \
- OPC_RANGE(MDS) + \
- OPC_RANGE(LDLM) + \
- OPC_RANGE(MGS) + \
- OPC_RANGE(OBD) + \
- OPC_RANGE(LLOG) + \
- OPC_RANGE(SEC) + \
- OPC_RANGE(SEQ) + \
- OPC_RANGE(SEC) + \
- OPC_RANGE(FLD) + \
+#ifdef HAVE_SERVER_SUPPORT
+#define LUSTRE_MAX_OPCODES (LUSTRE_MAX_OPCODES_CLIENT + \
OPC_RANGE(OUT_UPDATE) + \
OPC_RANGE(LFSCK))
+#else
+#define LUSTRE_MAX_OPCODES LUSTRE_MAX_OPCODES_CLIENT
+#endif
#define EXTRA_MAX_OPCODES ((PTLRPC_LAST_CNTR - PTLRPC_FIRST_CNTR) + \
OPC_RANGE(EXTRA))
};
/* target descriptor */
+#define LOV_QOS_DEF_THRESHOLD_RR_PCT 17
+#define LMV_QOS_DEF_THRESHOLD_RR_PCT 5
+
+#define LOV_QOS_DEF_PRIO_FREE 90
+#define LMV_QOS_DEF_PRIO_FREE 90
+
struct lu_tgt_desc {
union {
struct dt_device *ltd_tgt;
return fid_seq(fid) == FID_SEQ_LLOG_NAME;
}
+static inline int fid_seq_in_fldb(u64 seq)
+{
+ return fid_seq_is_igif(seq) || fid_seq_is_norm(seq) ||
+ fid_seq_is_root(seq) || fid_seq_is_dot(seq);
+}
+
+#ifdef HAVE_SERVER_SUPPORT
static inline int fid_is_namespace_visible(const struct lu_fid *fid)
{
const __u64 seq = fid_seq(fid);
fid_is_root(fid) || fid_seq_is_dot(seq);
}
-static inline int fid_seq_in_fldb(__u64 seq)
-{
- return fid_seq_is_igif(seq) || fid_seq_is_norm(seq) ||
- fid_seq_is_root(seq) || fid_seq_is_dot(seq);
-}
-
static inline void ost_layout_cpu_to_le(struct ost_layout *dst,
const struct ost_layout *src)
{
/* XXX: Add more if filter_fid is enlarged in the future. */
}
+#endif /* HAVE_SERVER_SUPPORT */
static inline void lu_last_id_fid(struct lu_fid *fid, __u64 seq, __u32 ost_idx)
{
static inline void lsm_md_dump(int mask, const struct lmv_stripe_md *lsm)
{
+ bool valid_hash = lmv_dir_bad_hash(lsm);
int i;
/* If lsm_md_magic == LMV_MAGIC_FOREIGN pool_name may not be a null
* terminated string so only print LOV_MAXPOOLNAME bytes.
*/
CDEBUG(mask,
- "magic %#x stripe count %d master mdt %d hash type %#x max inherit %hhu version %d migrate offset %d migrate hash %#x pool %.*s\n",
+ "magic %#x stripe count %d master mdt %d hash type %s:%#x max inherit %hhu version %d migrate offset %d migrate hash %#x pool %.*s\n",
lsm->lsm_md_magic, lsm->lsm_md_stripe_count,
- lsm->lsm_md_master_mdt_index, lsm->lsm_md_hash_type,
- lsm->lsm_md_max_inherit, lsm->lsm_md_layout_version,
+ lsm->lsm_md_master_mdt_index,
+ valid_hash ? "invalid hash" :
+ mdt_hash_name[lsm->lsm_md_hash_type & (LMV_HASH_TYPE_MAX - 1)],
+ lsm->lsm_md_hash_type, lsm->lsm_md_max_inherit,
+ lsm->lsm_md_layout_version,
lsm->lsm_md_migrate_offset, lsm->lsm_md_migrate_hash,
LOV_MAXPOOLNAME, lsm->lsm_md_pool_name);
lum_magic == LMV_MAGIC_FOREIGN;
}
+#define LMV_DEBUG(mask, lmv, msg) \
+ CDEBUG(mask, \
+ "%s LMV: magic=%#x count=%u index=%u hash=%s:%#x version=%u migrate offset=%u migrate hash=%s:%u.\n",\
+ msg, (lmv)->lmv_magic, (lmv)->lmv_stripe_count, \
+ (lmv)->lmv_master_mdt_index, \
+ mdt_hash_name[(lmv)->lmv_hash_type & (LMV_HASH_TYPE_MAX - 1)],\
+ (lmv)->lmv_hash_type, (lmv)->lmv_layout_version, \
+ (lmv)->lmv_migrate_offset, \
+ mdt_hash_name[(lmv)->lmv_migrate_hash & (LMV_HASH_TYPE_MAX - 1)],\
+ (lmv)->lmv_migrate_hash)
+
/* master LMV is sane */
static inline bool lmv_is_sane(const struct lmv_mds_md_v1 *lmv)
{
#include <uapi/linux/lustre/lustre_idl.h>
+#ifdef HAVE_SERVER_SUPPORT
void lustre_swab_orphan_ent(struct lu_orphan_ent *ent);
void lustre_swab_orphan_ent_v2(struct lu_orphan_ent_v2 *ent);
void lustre_swab_orphan_ent_v3(struct lu_orphan_ent_v3 *ent);
+void lustre_swab_gl_lquota_desc(struct ldlm_gl_lquota_desc *desc);
+void lustre_swab_gl_barrier_desc(struct ldlm_gl_barrier_desc *desc);
+void lustre_swab_object_update(struct object_update *ou);
+int lustre_swab_object_update_request(struct object_update_request *our,
+ __u32 len);
+void lustre_swab_out_update_header(struct out_update_header *ouh);
+void lustre_swab_out_update_buffer(struct out_update_buffer *oub);
+void lustre_swab_object_update_result(struct object_update_result *our);
+int lustre_swab_object_update_reply(struct object_update_reply *our, __u32 len);
+#endif /* HAVE_SERVER_SUPPORT */
void lustre_swab_ptlrpc_body(struct ptlrpc_body *pb);
void lustre_swab_connect(struct obd_connect_data *ocd);
void lustre_swab_hsm_user_state(struct hsm_user_state *hus);
void lustre_swab_lov_desc(struct lov_desc *ld);
void lustre_swab_ldlm_res_id(struct ldlm_res_id *id);
void lustre_swab_ldlm_policy_data(union ldlm_wire_policy_data *d);
-void lustre_swab_gl_lquota_desc(struct ldlm_gl_lquota_desc *);
-void lustre_swab_gl_barrier_desc(struct ldlm_gl_barrier_desc *);
void lustre_swab_ldlm_intent(struct ldlm_intent *i);
void lustre_swab_ldlm_resource_desc(struct ldlm_resource_desc *r);
void lustre_swab_ldlm_lock_desc(struct ldlm_lock_desc *l);
void lustre_swab_hsm_user_state(struct hsm_user_state *hus);
void lustre_swab_hsm_user_item(struct hsm_user_item *hui);
void lustre_swab_hsm_request(struct hsm_request *hr);
-void lustre_swab_object_update(struct object_update *ou);
-int lustre_swab_object_update_request(struct object_update_request *our,
- __u32 len);
-void lustre_swab_out_update_header(struct out_update_header *ouh);
-void lustre_swab_out_update_buffer(struct out_update_buffer *oub);
-void lustre_swab_object_update_result(struct object_update_result *our);
-int lustre_swab_object_update_reply(struct object_update_reply *our, __u32 len);
void lustre_swab_swap_layouts(struct mdc_swap_layouts *msl);
void lustre_swab_close_data(struct close_data *data);
void lustre_swab_close_data_resync_done(struct close_data_resync_done *resync);
#ifdef HAVE_SERVER_SUPPORT
# include <lu_target.h>
# include <obd_target.h>
+# include <lustre_quota.h>
#endif
#include <lu_ref.h>
#include <lustre_export.h>
#include <lustre_handles.h>
#include <lustre_intent.h>
#include <lvfs.h>
-#include <lustre_quota.h>
#define MAX_OBD_DEVICES 8192
#define KEY_IS(str) \
(keylen >= (sizeof(str)-1) && memcmp(key, str, (sizeof(str)-1)) == 0)
+#ifdef HAVE_SERVER_SUPPORT
/* LUSTRE_LMA_FL_MASKS defines which flags will be stored in LMA */
static inline int lma_to_lustre_flags(__u32 lma_flags)
return (((la_flags & LUSTRE_ORPHAN_FL) ? LMAI_ORPHAN : 0) |
((la_flags & LUSTRE_ENCRYPT_FL) ? LMAI_ENCRYPT : 0));
}
+#endif /* HAVE_SERVER_SUPPORT */
/* Convert wire LUSTRE_*_FL to corresponding client local VFS S_* values
* for the client inode i_flags. The LUSTRE_*_FL are the Lustre wire
struct lu_fid lmv_stripe_fids[0]; /* FIDs for each stripe */
};
-#define LMV_DEBUG(mask, lmv, msg) \
- CDEBUG(mask, \
- "%s LMV: magic=%#x count=%u index=%u hash=%#x version=%u migrate offset=%u migrate hash=%u.\n", \
- msg, (lmv)->lmv_magic, (lmv)->lmv_stripe_count, \
- (lmv)->lmv_master_mdt_index, (lmv)->lmv_hash_type, \
- (lmv)->lmv_layout_version, (lmv)->lmv_migrate_offset, \
- (lmv)->lmv_migrate_hash)
-
/* stripe count before directory split */
#define lmv_split_offset lmv_migrate_offset
/* stripe count after directory merge */
#define LOV_OFFSET_DEFAULT ((__u16)-1)
#define LMV_OFFSET_DEFAULT ((__u32)-1)
-#define LOV_QOS_DEF_THRESHOLD_RR_PCT 17
-#define LMV_QOS_DEF_THRESHOLD_RR_PCT 5
-
-#define LOV_QOS_DEF_PRIO_FREE 90
-#define LMV_QOS_DEF_PRIO_FREE 90
-
static inline bool lov_pattern_supported(__u32 pattern)
{
return (pattern & ~LOV_PATTERN_F_RELEASED) == LOV_PATTERN_RAID0 ||
if (rec->cr_hdr.lrh_type != CHANGELOG_REC) {
rc = -EINVAL;
- CERROR("%s: not a changelog rec %x/%d in llog "DFID" rc = %d\n",
+ CERROR("%s: not a changelog rec %x/%d in llog : rc = %d\n",
crs->crs_obd->obd_name, rec->cr_hdr.lrh_type,
- rec->cr.cr_type,
- PFID(lu_object_fid(&llh->lgh_obj->do_lu)), rc);
+ rec->cr.cr_type, rc);
RETURN(rc);
}
{ SEC_CTX_FINI, "sec_ctx_fini" },
{ FLD_QUERY, "fld_query" },
{ FLD_READ, "fld_read" },
+#ifdef HAVE_SERVER_SUPPORT
{ OUT_UPDATE, "out_update" },
{ LFSCK_NOTIFY, "lfsck_notify" },
{ LFSCK_QUERY, "lfsck_query" },
+#endif
};
static struct ll_eopcode {