Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
LU-5823 clio: add coo_obd_info_get and coo_data_version
[fs/lustre-release.git]
/
lustre
/
obdclass
/
cl_object.c
diff --git
a/lustre/obdclass/cl_object.c
b/lustre/obdclass/cl_object.c
index
eb23c9b
..
b003952
100644
(file)
--- a/
lustre/obdclass/cl_object.c
+++ b/
lustre/obdclass/cl_object.c
@@
-91,7
+91,6
@@
void cl_object_header_fini(struct cl_object_header *h)
{
lu_object_header_fini(&h->coh_lu);
}
-EXPORT_SYMBOL(cl_object_header_fini);
/**
* Returns a cl_object with a given \a fid.
@@
-203,7
+202,7
@@
EXPORT_SYMBOL(cl_object_attr_unlock);
* for.
*/
int cl_object_attr_get(const struct lu_env *env, struct cl_object *obj,
- struct cl_attr *attr)
+ struct cl_attr *attr)
{
struct lu_object_header *top;
int result;
@@
-211,19
+210,19
@@
int cl_object_attr_get(const struct lu_env *env, struct cl_object *obj,
assert_spin_locked(cl_object_attr_guard(obj));
ENTRY;
-
top = obj->co_lu.lo_header;
-
result = 0;
+ top = obj->co_lu.lo_header;
+ result = 0;
list_for_each_entry(obj, &top->loh_layers, co_lu.lo_linkage) {
-
if (obj->co_ops->coo_attr_get != NULL) {
-
result = obj->co_ops->coo_attr_get(env, obj, attr);
-
if (result != 0) {
-
if (result > 0)
-
result = 0;
-
break;
-
}
-
}
-
}
-
RETURN(result);
+ if (obj->co_ops->coo_attr_get != NULL) {
+ result = obj->co_ops->coo_attr_get(env, obj, attr);
+ if (result != 0) {
+ if (result > 0)
+ result = 0;
+ break;
+ }
+ }
+ }
+ RETURN(result);
}
EXPORT_SYMBOL(cl_object_attr_get);
@@
-387,6
+386,80
@@
int cl_object_find_cbdata(const struct lu_env *env, struct cl_object *obj,
EXPORT_SYMBOL(cl_object_find_cbdata);
/**
+ * Get fiemap extents from file object.
+ *
+ * \param env [in] lustre environment
+ * \param obj [in] file object
+ * \param key [in] fiemap request argument
+ * \param fiemap [out] fiemap extents mapping retrived
+ * \param buflen [in] max buffer length of @fiemap
+ *
+ * \retval 0 success
+ * \retval < 0 error
+ */
+int cl_object_fiemap(const struct lu_env *env, struct cl_object *obj,
+ struct ll_fiemap_info_key *key,
+ struct fiemap *fiemap, size_t *buflen)
+{
+ struct lu_object_header *top;
+ int result = 0;
+ ENTRY;
+
+ top = obj->co_lu.lo_header;
+ list_for_each_entry(obj, &top->loh_layers, co_lu.lo_linkage) {
+ if (obj->co_ops->coo_fiemap != NULL) {
+ result = obj->co_ops->coo_fiemap(env, obj, key, fiemap,
+ buflen);
+ if (result != 0)
+ break;
+ }
+ }
+ RETURN(result);
+}
+EXPORT_SYMBOL(cl_object_fiemap);
+
+int cl_object_obd_info_get(const struct lu_env *env, struct cl_object *obj,
+ struct obd_info *oinfo,
+ struct ptlrpc_request_set *set)
+{
+ struct lu_object_header *top;
+ int result = 0;
+ ENTRY;
+
+ top = obj->co_lu.lo_header;
+ list_for_each_entry(obj, &top->loh_layers, co_lu.lo_linkage) {
+ if (obj->co_ops->coo_obd_info_get != NULL) {
+ result = obj->co_ops->coo_obd_info_get(env, obj, oinfo,
+ set);
+ if (result != 0)
+ break;
+ }
+ }
+ RETURN(result);
+}
+EXPORT_SYMBOL(cl_object_obd_info_get);
+
+int cl_object_data_version(const struct lu_env *env, struct cl_object *obj,
+ __u64 *data_version, int flags)
+{
+ struct lu_object_header *top;
+ int result = 0;
+ ENTRY;
+
+ top = obj->co_lu.lo_header;
+ list_for_each_entry(obj, &top->loh_layers, co_lu.lo_linkage) {
+ if (obj->co_ops->coo_data_version != NULL) {
+ result = obj->co_ops->coo_data_version(env, obj,
+ data_version, flags);
+ if (result != 0)
+ break;
+ }
+ }
+ RETURN(result);
+}
+EXPORT_SYMBOL(cl_object_data_version);
+
+/**
* Helper function removing all object locks, and marking object for
* deletion. All object pages must have been deleted at this point.
*
@@
-850,7
+923,6
@@
struct lu_env *cl_env_peek(int *refcheck)
CDEBUG(D_OTHER, "%d@%p\n", cle ? cle->ce_ref : 0, cle);
return env;
}
-EXPORT_SYMBOL(cl_env_peek);
/**
* Returns lu_env: if there already is an environment associated with the
@@
-1085,7
+1157,6
@@
void cl_attr2lvb(struct ost_lvb *lvb, const struct cl_attr *attr)
lvb->lvb_blocks = attr->cat_blocks;
EXIT;
}
-EXPORT_SYMBOL(cl_attr2lvb);
/**
* Converts struct ost_lvb to struct cl_attr.