diff mbox series

[16/24] lustre: clio: remove cpl_obj

Message ID 1663478534-19917-17-git-send-email-jsimmons@infradead.org (mailing list archive)
State New, archived
Headers show
Series lustre: update to 2.15.52 | expand

Commit Message

James Simmons Sept. 18, 2022, 5:22 a.m. UTC
From: "John L. Hammond" <jhammond@whamcloud.com>

Remove cpl_obj from struct cl_page_slice. This member is only used in
the osc layer and struct osc_page already contains a pointer to the
osc_object.

WC-bug-id: https://jira.whamcloud.com/browse/LU-10994
Lustre-commit: 10da530a2411f28988ab5 ("LU-10994 clio: remove cpl_obj")
Signed-off-by: John L. Hammond <jhammond@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/47402
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 fs/lustre/include/cl_object.h  | 5 -----
 fs/lustre/include/lustre_osc.h | 5 +++++
 fs/lustre/obdclass/cl_page.c   | 1 -
 fs/lustre/osc/osc_cache.c      | 7 +++----
 fs/lustre/osc/osc_page.c       | 8 ++++----
 5 files changed, 12 insertions(+), 14 deletions(-)
diff mbox series

Patch

diff --git a/fs/lustre/include/cl_object.h b/fs/lustre/include/cl_object.h
index c5adbda..41ce0b0 100644
--- a/fs/lustre/include/cl_object.h
+++ b/fs/lustre/include/cl_object.h
@@ -795,11 +795,6 @@  struct cl_page {
  */
 struct cl_page_slice {
 	struct cl_page			*cpl_page;
-	/**
-	 * Object slice corresponding to this page slice. Immutable after
-	 * creation.
-	 */
-	struct cl_object		*cpl_obj;
 	const struct cl_page_operations *cpl_ops;
 };
 
diff --git a/fs/lustre/include/lustre_osc.h b/fs/lustre/include/lustre_osc.h
index 7551390..16d6a8e 100644
--- a/fs/lustre/include/lustre_osc.h
+++ b/fs/lustre/include/lustre_osc.h
@@ -858,6 +858,11 @@  static inline pgoff_t osc_index(struct osc_page *opg)
 	return opg->ops_oap.oap_obj_off >> PAGE_SHIFT;
 }
 
+static inline struct osc_object *osc_page_object(struct osc_page *ops)
+{
+	return ops->ops_oap.oap_obj;
+}
+
 static inline struct cl_page *oap2cl_page(struct osc_async_page *oap)
 {
 	return oap2osc(oap)->ops_cl.cpl_page;
diff --git a/fs/lustre/obdclass/cl_page.c b/fs/lustre/obdclass/cl_page.c
index 7829b90d..7011235 100644
--- a/fs/lustre/obdclass/cl_page.c
+++ b/fs/lustre/obdclass/cl_page.c
@@ -1078,7 +1078,6 @@  void cl_page_slice_add(struct cl_page *cl_page, struct cl_page_slice *slice,
 	LASSERT(cl_page->cp_layer_count < CP_MAX_LAYER);
 	LASSERT(offset < (1 << sizeof(cl_page->cp_layer_offset[0]) * 8));
 	cl_page->cp_layer_offset[cl_page->cp_layer_count++] = offset;
-	slice->cpl_obj = obj;
 	slice->cpl_ops = ops;
 	slice->cpl_page = cl_page;
 }
diff --git a/fs/lustre/osc/osc_cache.c b/fs/lustre/osc/osc_cache.c
index 072cfac..e7b8372 100644
--- a/fs/lustre/osc/osc_cache.c
+++ b/fs/lustre/osc/osc_cache.c
@@ -1328,14 +1328,13 @@  static int osc_refresh_count(const struct lu_env *env,
 {
 	struct osc_page *opg = oap2osc_page(oap);
 	pgoff_t index = osc_index(oap2osc(oap));
-	struct cl_object *obj;
+	struct cl_object *obj = osc2cl(osc_page_object(opg));
 	struct cl_attr *attr = &osc_env_info(env)->oti_attr;
 	int result;
 	loff_t kms;
 
 	/* readpage queues with _COUNT_STABLE, shouldn't get here. */
 	LASSERT(!(cmd & OBD_BRW_READ));
-	obj = opg->ops_cl.cpl_obj;
 
 	cl_object_attr_lock(obj);
 	result = cl_object_attr_get(env, obj, attr);
@@ -1378,7 +1377,7 @@  static int osc_completion(const struct lu_env *env, struct osc_async_page *oap,
 
 	/* statistic */
 	if (rc == 0 && srvlock) {
-		struct lu_device *ld = opg->ops_cl.cpl_obj->co_lu.lo_dev;
+		struct lu_device *ld = osc_page_object(opg)->oo_cl.co_lu.lo_dev;
 		struct osc_stats *stats = &lu2osc_dev(ld)->od_stats;
 		size_t bytes = oap->oap_count;
 
@@ -2588,7 +2587,7 @@  int osc_flush_async_page(const struct lu_env *env, struct cl_io *io,
 			 struct osc_page *ops)
 {
 	struct osc_extent *ext = NULL;
-	struct osc_object *obj = cl2osc(ops->ops_cl.cpl_obj);
+	struct osc_object *obj = osc_page_object(ops);
 	struct cl_page *cp = ops->ops_cl.cpl_page;
 	pgoff_t index = osc_index(ops);
 	struct osc_async_page *oap = &ops->ops_oap;
diff --git a/fs/lustre/osc/osc_page.c b/fs/lustre/osc/osc_page.c
index fd87698..7470dee 100644
--- a/fs/lustre/osc/osc_page.c
+++ b/fs/lustre/osc/osc_page.c
@@ -86,7 +86,7 @@  static void osc_page_transfer_put(const struct lu_env *env,
 static void osc_page_transfer_add(const struct lu_env *env,
 				  struct osc_page *opg, enum cl_req_type crt)
 {
-	struct osc_object *obj = cl2osc(opg->ops_cl.cpl_obj);
+	struct osc_object *obj = osc_page_object(opg);
 
 	osc_lru_use(osc_cli(obj), opg);
 }
@@ -129,7 +129,7 @@  static int osc_page_print(const struct lu_env *env,
 {
 	struct osc_page *opg = cl2osc_page(slice);
 	struct osc_async_page *oap = &opg->ops_oap;
-	struct osc_object *obj = cl2osc(slice->cpl_obj);
+	struct osc_object *obj = osc_page_object(opg);
 	struct client_obd *cli = &osc_export(obj)->exp_obd->u.cli;
 
 	return (*printer)(env, cookie, LUSTRE_OSC_NAME
@@ -171,7 +171,7 @@  static void osc_page_delete(const struct lu_env *env,
 			    const struct cl_page_slice *slice)
 {
 	struct osc_page *opg = cl2osc_page(slice);
-	struct osc_object *obj = cl2osc(opg->ops_cl.cpl_obj);
+	struct osc_object *obj = osc_page_object(opg);
 	int rc;
 
 	CDEBUG(D_TRACE, "%p\n", opg);
@@ -235,7 +235,7 @@  static void osc_page_touch(const struct lu_env *env,
 			  const struct cl_page_slice *slice, size_t to)
 {
 	struct osc_page *opg = cl2osc_page(slice);
-	struct cl_object *obj = opg->ops_cl.cpl_obj;
+	struct cl_object *obj = osc2cl(osc_page_object(opg));
 
 	osc_page_touch_at(env, obj, osc_index(opg), to);
 }