* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
- * Copyright (c) 2011, 2016, Intel Corporation.
+ * Copyright (c) 2011, 2017, Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
unsigned ddp_max_extent_blks;
/* per-extent insertion overhead to be used by client for grant
* calculation */
- unsigned ddp_extent_tax;
+ unsigned int ddp_extent_tax;
+ unsigned int ddp_brw_size; /* optimal RPC size */
+ /* T10PI checksum type, zero if not supported */
+ enum cksum_types ddp_t10_cksum_type;
};
/**
union ldlm_policy_data;
+struct md_layout_change;
+
/**
* A dt_object provides common operations to create and destroy
* objects and to manage regular and extended attributes.
*/
int (*do_declare_layout_change)(const struct lu_env *env,
struct dt_object *dt,
- struct layout_intent *layout,
- const struct lu_buf *buf,
+ struct md_layout_change *mlc,
struct thandle *th);
/**
* \retval -ne error code
*/
int (*do_layout_change)(const struct lu_env *env, struct dt_object *dt,
- struct layout_intent *layout,
- const struct lu_buf *buf, struct thandle *th);
+ struct md_layout_change *mlc,
+ struct thandle *th);
+};
+
+enum dt_bufs_type {
+ DT_BUFS_TYPE_READ = 0x0000,
+ DT_BUFS_TYPE_WRITE = 0x0001,
+ DT_BUFS_TYPE_READAHEAD = 0x0002,
+ DT_BUFS_TYPE_LOCAL = 0x0004,
};
/**
* \param[in] pos position in the object to start
* \param[out] pos \a pos + bytes written
* \param[in] th transaction handle
- * \param[in] ignore unused (was used to request quota ignorance)
*
* \retval positive bytes written on success
* \retval negative negated errno on error
struct dt_object *dt,
const struct lu_buf *buf,
loff_t *pos,
- struct thandle *th,
- int ignore);
+ struct thandle *th);
/**
* Return buffers for data.
loff_t pos,
ssize_t len,
struct niobuf_local *lb,
- int rw);
+ enum dt_bufs_type rw);
/**
* Release reference granted by ->dbo_bufs_get().
* \param[in] rec buffer storing value
* \param[in] key key
* \param[in] th transaction handle
- * \param[in] ignore unused (was used to request quota ignorance)
*
* \retval 0 on success
* \retval negative negated errno on error
struct dt_object *dt,
const struct dt_rec *rec,
const struct dt_key *key,
- struct thandle *th,
- int ignore);
+ struct thandle *th);
/**
* Declare intention to delete a key/value from an index.
struct list_head dd_txn_callbacks;
unsigned int dd_record_fid_accessed:1,
dd_rdonly:1;
+
+ /* sysfs and debugfs handling */
+ struct dentry *dd_debugfs_entry;
+
+ const struct attribute **dd_def_attrs;
+ struct kobject dd_kobj;
+ struct kobj_type dd_ktype;
+ struct completion dd_kobj_unregister;
};
int dt_device_init(struct dt_device *dev, struct lu_device_type *t);
* top thandle here for now, will fix it when we have better
* callback mechanism */
struct thandle *th_top;
- /** context for this transaction, tag is LCT_TX_HANDLE */
- struct lu_context th_ctx;
-
- /** additional tags (layers can add in declare) */
- __u32 th_tags;
/** the last operation result in this transaction.
* this value is used in recovery */
th_wait_submit:1,
/* complex transaction which will track updates on all targets,
* including OSTs */
- th_complex:1;
+ th_complex:1,
+ /* whether ignore quota */
+ th_ignore_quota:1;
};
/**
struct thandle *txn, void *cookie);
int (*dtc_txn_stop)(const struct lu_env *env,
struct thandle *txn, void *cookie);
- void (*dtc_txn_commit)(struct thandle *txn, void *cookie);
void *dtc_cookie;
__u32 dtc_tag;
struct list_head dtc_linkage;
int dt_txn_hook_start(const struct lu_env *env,
struct dt_device *dev, struct thandle *txn);
int dt_txn_hook_stop(const struct lu_env *env, struct thandle *txn);
-void dt_txn_hook_commit(struct thandle *txn);
int dt_try_as_dir(const struct lu_env *env, struct dt_object *obj);
static inline int dt_bufs_get(const struct lu_env *env, struct dt_object *d,
struct niobuf_remote *rnb,
- struct niobuf_local *lnb, int rw)
+ struct niobuf_local *lnb, enum dt_bufs_type rw)
{
LASSERT(d);
LASSERT(d->do_body_ops);
static inline ssize_t dt_write(const struct lu_env *env, struct dt_object *dt,
const struct lu_buf *buf, loff_t *pos,
- struct thandle *th, int rq)
+ struct thandle *th)
{
LASSERT(dt);
LASSERT(dt->do_body_ops);
LASSERT(dt->do_body_ops->dbo_write);
- return dt->do_body_ops->dbo_write(env, dt, buf, pos, th, rq);
+ return dt->do_body_ops->dbo_write(env, dt, buf, pos, th);
}
static inline int dt_declare_punch(const struct lu_env *env,
}
static inline int dt_insert(const struct lu_env *env,
- struct dt_object *dt,
- const struct dt_rec *rec,
- const struct dt_key *key,
- struct thandle *th,
- int noquota)
+ struct dt_object *dt,
+ const struct dt_rec *rec,
+ const struct dt_key *key,
+ struct thandle *th)
{
LASSERT(dt);
LASSERT(dt->do_index_ops);
if (CFS_FAULT_CHECK(OBD_FAIL_DT_INSERT))
return cfs_fail_err;
- return dt->do_index_ops->dio_insert(env, dt, rec, key, th, noquota);
+ return dt->do_index_ops->dio_insert(env, dt, rec, key, th);
}
static inline int dt_declare_xattr_del(const struct lu_env *env,
static inline int dt_declare_layout_change(const struct lu_env *env,
struct dt_object *o,
- struct layout_intent *layout,
- const struct lu_buf *buf,
+ struct md_layout_change *mlc,
struct thandle *th)
{
LASSERT(o);
LASSERT(o->do_ops);
LASSERT(o->do_ops->do_declare_layout_change);
- return o->do_ops->do_declare_layout_change(env, o, layout, buf, th);
+ return o->do_ops->do_declare_layout_change(env, o, mlc, th);
}
static inline int dt_layout_change(const struct lu_env *env,
struct dt_object *o,
- struct layout_intent *layout,
- const struct lu_buf *buf,
+ struct md_layout_change *mlc,
struct thandle *th)
{
LASSERT(o);
LASSERT(o->do_ops);
LASSERT(o->do_ops->do_layout_change);
- return o->do_ops->do_layout_change(env, o, layout, buf, th);
+ return o->do_ops->do_layout_change(env, o, mlc, th);
}
struct dt_find_hint {
int dt_global_init(void);
void dt_global_fini(void);
+int dt_tunables_init(struct dt_device *dt, struct obd_type *type,
+ const char *name, struct lprocfs_vars *list);
+int dt_tunables_fini(struct dt_device *dt);
# ifdef CONFIG_PROC_FS
int lprocfs_dt_blksize_seq_show(struct seq_file *m, void *v);