#ifndef __OBD_H
#define __OBD_H
+#include <linux/spinlock.h>
#include <linux/obd.h>
#include <lustre/lustre_idl.h>
struct brw_page {
obd_off off;
struct page *pg;
- int count;
+ unsigned int count;
obd_flag flag;
};
* blocking everywhere, but we don't want to slow down fast-path of
* our main platform.)
*
- * Exact type of ->cl_loi_list_lock is defined in arch/obd.h together
- * with client_obd_list_{un,}lock() and
- * client_obd_list_lock_{init,done}() functions.
- *
* NB by Jinshan: though field names are still _loi_, but actually
* osc_object{}s are in the list.
*/
- client_obd_lock_t cl_loi_list_lock;
+ spinlock_t cl_loi_list_lock;
struct list_head cl_loi_ready_list;
struct list_head cl_loi_hp_ready_list;
struct list_head cl_loi_write_list;
atomic_long_t cl_lru_in_list;
atomic_long_t cl_unstable_count;
struct list_head cl_lru_list; /* lru page list */
- client_obd_lock_t cl_lru_list_lock; /* page list protector */
+ spinlock_t cl_lru_list_lock; /* page list protector */
atomic_t cl_lru_shrinkers;
/* number of in flight destroy rpcs is limited to max_rpcs_in_flight */
spinlock_t ec_lock;
struct list_head ec_objects;
struct list_head ec_locks;
- int ec_nstripes;
__u64 ec_unique;
};
struct obd_export *exp;
struct proc_dir_entry *targets_proc_entry;
- struct mutex init_mutex;
+ struct mutex lmv_init_mutex;
int connected;
int max_easize;
int max_def_easize;
#define KEY_INTERMDS "inter_mds"
#define KEY_LAST_ID "last_id"
#define KEY_LAST_FID "last_fid"
-#define KEY_LOCK_TO_STRIPE "lock_to_stripe"
#define KEY_LOVDESC "lovdesc"
#define KEY_MAX_EASIZE "max_easize"
#define KEY_DEFAULT_EASIZE "default_easize"
#define KEY_MAX_COOKIESIZE "max_cookiesize"
#define KEY_DEFAULT_COOKIESIZE "default_cookiesize"
-#define KEY_MDS_CONN "mds_conn"
#define KEY_MGSSEC "mgssec"
-#define KEY_NEXT_ID "next_id"
#define KEY_READ_ONLY "read-only"
#define KEY_REGISTER_TARGET "register_target"
#define KEY_SET_FS "set_fs"
#define KEY_TGT_COUNT "tgt_count"
/* KEY_SET_INFO in lustre_idl.h */
#define KEY_SPTLRPC_CONF "sptlrpc_conf"
-#define KEY_CONNECT_FLAG "connect_flags"
#define KEY_CACHE_SET "cache_set"
#define KEY_CACHE_LRU_SHRINK "cache_lru_shrink"
return -EINVAL;
}
+enum md_cli_flags {
+ CLI_SET_MEA = 1 << 0,
+ CLI_RM_ENTRY = 1 << 1,
+ CLI_HASH64 = 1 << 2,
+ CLI_API32 = 1 << 3,
+ CLI_MIGRATE = 1 << 4,
+};
+
struct md_op_data {
struct lu_fid op_fid1; /* operation fid1 (usualy parent) */
struct lu_fid op_fid2; /* operation fid2 (usualy child) */
size_t op_data_size;
/* iattr fields and blocks. */
- struct iattr op_attr;
- __u64 op_valid;
+ struct iattr op_attr;
loff_t op_attr_blocks;
+ unsigned int op_attr_flags; /* LUSTRE_{SYNC,..}_FL */
+ __u64 op_valid; /* OBD_MD_* */
/* Size-on-MDS epoch and flags. */
__u64 op_ioepoch;
- __u32 op_flags;
+ enum md_op_flags op_flags;
/* Capa fields */
struct obd_capa *op_capa1;
enum mds_op_bias op_bias;
/* Used by readdir */
- __u32 op_npages;
+ unsigned int op_max_pages;
/* used to transfer info between the stacks of MD client
* see enum op_cli_flags */
- __u32 op_cli_flags;
+ enum md_cli_flags op_cli_flags;
/* File object data version for HSM release, on client */
__u64 op_data_version;
struct lustre_handle op_lease_handle;
};
-#define op_stripe_offset op_ioepoch
-#define op_max_pages op_valid
-
struct md_callback {
int (*md_blocking_ast)(struct ldlm_lock *lock,
struct ldlm_lock_desc *desc,
struct lov_stripe_md *mem_src);
int (*o_unpackmd)(struct obd_export *exp,struct lov_stripe_md **mem_tgt,
struct lov_mds_md *disk_src, int disk_len);
- int (*o_create)(const struct lu_env *env, struct obd_export *exp,
- struct obdo *oa, struct lov_stripe_md **ea,
- struct obd_trans_info *oti);
- int (*o_destroy)(const struct lu_env *env, struct obd_export *exp,
- struct obdo *oa, struct lov_stripe_md *ea,
- struct obd_trans_info *oti, struct obd_export *md_exp,
- void *capa);
+ int (*o_create)(const struct lu_env *env, struct obd_export *exp,
+ struct obdo *oa, struct obd_trans_info *oti);
+ int (*o_destroy)(const struct lu_env *env, struct obd_export *exp,
+ struct obdo *oa, struct obd_trans_info *oti);
int (*o_setattr)(const struct lu_env *, struct obd_export *exp,
struct obd_info *oinfo, struct obd_trans_info *oti);
int (*o_setattr_async)(struct obd_export *exp, struct obd_info *oinfo,
struct lsm_operations {
void (*lsm_free)(struct lov_stripe_md *);
- int (*lsm_destroy)(struct lov_stripe_md *, struct obdo *oa,
- struct obd_export *md_exp);
void (*lsm_stripe_by_index)(struct lov_stripe_md *, int *, obd_off *,
obd_off *);
void (*lsm_stripe_by_offset)(struct lov_stripe_md *, int *, obd_off *,