Skip to contentSkip to conversation

lustre: rename foo0() to __foo()

PATCH New NeilBrown 3 participants 11 messages Jan 11, 2019 – Jan 30, 2019 Staging

lore
Share & tools
lore

NeilBrown

author
#0 lore raw

cover lustre: rename foo0() to __foo()

This change was suggested by Andreas - I liked it so much I applied it to all of lustre.
Except cl_env_init0 - it didn't quite fit the pattern, so I haven't changed that.

NeilBrown

---

NeilBrown (4):
lustre: osc: change some foo0() to __foo()
lustre: llite: change some foo0() to __foo()
lustre: obdclass: change some foo0() to __foo()
lustre: ptlrpc: change some foo0() to __foo()

 drivers/staging/lustre/lustre/include/cl_object.h  |    6 +--
 drivers/staging/lustre/lustre/llite/glimpse.c      |    2 -
 .../staging/lustre/lustre/llite/llite_internal.h   |    6 +--
 drivers/staging/lustre/lustre/llite/llite_mmap.c   |   11 ++---
 drivers/staging/lustre/lustre/llite/vvp_object.c   |    8 ++--
 drivers/staging/lustre/lustre/obdclass/cl_io.c     |   14 +++---
 drivers/staging/lustre/lustre/obdclass/cl_lock.c   |    8 ++--
 drivers/staging/lustre/lustre/obdclass/cl_page.c   |   36 ++++++++--------
 .../staging/lustre/lustre/obdecho/echo_client.c    |   20 +++++----
 drivers/staging/lustre/lustre/osc/osc_cache.c      |   44 ++++++++++----------
 drivers/staging/lustre/lustre/osc/osc_lock.c       |    8 ++--
 drivers/staging/lustre/lustre/ptlrpc/nrs.c         |   20 +++++----
 drivers/staging/lustre/lustre/ptlrpc/nrs_fifo.c    |    2 -
 .../staging/lustre/lustre/ptlrpc/ptlrpc_internal.h |    6 +--
 14 files changed, 95 insertions(+), 96 deletions(-)

--
Signature

author
#1 lore raw

PATCH 1/4 lustre: osc: change some foo0() to __foo()

It is standard practice in Linux, when naming a helper-function which is not meant to be called directly, to use a name starting __.
e.g. foo() and foo_too() might call __foo(), which is otherwise not directly called.
Lustre has a similar convention, but instead uses names like foo0().

This patch convert
osc_extent_tree_dump0 -> __osc_extent_tree_dump osc_extent_sanity_check0 -> __osc_extent_sanity_check osc_io_unplug0 -> __osc_io_unplug osc_dlm_blocking_ast0 -> __osc_dlm_blocking_ast

---
 drivers/staging/lustre/lustre/osc/osc_cache.c |   44 +++++++++++++------------
 drivers/staging/lustre/lustre/osc/osc_lock.c  |    8 ++---
 2 files changed, 26 insertions(+), 26 deletions(-)
drivers/staging/lustre/lustre/osc/osc_cache.c +22 -22
index 1ce9f673f1bf..57046d355eda 100644
@@ -57,10 +57,10 @@ static int osc_io_unplug_async(const struct lu_env *env,
 static void osc_free_grant(struct client_obd *cli, unsigned int nr_pages,
 			   unsigned int lost_grant, unsigned int dirty_grant);
 
-static void osc_extent_tree_dump0(int level, struct osc_object *obj,
-				  const char *func, int line);
+static void __osc_extent_tree_dump(int level, struct osc_object *obj,
+				   const char *func, int line);
 #define osc_extent_tree_dump(lvl, obj) \
-	osc_extent_tree_dump0(lvl, obj, __func__, __LINE__)
+	__osc_extent_tree_dump(lvl, obj, __func__, __LINE__)
 
 static void osc_unreserve_grant(struct client_obd *cli, unsigned int reserved,
 				unsigned int unused);
@@ -173,8 +173,8 @@ static inline struct osc_extent *first_extent(struct osc_object *obj)
 }
 
 /* object must be locked by caller. */
-static int osc_extent_sanity_check0(struct osc_extent *ext,
-				    const char *func, const int line)
+static int __osc_extent_sanity_check(struct osc_extent *ext,
+				     const char *func, const int line)
 {
 	struct osc_object *obj = ext->oe_obj;
 	struct osc_async_page *oap;
@@ -302,13 +302,13 @@ static int osc_extent_sanity_check0(struct osc_extent *ext,
 	return rc;
 }
 
-#define sanity_check_nolock(ext) \
-	osc_extent_sanity_check0(ext, __func__, __LINE__)
+#define osc_extent_sanity_check_nolock(ext) \
+	__osc_extent_sanity_check(ext, __func__, __LINE__)
 
-#define sanity_check(ext) ({						\
+#define osc_extent_sanity_check(ext) ({					\
 	int __res;							\
 	osc_object_lock((ext)->oe_obj);					\
-	__res = sanity_check_nolock(ext);				\
+	__res = osc_extent_sanity_check_nolock(ext);			\
 	osc_object_unlock((ext)->oe_obj);				\
 	__res;								\
 })
@@ -342,7 +342,7 @@ static void osc_extent_state_set(struct osc_extent *ext, int state)
 	LASSERT(state >= OES_INV && state < OES_STATE_MAX);
 
 	/* Never try to sanity check a state changing extent :-) */
-	/* LASSERT(sanity_check_nolock(ext) == 0); */
+	/* LASSERT(osc_extent_sanity_check_nolock(ext) == 0); */
 
 	/* TODO: validate the state machine */
 	ext->oe_state = state;
@@ -600,7 +600,7 @@ void osc_extent_release(const struct lu_env *env, struct osc_extent *ext)
 	struct client_obd *cli = osc_cli(obj);
 
 	LASSERT(atomic_read(&ext->oe_users) > 0);
-	LASSERT(sanity_check(ext) == 0);
+	LASSERT(osc_extent_sanity_check(ext) == 0);
 	LASSERT(ext->oe_grants > 0);
 
 	if (atomic_dec_and_lock(&ext->oe_users, &obj->oo_lock)) {
@@ -729,7 +729,7 @@ static struct osc_extent *osc_extent_find(const struct lu_env *env,
 		pgoff_t ext_chk_start = ext->oe_start >> ppc_bits;
 		pgoff_t ext_chk_end = ext->oe_end >> ppc_bits;
 
-		LASSERT(sanity_check_nolock(ext) == 0);
+		LASSERT(osc_extent_sanity_check_nolock(ext) == 0);
 		if (chunk > ext_chk_end + 1)
 			break;
 
@@ -969,7 +969,7 @@ static int osc_extent_wait(const struct lu_env *env, struct osc_extent *ext,
 	int rc = 0;
 
 	osc_object_lock(obj);
-	LASSERT(sanity_check_nolock(ext) == 0);
+	LASSERT(osc_extent_sanity_check_nolock(ext) == 0);
 	/* `Kick' this extent only if the caller is waiting for it to be
 	 * written out.
 	 */
@@ -1025,7 +1025,7 @@ static int osc_extent_truncate(struct osc_extent *ext, pgoff_t trunc_index,
 	int rc = 0;
 	u16 refcheck;
 
-	LASSERT(sanity_check(ext) == 0);
+	LASSERT(osc_extent_sanity_check(ext) == 0);
 	EASSERT(ext->oe_state == OES_TRUNC, ext);
 	EASSERT(!ext->oe_urgent, ext);
 
@@ -1141,7 +1141,7 @@ static int osc_extent_make_ready(const struct lu_env *env,
 	int rc;
 
 	/* we're going to grab page lock, so object lock must not be taken. */
-	LASSERT(sanity_check(ext) == 0);
+	LASSERT(osc_extent_sanity_check(ext) == 0);
 	/* in locking state, any process should not touch this extent. */
 	EASSERT(ext->oe_state == OES_LOCKING, ext);
 	EASSERT(ext->oe_owner, ext);
@@ -1229,7 +1229,7 @@ static int osc_extent_expand(struct osc_extent *ext, pgoff_t index,
 
 	LASSERT(ext->oe_max_end >= index && ext->oe_start <= index);
 	osc_object_lock(obj);
-	LASSERT(sanity_check_nolock(ext) == 0);
+	LASSERT(osc_extent_sanity_check_nolock(ext) == 0);
 	end_chunk = ext->oe_end >> ppc_bits;
 	if (chunk > end_chunk + 1) {
 		rc = -ERANGE;
@@ -1273,8 +1273,8 @@ static int osc_extent_expand(struct osc_extent *ext, pgoff_t index,
 	return rc;
 }
 
-static void osc_extent_tree_dump0(int level, struct osc_object *obj,
-				  const char *func, int line)
+static void __osc_extent_tree_dump(int level, struct osc_object *obj,
+				   const char *func, int line)
 {
 	struct osc_extent *ext;
 	int cnt;
@@ -2355,8 +2355,8 @@ static void osc_check_rpcs(const struct lu_env *env, struct client_obd *cli)
 	}
 }
 
-static int osc_io_unplug0(const struct lu_env *env, struct client_obd *cli,
-			  struct osc_object *osc, int async)
+static int __osc_io_unplug(const struct lu_env *env, struct client_obd *cli,
+			   struct osc_object *osc, int async)
 {
 	int rc = 0;
 
@@ -2378,13 +2378,13 @@ static int osc_io_unplug0(const struct lu_env *env, struct client_obd *cli,
 static int osc_io_unplug_async(const struct lu_env *env,
 			       struct client_obd *cli, struct osc_object *osc)
 {
-	return osc_io_unplug0(env, cli, osc, 1);
+	return __osc_io_unplug(env, cli, osc, 1);
 }
 
 void osc_io_unplug(const struct lu_env *env, struct client_obd *cli,
 		   struct osc_object *osc)
 {
-	(void)osc_io_unplug0(env, cli, osc, 0);
+	(void)__osc_io_unplug(env, cli, osc, 0);
 }
 
 int osc_prep_async_page(struct osc_object *osc, struct osc_page *ops,
drivers/staging/lustre/lustre/osc/osc_lock.c +4 -4
index 824c655b4ce0..01b6bf7df3b7 100644
@@ -413,9 +413,9 @@ static int osc_lock_flush(struct osc_object *obj, pgoff_t start, pgoff_t end,
  * Helper for osc_dlm_blocking_ast() handling discrepancies between cl_lock
  * and ldlm_lock caches.
  */
-static int osc_dlm_blocking_ast0(const struct lu_env *env,
-				 struct ldlm_lock *dlmlock,
-				 void *data, int flag)
+static int __osc_dlm_blocking_ast(const struct lu_env *env,
+				  struct ldlm_lock *dlmlock,
+				  void *data, int flag)
 {
 	enum cl_lock_mode mode = CLM_READ;
 	struct cl_object *obj = NULL;
@@ -556,7 +556,7 @@ static int osc_ldlm_blocking_ast(struct ldlm_lock *dlmlock,
 			break;
 		}
 
-		result = osc_dlm_blocking_ast0(env, dlmlock, data, flag);
+		result = __osc_dlm_blocking_ast(env, dlmlock, data, flag);
 		cl_env_put(env, &refcheck);
 		break;
 		}
#2 lore raw

PATCH 1/4 lustre: osc: change some foo0() to __foo()

Quoted 8 lines · NeilBrown

It is standard practice in Linux, when naming a helper-function which is not meant to be called directly, to use a name starting __.
e.g. foo() and foo_too() might call __foo(), which is otherwise not directly called.
Lustre has a similar convention, but instead uses names like foo0().

Quoted 8 lines

This patch convert
osc_extent_tree_dump0 -> __osc_extent_tree_dump osc_extent_sanity_check0 -> __osc_extent_sanity_check osc_io_unplug0 -> __osc_io_unplug osc_dlm_blocking_ast0 -> __osc_dlm_blocking_ast

Quoted 173 lines

---
drivers/staging/lustre/lustre/osc/osc_cache.c | 44 +++++++++++++------------
drivers/staging/lustre/lustre/osc/osc_lock.c | 8 ++---

2 files changed, 26 insertions(+), 26 deletions(-)
drivers/staging/lustre/lustre/osc/osc_cache.c +22 -22
index 1ce9f673f1bf..57046d355eda 100644
@@ -57,10 +57,10 @@ static int osc_io_unplug_async(const struct lu_env *env,
 static void osc_free_grant(struct client_obd *cli, unsigned int nr_pages,
 			   unsigned int lost_grant, unsigned int dirty_grant);
 
-static void osc_extent_tree_dump0(int level, struct osc_object *obj,
-				  const char *func, int line);
+static void __osc_extent_tree_dump(int level, struct osc_object *obj,
+				   const char *func, int line);
 #define osc_extent_tree_dump(lvl, obj) \
-	osc_extent_tree_dump0(lvl, obj, __func__, __LINE__)
+	__osc_extent_tree_dump(lvl, obj, __func__, __LINE__)
 
 static void osc_unreserve_grant(struct client_obd *cli, unsigned int reserved,
 				unsigned int unused);
@@ -173,8 +173,8 @@ static inline struct osc_extent *first_extent(struct osc_object *obj)
 }
 
 /* object must be locked by caller. */
-static int osc_extent_sanity_check0(struct osc_extent *ext,
-				    const char *func, const int line)
+static int __osc_extent_sanity_check(struct osc_extent *ext,
+				     const char *func, const int line)
 {
 	struct osc_object *obj = ext->oe_obj;
 	struct osc_async_page *oap;
@@ -302,13 +302,13 @@ static int osc_extent_sanity_check0(struct osc_extent *ext,
 	return rc;
 }
 
-#define sanity_check_nolock(ext) \
-	osc_extent_sanity_check0(ext, __func__, __LINE__)
+#define osc_extent_sanity_check_nolock(ext) \
+	__osc_extent_sanity_check(ext, __func__, __LINE__)
 
-#define sanity_check(ext) ({						\
+#define osc_extent_sanity_check(ext) ({					\
 	int __res;							\
 	osc_object_lock((ext)->oe_obj);					\
-	__res = sanity_check_nolock(ext);				\
+	__res = osc_extent_sanity_check_nolock(ext);			\
 	osc_object_unlock((ext)->oe_obj);				\
 	__res;								\
 })
@@ -342,7 +342,7 @@ static void osc_extent_state_set(struct osc_extent *ext, int state)
 	LASSERT(state >= OES_INV && state < OES_STATE_MAX);
 
 	/* Never try to sanity check a state changing extent :-) */
-	/* LASSERT(sanity_check_nolock(ext) == 0); */
+	/* LASSERT(osc_extent_sanity_check_nolock(ext) == 0); */
 
 	/* TODO: validate the state machine */
 	ext->oe_state = state;
@@ -600,7 +600,7 @@ void osc_extent_release(const struct lu_env *env, struct osc_extent *ext)
 	struct client_obd *cli = osc_cli(obj);
 
 	LASSERT(atomic_read(&ext->oe_users) > 0);
-	LASSERT(sanity_check(ext) == 0);
+	LASSERT(osc_extent_sanity_check(ext) == 0);
 	LASSERT(ext->oe_grants > 0);
 
 	if (atomic_dec_and_lock(&ext->oe_users, &obj->oo_lock)) {
@@ -729,7 +729,7 @@ static struct osc_extent *osc_extent_find(const struct lu_env *env,
 		pgoff_t ext_chk_start = ext->oe_start >> ppc_bits;
 		pgoff_t ext_chk_end = ext->oe_end >> ppc_bits;
 
-		LASSERT(sanity_check_nolock(ext) == 0);
+		LASSERT(osc_extent_sanity_check_nolock(ext) == 0);
 		if (chunk > ext_chk_end + 1)
 			break;
 
@@ -969,7 +969,7 @@ static int osc_extent_wait(const struct lu_env *env, struct osc_extent *ext,
 	int rc = 0;
 
 	osc_object_lock(obj);
-	LASSERT(sanity_check_nolock(ext) == 0);
+	LASSERT(osc_extent_sanity_check_nolock(ext) == 0);
 	/* `Kick' this extent only if the caller is waiting for it to be
 	 * written out.
 	 */
@@ -1025,7 +1025,7 @@ static int osc_extent_truncate(struct osc_extent *ext, pgoff_t trunc_index,
 	int rc = 0;
 	u16 refcheck;
 
-	LASSERT(sanity_check(ext) == 0);
+	LASSERT(osc_extent_sanity_check(ext) == 0);
 	EASSERT(ext->oe_state == OES_TRUNC, ext);
 	EASSERT(!ext->oe_urgent, ext);
 
@@ -1141,7 +1141,7 @@ static int osc_extent_make_ready(const struct lu_env *env,
 	int rc;
 
 	/* we're going to grab page lock, so object lock must not be taken. */
-	LASSERT(sanity_check(ext) == 0);
+	LASSERT(osc_extent_sanity_check(ext) == 0);
 	/* in locking state, any process should not touch this extent. */
 	EASSERT(ext->oe_state == OES_LOCKING, ext);
 	EASSERT(ext->oe_owner, ext);
@@ -1229,7 +1229,7 @@ static int osc_extent_expand(struct osc_extent *ext, pgoff_t index,
 
 	LASSERT(ext->oe_max_end >= index && ext->oe_start <= index);
 	osc_object_lock(obj);
-	LASSERT(sanity_check_nolock(ext) == 0);
+	LASSERT(osc_extent_sanity_check_nolock(ext) == 0);
 	end_chunk = ext->oe_end >> ppc_bits;
 	if (chunk > end_chunk + 1) {
 		rc = -ERANGE;
@@ -1273,8 +1273,8 @@ static int osc_extent_expand(struct osc_extent *ext, pgoff_t index,
 	return rc;
 }
 
-static void osc_extent_tree_dump0(int level, struct osc_object *obj,
-				  const char *func, int line)
+static void __osc_extent_tree_dump(int level, struct osc_object *obj,
+				   const char *func, int line)
 {
 	struct osc_extent *ext;
 	int cnt;
@@ -2355,8 +2355,8 @@ static void osc_check_rpcs(const struct lu_env *env, struct client_obd *cli)
 	}
 }
 
-static int osc_io_unplug0(const struct lu_env *env, struct client_obd *cli,
-			  struct osc_object *osc, int async)
+static int __osc_io_unplug(const struct lu_env *env, struct client_obd *cli,
+			   struct osc_object *osc, int async)
 {
 	int rc = 0;
 
@@ -2378,13 +2378,13 @@ static int osc_io_unplug0(const struct lu_env *env, struct client_obd *cli,
 static int osc_io_unplug_async(const struct lu_env *env,
 			       struct client_obd *cli, struct osc_object *osc)
 {
-	return osc_io_unplug0(env, cli, osc, 1);
+	return __osc_io_unplug(env, cli, osc, 1);
 }
 
 void osc_io_unplug(const struct lu_env *env, struct client_obd *cli,
 		   struct osc_object *osc)
 {
-	(void)osc_io_unplug0(env, cli, osc, 0);
+	(void)__osc_io_unplug(env, cli, osc, 0);
 }
 
 int osc_prep_async_page(struct osc_object *osc, struct osc_page *ops,
drivers/staging/lustre/lustre/osc/osc_lock.c +3 -3
index 824c655b4ce0..01b6bf7df3b7 100644
@@ -413,9 +413,9 @@ static int osc_lock_flush(struct osc_object *obj, pgoff_t start, pgoff_t end,
 * Helper for osc_dlm_blocking_ast() handling discrepancies between cl_lock
 * and ldlm_lock caches.
 */
-static int osc_dlm_blocking_ast0(const struct lu_env *env,
-				 struct ldlm_lock *dlmlock,
-				 void *data, int flag)
+static int __osc_dlm_blocking_ast(const struct lu_env *env,
+				  struct ldlm_lock *dlmlock,
+				  void *data, int flag)
 {
 	enum cl_lock_mode mode = CLM_READ;
 	struct cl_object *obj = NULL;

drivers/staging/lustre/lustre/osc/osc_lock.c static int osc_ldlm_blocking_ast(struct ldlm_lock *dlmlock, · line 562

Quoted 8 lines
drivers/staging/lustre/lustre/osc/osc_lock.c +1 -1
@@ -556,7 +556,7 @@ static int osc_ldlm_blocking_ast(struct ldlm_lock *dlmlock,
 			break;
 		}
 
-		result = osc_dlm_blocking_ast0(env, dlmlock, data, flag);
+		result = __osc_dlm_blocking_ast(env, dlmlock, data, flag);
 		cl_env_put(env, &refcheck);
 		break;
 		}

Cheers, Andreas
---
Andreas Dilger
CTO Whamcloud

author
#3 lore raw

PATCH 2/4 lustre: llite: change some foo0() to __foo()

In reply to NeilBrown

Change:
cl_glimpse_size0 -> __cl_glimpse_size
ll_page_mkwrite0 -> __ll_page_mkwrite
ll_fault0 -> __ll_fault
vvp_object_init0 -> __vvp_object_init

This is more consistent with Linux naming style.

---
 drivers/staging/lustre/lustre/llite/glimpse.c      |    2 +-
 .../staging/lustre/lustre/llite/llite_internal.h   |    6 +++---
 drivers/staging/lustre/lustre/llite/llite_mmap.c   |   11 +++++------
 drivers/staging/lustre/lustre/llite/vvp_object.c   |    8 ++++----
 4 files changed, 13 insertions(+), 14 deletions(-)
drivers/staging/lustre/lustre/llite/glimpse.c +1 -1
index ce0d51767da3..d8712a392e58 100644
@@ -163,7 +163,7 @@ static int cl_io_get(struct inode *inode, struct lu_env **envout,
 	return result;
 }
 
-int cl_glimpse_size0(struct inode *inode, int agl)
+int __cl_glimpse_size(struct inode *inode, int agl)
 {
 	/*
 	 * We don't need ast_flags argument to cl_glimpse_size(), because
drivers/staging/lustre/lustre/llite/llite_internal.h +3 -3
index b2a1f54ab228..c680a49d900c 100644
@@ -1161,18 +1161,18 @@ void ll_deauthorize_statahead(struct inode *dir, void *key);
 
 blkcnt_t dirty_cnt(struct inode *inode);
 
-int cl_glimpse_size0(struct inode *inode, int agl);
+int __cl_glimpse_size(struct inode *inode, int agl);
 int cl_glimpse_lock(const struct lu_env *env, struct cl_io *io,
 		    struct inode *inode, struct cl_object *clob, int agl);
 
 static inline int cl_glimpse_size(struct inode *inode)
 {
-	return cl_glimpse_size0(inode, 0);
+	return __cl_glimpse_size(inode, 0);
 }
 
 static inline int cl_agl(struct inode *inode)
 {
-	return cl_glimpse_size0(inode, 1);
+	return __cl_glimpse_size(inode, 1);
 }
 
 static inline int ll_glimpse_size(struct inode *inode)
drivers/staging/lustre/lustre/llite/llite_mmap.c +5 -6
index 023d62e53051..33e23ee4aff4 100644
@@ -143,9 +143,8 @@ ll_fault_io_init(struct lu_env *env, struct vm_area_struct *vma,
 	return io;
 }
 
-/* Sharing code of page_mkwrite method for rhel5 and rhel6 */
-static int ll_page_mkwrite0(struct vm_area_struct *vma, struct page *vmpage,
-			    bool *retry)
+static int __ll_page_mkwrite(struct vm_area_struct *vma, struct page *vmpage,
+			     bool *retry)
 {
 	struct lu_env	   *env;
 	struct cl_io	    *io;
@@ -262,7 +261,7 @@ static inline vm_fault_t to_fault_error(int result)
  * \retval VM_FAULT_ERROR on general error
  * \retval NOPAGE_OOM not have memory for allocate new page
  */
-static vm_fault_t ll_fault0(struct vm_area_struct *vma, struct vm_fault *vmf)
+static vm_fault_t __ll_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
 {
 	struct lu_env	   *env;
 	struct cl_io	    *io;
@@ -365,7 +364,7 @@ static vm_fault_t ll_fault(struct vm_fault *vmf)
 			   LPROC_LL_FAULT, 1);
 
 restart:
-	result = ll_fault0(vmf->vma, vmf);
+	result = __ll_fault(vmf->vma, vmf);
 	if (!(result & (VM_FAULT_RETRY | VM_FAULT_ERROR | VM_FAULT_LOCKED))) {
 		struct page *vmpage = vmf->page;
 
@@ -406,7 +405,7 @@ static vm_fault_t ll_page_mkwrite(struct vm_fault *vmf)
 	file_update_time(vma->vm_file);
 	do {
 		retry = false;
-		err = ll_page_mkwrite0(vma, vmf->page, &retry);
+		err = __ll_page_mkwrite(vma, vmf->page, &retry);
 
 		if (!printed && ++count > 16) {
 			const struct dentry *de = vma->vm_file->f_path.dentry;
drivers/staging/lustre/lustre/llite/vvp_object.c +4 -4
index e1000f6b7f22..86e077bd516b 100644
@@ -220,9 +220,9 @@ static const struct cl_object_operations vvp_ops = {
 	.coo_req_attr_set	= vvp_req_attr_set
 };
 
-static int vvp_object_init0(const struct lu_env *env,
-			    struct vvp_object *vob,
-			    const struct cl_object_conf *conf)
+static int __vvp_object_init(const struct lu_env *env,
+			     struct vvp_object *vob,
+			     const struct cl_object_conf *conf)
 {
 	vob->vob_inode = conf->coc_inode;
 	atomic_set(&vob->vob_transient_pages, 0);
@@ -246,7 +246,7 @@ static int vvp_object_init(const struct lu_env *env, struct lu_object *obj,
 
 		cconf = lu2cl_conf(conf);
 		lu_object_add(obj, below);
-		result = vvp_object_init0(env, vob, cconf);
+		result = __vvp_object_init(env, vob, cconf);
 	} else {
 		result = -ENOMEM;
 	}
#4 lore raw

PATCH 2/4 lustre: llite: change some foo0() to __foo()

Quoted 10 lines · NeilBrown

Change:
cl_glimpse_size0 -> __cl_glimpse_size
ll_page_mkwrite0 -> __ll_page_mkwrite
ll_fault0 -> __ll_fault
vvp_object_init0 -> __vvp_object_init

This is more consistent with Linux naming style.

Quoted 109 lines

---

drivers/staging/lustre/lustre/llite/glimpse.c      |    2 +-
.../staging/lustre/lustre/llite/llite_internal.h   |    6 +++---
drivers/staging/lustre/lustre/llite/llite_mmap.c   |   11 +++++------
drivers/staging/lustre/lustre/llite/vvp_object.c   |    8 ++++----
4 files changed, 13 insertions(+), 14 deletions(-)
drivers/staging/lustre/lustre/llite/glimpse.c +1 -1
index ce0d51767da3..d8712a392e58 100644
@@ -163,7 +163,7 @@ static int cl_io_get(struct inode *inode, struct lu_env **envout,
 	return result;
 }
 
-int cl_glimpse_size0(struct inode *inode, int agl)
+int __cl_glimpse_size(struct inode *inode, int agl)
 {
 	/*
 	 * We don't need ast_flags argument to cl_glimpse_size(), because
drivers/staging/lustre/lustre/llite/llite_internal.h +3 -3
index b2a1f54ab228..c680a49d900c 100644
@@ -1161,18 +1161,18 @@ void ll_deauthorize_statahead(struct inode *dir, void *key);
 
 blkcnt_t dirty_cnt(struct inode *inode);
 
-int cl_glimpse_size0(struct inode *inode, int agl);
+int __cl_glimpse_size(struct inode *inode, int agl);
 int cl_glimpse_lock(const struct lu_env *env, struct cl_io *io,
 		    struct inode *inode, struct cl_object *clob, int agl);
 
 static inline int cl_glimpse_size(struct inode *inode)
 {
-	return cl_glimpse_size0(inode, 0);
+	return __cl_glimpse_size(inode, 0);
 }
 
 static inline int cl_agl(struct inode *inode)
 {
-	return cl_glimpse_size0(inode, 1);
+	return __cl_glimpse_size(inode, 1);
 }
 
 static inline int ll_glimpse_size(struct inode *inode)
drivers/staging/lustre/lustre/llite/llite_mmap.c +3 -4
index 023d62e53051..33e23ee4aff4 100644
@@ -143,9 +143,8 @@ ll_fault_io_init(struct lu_env *env, struct vm_area_struct *vma,
 	return io;
 }
 
-/* Sharing code of page_mkwrite method for rhel5 and rhel6 */
-static int ll_page_mkwrite0(struct vm_area_struct *vma, struct page *vmpage,
-			    bool *retry)
+static int __ll_page_mkwrite(struct vm_area_struct *vma, struct page *vmpage,
+			     bool *retry)
 {
 	struct lu_env	   *env;
 	struct cl_io	    *io;
@@ -262,7 +261,7 @@ static inline vm_fault_t to_fault_error(int result)
 * \retval VM_FAULT_ERROR on general error
 * \retval NOPAGE_OOM not have memory for allocate new page
 */
-static vm_fault_t ll_fault0(struct vm_area_struct *vma, struct vm_fault *vmf)
+static vm_fault_t __ll_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
 {
 	struct lu_env	   *env;
 	struct cl_io	    *io;
@@ -365,7 +364,7 @@ static vm_fault_t ll_fault(struct vm_fault *vmf)
 			   LPROC_LL_FAULT, 1);
 

restart:

drivers/staging/lustre/lustre/llite/llite_mmap.c +1 -1
-	result = ll_fault0(vmf->vma, vmf);
+	result = __ll_fault(vmf->vma, vmf);
	if (!(result & (VM_FAULT_RETRY | VM_FAULT_ERROR | VM_FAULT_LOCKED))) {
		struct page *vmpage = vmf->page;
drivers/staging/lustre/lustre/llite/llite_mmap.c +1 -1
@@ -406,7 +405,7 @@ static vm_fault_t ll_page_mkwrite(struct vm_fault *vmf)
 	file_update_time(vma->vm_file);
 	do {
 		retry = false;
-		err = ll_page_mkwrite0(vma, vmf->page, &retry);
+		err = __ll_page_mkwrite(vma, vmf->page, &retry);
 
 		if (!printed && ++count > 16) {
 			const struct dentry *de = vma->vm_file->f_path.dentry;
drivers/staging/lustre/lustre/llite/vvp_object.c +3 -3
index e1000f6b7f22..86e077bd516b 100644
@@ -220,9 +220,9 @@ static const struct cl_object_operations vvp_ops = {
 	.coo_req_attr_set	= vvp_req_attr_set
 };
 
-static int vvp_object_init0(const struct lu_env *env,
-			    struct vvp_object *vob,
-			    const struct cl_object_conf *conf)
+static int __vvp_object_init(const struct lu_env *env,
+			     struct vvp_object *vob,
+			     const struct cl_object_conf *conf)
 {
 	vob->vob_inode = conf->coc_inode;
 	atomic_set(&vob->vob_transient_pages, 0);

drivers/staging/lustre/lustre/llite/vvp_object.c static int vvp_object_init(const struct lu_env *env, struct lu_object *obj, · line 252

Quoted 8 lines
drivers/staging/lustre/lustre/llite/vvp_object.c +1 -1
@@ -246,7 +246,7 @@ static int vvp_object_init(const struct lu_env *env, struct lu_object *obj,
 
 		cconf = lu2cl_conf(conf);
 		lu_object_add(obj, below);
-		result = vvp_object_init0(env, vob, cconf);
+		result = __vvp_object_init(env, vob, cconf);
 	} else {
 		result = -ENOMEM;
 	}

Cheers, Andreas
---
Andreas Dilger
Principal Lustre Architect
Whamcloud

author
#5 lore raw

PATCH 3/4 lustre: obdclass: change some foo0() to __foo()

In reply to NeilBrown

Change:
cl_io_init0 -> __cl_io_init
cl_lock_trace0 -> __cl_lock_trace
cl_page_delete0 -> __cl_page_delete
cl_page_state_set0 -> __cl_page_state_set
cl_page_own0 -> __cl_page_own
cl_page_disown0 -> __cl_page_disown
cl_page_delete0 -> __cl_page_delete
cl_echo_enqueue0 -> __cl_echo_enqueue
cl_echo_cancel0 -> __cl_echo_cancel

This is more consistent with Linux naming style.

---
 drivers/staging/lustre/lustre/include/cl_object.h  |    6 ++-
 drivers/staging/lustre/lustre/obdclass/cl_io.c     |   14 ++++----
 drivers/staging/lustre/lustre/obdclass/cl_lock.c   |    8 ++--
 drivers/staging/lustre/lustre/obdclass/cl_page.c   |   36 ++++++++++----------
 .../staging/lustre/lustre/obdecho/echo_client.c    |   20 ++++++-----
 5 files changed, 42 insertions(+), 42 deletions(-)
drivers/staging/lustre/lustre/include/cl_object.h +3 -3
index 4f0e8e271452..d0e61e503f9d 100644
@@ -803,7 +803,7 @@ struct cl_page_operations {
 	/**
 	 * cl_page<->struct page methods. Only one layer in the stack has to
 	 * implement these. Current code assumes that this functionality is
-	 * provided by the topmost layer, see cl_page_disown0() as an example.
+	 * provided by the topmost layer, see __cl_page_disown() as an example.
 	 */
 
 	/**
@@ -2144,8 +2144,8 @@ void cl_page_unassume(const struct lu_env *env,
 		      struct cl_io *io, struct cl_page *pg);
 void cl_page_disown(const struct lu_env *env,
 		    struct cl_io *io, struct cl_page *page);
-void cl_page_disown0(const struct lu_env *env,
-		     struct cl_io *io, struct cl_page *pg);
+void __cl_page_disown(const struct lu_env *env,
+		      struct cl_io *io, struct cl_page *pg);
 int cl_page_is_owned(const struct cl_page *pg, const struct cl_io *io);
 
 /** @} ownership */
drivers/staging/lustre/lustre/obdclass/cl_io.c +7 -7
index 0da731cfeb30..84c7710f80d7 100644
@@ -131,8 +131,8 @@ void cl_io_fini(const struct lu_env *env, struct cl_io *io)
 }
 EXPORT_SYMBOL(cl_io_fini);
 
-static int cl_io_init0(const struct lu_env *env, struct cl_io *io,
-		       enum cl_io_type iot, struct cl_object *obj)
+static int __cl_io_init(const struct lu_env *env, struct cl_io *io,
+			enum cl_io_type iot, struct cl_object *obj)
 {
 	struct cl_object *scan;
 	int result;
@@ -169,7 +169,7 @@ int cl_io_sub_init(const struct lu_env *env, struct cl_io *io,
 {
 	LASSERT(obj != cl_object_top(obj));
 
-	return cl_io_init0(env, io, iot, obj);
+	return __cl_io_init(env, io, iot, obj);
 }
 EXPORT_SYMBOL(cl_io_sub_init);
 
@@ -188,7 +188,7 @@ int cl_io_init(const struct lu_env *env, struct cl_io *io,
 {
 	LASSERT(obj == cl_object_top(obj));
 
-	return cl_io_init0(env, io, iot, obj);
+	return __cl_io_init(env, io, iot, obj);
 }
 EXPORT_SYMBOL(cl_io_init);
 
@@ -897,14 +897,14 @@ void cl_page_list_disown(const struct lu_env *env,
 		list_del_init(&page->cp_batch);
 		--plist->pl_nr;
 		/*
-		 * cl_page_disown0 rather than usual cl_page_disown() is used,
+		 * __cl_page_disown rather than usual cl_page_disown() is used,
 		 * because pages are possibly in CPS_FREEING state already due
 		 * to the call to cl_page_list_discard().
 		 */
 		/*
-		 * XXX cl_page_disown0() will fail if page is not locked.
+		 * XXX __cl_page_disown() will fail if page is not locked.
 		 */
-		cl_page_disown0(env, io, page);
+		__cl_page_disown(env, io, page);
 		lu_ref_del_at(&page->cp_reference, &page->cp_queue_ref, "queue",
 			      plist);
 		cl_page_put(env, page);
drivers/staging/lustre/lustre/obdclass/cl_lock.c +4 -4
index 9ca29a26a38b..23c1609415a3 100644
@@ -45,9 +45,9 @@
 #include <cl_object.h>
 #include "cl_internal.h"
 
-static void cl_lock_trace0(int level, const struct lu_env *env,
-			   const char *prefix, const struct cl_lock *lock,
-			   const char *func, const int line)
+static void __cl_lock_trace(int level, const struct lu_env *env,
+			    const char *prefix, const struct cl_lock *lock,
+			    const char *func, const int line)
 {
 	struct cl_object_header *h = cl_object_header(lock->cll_descr.cld_obj);
 
@@ -55,7 +55,7 @@ static void cl_lock_trace0(int level, const struct lu_env *env,
 	       prefix, lock, env, h->coh_nesting, func, line);
 }
 #define cl_lock_trace(level, env, prefix, lock)				\
-	cl_lock_trace0(level, env, prefix, lock, __func__, __LINE__)
+	__cl_lock_trace(level, env, prefix, lock, __func__, __LINE__)
 
 /**
  * Adds lock slice to the compound lock.
drivers/staging/lustre/lustre/obdclass/cl_page.c +18 -18
index 00df94b87606..5794b1cbfb54 100644
@@ -45,7 +45,7 @@
 #include <cl_object.h>
 #include "cl_internal.h"
 
-static void cl_page_delete0(const struct lu_env *env, struct cl_page *pg);
+static void __cl_page_delete(const struct lu_env *env, struct cl_page *pg);
 
 # define PASSERT(env, page, expr)					   \
 	do {								   \
@@ -156,7 +156,7 @@ struct cl_page *cl_page_alloc(const struct lu_env *env,
 				result = o->co_ops->coo_page_init(env, o, page,
 								  ind);
 				if (result != 0) {
-					cl_page_delete0(env, page);
+					__cl_page_delete(env, page);
 					cl_page_free(env, page);
 					page = ERR_PTR(result);
 					break;
@@ -228,8 +228,8 @@ static inline int cl_page_invariant(const struct cl_page *pg)
 	return cl_page_in_use_noref(pg);
 }
 
-static void cl_page_state_set0(const struct lu_env *env,
-			       struct cl_page *page, enum cl_page_state state)
+static void __cl_page_state_set(const struct lu_env *env,
+				struct cl_page *page, enum cl_page_state state)
 {
 	enum cl_page_state old;
 
@@ -286,7 +286,7 @@ static void cl_page_state_set0(const struct lu_env *env,
 static void cl_page_state_set(const struct lu_env *env,
 			      struct cl_page *page, enum cl_page_state state)
 {
-	cl_page_state_set0(env, page, state);
+	__cl_page_state_set(env, page, state);
 }
 
 /**
@@ -377,7 +377,7 @@ static void cl_page_owner_set(struct cl_page *page)
 	page->cp_owner->ci_owned_nr++;
 }
 
-void cl_page_disown0(const struct lu_env *env,
+void __cl_page_disown(const struct lu_env *env,
 		     struct cl_io *io, struct cl_page *pg)
 {
 	const struct cl_page_slice *slice;
@@ -433,8 +433,8 @@ EXPORT_SYMBOL(cl_page_is_owned);
  * \see cl_page_own_try()
  * \see cl_page_own
  */
-static int cl_page_own0(const struct lu_env *env, struct cl_io *io,
-			struct cl_page *pg, int nonblock)
+static int __cl_page_own(const struct lu_env *env, struct cl_io *io,
+			 struct cl_page *pg, int nonblock)
 {
 	const struct cl_page_slice *slice;
 	int result = 0;
@@ -465,7 +465,7 @@ static int cl_page_own0(const struct lu_env *env, struct cl_io *io,
 		if (pg->cp_state != CPS_FREEING) {
 			cl_page_state_set(env, pg, CPS_OWNED);
 		} else {
-			cl_page_disown0(env, io, pg);
+			__cl_page_disown(env, io, pg);
 			result = -ENOENT;
 		}
 	}
@@ -477,23 +477,23 @@ static int cl_page_own0(const struct lu_env *env, struct cl_io *io,
 /**
  * Own a page, might be blocked.
  *
- * \see cl_page_own0()
+ * \see __cl_page_own()
  */
 int cl_page_own(const struct lu_env *env, struct cl_io *io, struct cl_page *pg)
 {
-	return cl_page_own0(env, io, pg, 0);
+	return __cl_page_own(env, io, pg, 0);
 }
 EXPORT_SYMBOL(cl_page_own);
 
 /**
  * Nonblock version of cl_page_own().
  *
- * \see cl_page_own0()
+ * \see __cl_page_own()
  */
 int cl_page_own_try(const struct lu_env *env, struct cl_io *io,
 		    struct cl_page *pg)
 {
-	return cl_page_own0(env, io, pg, 1);
+	return __cl_page_own(env, io, pg, 1);
 }
 EXPORT_SYMBOL(cl_page_own_try);
 
@@ -576,7 +576,7 @@ void cl_page_disown(const struct lu_env *env,
 		pg->cp_state == CPS_FREEING);
 
 	io = cl_io_top(io);
-	cl_page_disown0(env, io, pg);
+	__cl_page_disown(env, io, pg);
 }
 EXPORT_SYMBOL(cl_page_disown);
 
@@ -607,10 +607,10 @@ EXPORT_SYMBOL(cl_page_discard);
 
 /**
  * Version of cl_page_delete() that can be called for not fully constructed
- * pages, e.g,. in a error handling cl_page_find()->cl_page_delete0()
+ * pages, e.g,. in a error handling cl_page_find()->__cl_page_delete()
  * path. Doesn't check page invariant.
  */
-static void cl_page_delete0(const struct lu_env *env, struct cl_page *pg)
+static void __cl_page_delete(const struct lu_env *env, struct cl_page *pg)
 {
 	const struct cl_page_slice *slice;
 
@@ -620,7 +620,7 @@ static void cl_page_delete0(const struct lu_env *env, struct cl_page *pg)
 	 * Sever all ways to obtain new pointers to @pg.
 	 */
 	cl_page_owner_clear(pg);
-	cl_page_state_set0(env, pg, CPS_FREEING);
+	__cl_page_state_set(env, pg, CPS_FREEING);
 
 	list_for_each_entry_reverse(slice, &pg->cp_layers, cpl_linkage) {
 		if (slice->cpl_ops->cpo_delete)
@@ -655,7 +655,7 @@ static void cl_page_delete0(const struct lu_env *env, struct cl_page *pg)
 void cl_page_delete(const struct lu_env *env, struct cl_page *pg)
 {
 	PINVRNT(env, pg, cl_page_invariant(pg));
-	cl_page_delete0(env, pg);
+	__cl_page_delete(env, pg);
 }
 EXPORT_SYMBOL(cl_page_delete);
 
drivers/staging/lustre/lustre/obdecho/echo_client.c +10 -10
index 887df7ce6b5c..39b7ab1447a4 100644
@@ -910,9 +910,9 @@ static int cl_echo_object_put(struct echo_object *eco)
 	return 0;
 }
 
-static int cl_echo_enqueue0(struct lu_env *env, struct echo_object *eco,
-			    u64 start, u64 end, int mode,
-			    __u64 *cookie, __u32 enqflags)
+static int __cl_echo_enqueue(struct lu_env *env, struct echo_object *eco,
+			     u64 start, u64 end, int mode,
+			     __u64 *cookie, __u32 enqflags)
 {
 	struct cl_io *io;
 	struct cl_lock *lck;
@@ -953,8 +953,8 @@ static int cl_echo_enqueue0(struct lu_env *env, struct echo_object *eco,
 	return rc;
 }
 
-static int cl_echo_cancel0(struct lu_env *env, struct echo_device *ed,
-			   __u64 cookie)
+static int __cl_echo_cancel(struct lu_env *env, struct echo_device *ed,
+			    __u64 cookie)
 {
 	struct echo_client_obd *ec = ed->ed_ec;
 	struct echo_lock       *ecl = NULL;
@@ -1028,10 +1028,10 @@ static int cl_echo_object_brw(struct echo_object *eco, int rw, u64 offset,
 		goto out;
 	LASSERT(rc == 0);
 
-	rc = cl_echo_enqueue0(env, eco, offset,
-			      offset + npages * PAGE_SIZE - 1,
-			      rw == READ ? LCK_PR : LCK_PW, &lh.cookie,
-			      CEF_NEVER);
+	rc = __cl_echo_enqueue(env, eco, offset,
+			       offset + npages * PAGE_SIZE - 1,
+			       rw == READ ? LCK_PR : LCK_PW, &lh.cookie,
+			       CEF_NEVER);
 	if (rc < 0)
 		goto error_lock;
 
@@ -1079,7 +1079,7 @@ static int cl_echo_object_brw(struct echo_object *eco, int rw, u64 offset,
 		       async ? "async" : "sync", rc);
 	}
 
-	cl_echo_cancel0(env, ed, lh.cookie);
+	__cl_echo_cancel(env, ed, lh.cookie);
 error_lock:
 	cl_2queue_discard(env, io, queue);
 	cl_2queue_disown(env, io, queue);
#6 lore raw

PATCH 3/4 lustre: obdclass: change some foo0() to __foo()

Quoted 12 lines · NeilBrown

Change:
cl_io_init0 -> __cl_io_init
cl_lock_trace0 -> __cl_lock_trace
cl_page_delete0 -> __cl_page_delete
cl_page_state_set0 -> __cl_page_state_set
cl_page_own0 -> __cl_page_own
cl_page_disown0 -> __cl_page_disown
cl_page_delete0 -> __cl_page_delete
cl_echo_enqueue0 -> __cl_echo_enqueue
cl_echo_cancel0 -> __cl_echo_cancel

Quoted 3 lines

This is more consistent with Linux naming style.

Quoted 298 lines

---

drivers/staging/lustre/lustre/include/cl_object.h  |    6 ++-
drivers/staging/lustre/lustre/obdclass/cl_io.c     |   14 ++++----
drivers/staging/lustre/lustre/obdclass/cl_lock.c   |    8 ++--
drivers/staging/lustre/lustre/obdclass/cl_page.c   |   36 ++++++++++----------
.../staging/lustre/lustre/obdecho/echo_client.c    |   20 ++++++-----
5 files changed, 42 insertions(+), 42 deletions(-)
drivers/staging/lustre/lustre/include/cl_object.h +3 -3
index 4f0e8e271452..d0e61e503f9d 100644
@@ -803,7 +803,7 @@ struct cl_page_operations {
 	/**
 	 * cl_page<->struct page methods. Only one layer in the stack has to
 	 * implement these. Current code assumes that this functionality is
-	 * provided by the topmost layer, see cl_page_disown0() as an example.
+	 * provided by the topmost layer, see __cl_page_disown() as an example.
 	 */
 
 	/**
@@ -2144,8 +2144,8 @@ void cl_page_unassume(const struct lu_env *env,
 		      struct cl_io *io, struct cl_page *pg);
 void cl_page_disown(const struct lu_env *env,
 		    struct cl_io *io, struct cl_page *page);
-void cl_page_disown0(const struct lu_env *env,
-		     struct cl_io *io, struct cl_page *pg);
+void __cl_page_disown(const struct lu_env *env,
+		      struct cl_io *io, struct cl_page *pg);
 int cl_page_is_owned(const struct cl_page *pg, const struct cl_io *io);
 
 /** @} ownership */
drivers/staging/lustre/lustre/obdclass/cl_io.c +7 -7
index 0da731cfeb30..84c7710f80d7 100644
@@ -131,8 +131,8 @@ void cl_io_fini(const struct lu_env *env, struct cl_io *io)
 }
 EXPORT_SYMBOL(cl_io_fini);
 
-static int cl_io_init0(const struct lu_env *env, struct cl_io *io,
-		       enum cl_io_type iot, struct cl_object *obj)
+static int __cl_io_init(const struct lu_env *env, struct cl_io *io,
+			enum cl_io_type iot, struct cl_object *obj)
 {
 	struct cl_object *scan;
 	int result;
@@ -169,7 +169,7 @@ int cl_io_sub_init(const struct lu_env *env, struct cl_io *io,
 {
 	LASSERT(obj != cl_object_top(obj));
 
-	return cl_io_init0(env, io, iot, obj);
+	return __cl_io_init(env, io, iot, obj);
 }
 EXPORT_SYMBOL(cl_io_sub_init);
 
@@ -188,7 +188,7 @@ int cl_io_init(const struct lu_env *env, struct cl_io *io,
 {
 	LASSERT(obj == cl_object_top(obj));
 
-	return cl_io_init0(env, io, iot, obj);
+	return __cl_io_init(env, io, iot, obj);
 }
 EXPORT_SYMBOL(cl_io_init);
 
@@ -897,14 +897,14 @@ void cl_page_list_disown(const struct lu_env *env,
 		list_del_init(&page->cp_batch);
 		--plist->pl_nr;
 		/*
-		 * cl_page_disown0 rather than usual cl_page_disown() is used,
+		 * __cl_page_disown rather than usual cl_page_disown() is used,
 		 * because pages are possibly in CPS_FREEING state already due
 		 * to the call to cl_page_list_discard().
 		 */
 		/*
-		 * XXX cl_page_disown0() will fail if page is not locked.
+		 * XXX __cl_page_disown() will fail if page is not locked.
 		 */
-		cl_page_disown0(env, io, page);
+		__cl_page_disown(env, io, page);
 		lu_ref_del_at(&page->cp_reference, &page->cp_queue_ref, "queue",
 			      plist);
 		cl_page_put(env, page);
drivers/staging/lustre/lustre/obdclass/cl_lock.c +4 -4
index 9ca29a26a38b..23c1609415a3 100644
@@ -45,9 +45,9 @@
 #include <cl_object.h>
 #include "cl_internal.h"
 
-static void cl_lock_trace0(int level, const struct lu_env *env,
-			   const char *prefix, const struct cl_lock *lock,
-			   const char *func, const int line)
+static void __cl_lock_trace(int level, const struct lu_env *env,
+			    const char *prefix, const struct cl_lock *lock,
+			    const char *func, const int line)
 {
 	struct cl_object_header *h = cl_object_header(lock->cll_descr.cld_obj);
 
@@ -55,7 +55,7 @@ static void cl_lock_trace0(int level, const struct lu_env *env,
 	       prefix, lock, env, h->coh_nesting, func, line);
 }
 #define cl_lock_trace(level, env, prefix, lock)				\
-	cl_lock_trace0(level, env, prefix, lock, __func__, __LINE__)
+	__cl_lock_trace(level, env, prefix, lock, __func__, __LINE__)
 
 /**
 * Adds lock slice to the compound lock.
drivers/staging/lustre/lustre/obdclass/cl_page.c +18 -18
index 00df94b87606..5794b1cbfb54 100644
@@ -45,7 +45,7 @@
 #include <cl_object.h>
 #include "cl_internal.h"
 
-static void cl_page_delete0(const struct lu_env *env, struct cl_page *pg);
+static void __cl_page_delete(const struct lu_env *env, struct cl_page *pg);
 
 # define PASSERT(env, page, expr)					   \
 	do {								   \
@@ -156,7 +156,7 @@ struct cl_page *cl_page_alloc(const struct lu_env *env,
 				result = o->co_ops->coo_page_init(env, o, page,
 								  ind);
 				if (result != 0) {
-					cl_page_delete0(env, page);
+					__cl_page_delete(env, page);
 					cl_page_free(env, page);
 					page = ERR_PTR(result);
 					break;
@@ -228,8 +228,8 @@ static inline int cl_page_invariant(const struct cl_page *pg)
 	return cl_page_in_use_noref(pg);
 }
 
-static void cl_page_state_set0(const struct lu_env *env,
-			       struct cl_page *page, enum cl_page_state state)
+static void __cl_page_state_set(const struct lu_env *env,
+				struct cl_page *page, enum cl_page_state state)
 {
 	enum cl_page_state old;
 
@@ -286,7 +286,7 @@ static void cl_page_state_set0(const struct lu_env *env,
 static void cl_page_state_set(const struct lu_env *env,
 			      struct cl_page *page, enum cl_page_state state)
 {
-	cl_page_state_set0(env, page, state);
+	__cl_page_state_set(env, page, state);
 }
 
 /**
@@ -377,7 +377,7 @@ static void cl_page_owner_set(struct cl_page *page)
 	page->cp_owner->ci_owned_nr++;
 }
 
-void cl_page_disown0(const struct lu_env *env,
+void __cl_page_disown(const struct lu_env *env,
 		     struct cl_io *io, struct cl_page *pg)
 {
 	const struct cl_page_slice *slice;
@@ -433,8 +433,8 @@ EXPORT_SYMBOL(cl_page_is_owned);
 * \see cl_page_own_try()
 * \see cl_page_own
 */
-static int cl_page_own0(const struct lu_env *env, struct cl_io *io,
-			struct cl_page *pg, int nonblock)
+static int __cl_page_own(const struct lu_env *env, struct cl_io *io,
+			 struct cl_page *pg, int nonblock)
 {
 	const struct cl_page_slice *slice;
 	int result = 0;
@@ -465,7 +465,7 @@ static int cl_page_own0(const struct lu_env *env, struct cl_io *io,
 		if (pg->cp_state != CPS_FREEING) {
 			cl_page_state_set(env, pg, CPS_OWNED);
 		} else {
-			cl_page_disown0(env, io, pg);
+			__cl_page_disown(env, io, pg);
 			result = -ENOENT;
 		}
 	}
@@ -477,23 +477,23 @@ static int cl_page_own0(const struct lu_env *env, struct cl_io *io,
 /**
 * Own a page, might be blocked.
 *
- * \see cl_page_own0()
+ * \see __cl_page_own()
 */
 int cl_page_own(const struct lu_env *env, struct cl_io *io, struct cl_page *pg)
 {
-	return cl_page_own0(env, io, pg, 0);
+	return __cl_page_own(env, io, pg, 0);
 }
 EXPORT_SYMBOL(cl_page_own);
 
 /**
 * Nonblock version of cl_page_own().
 *
- * \see cl_page_own0()
+ * \see __cl_page_own()
 */
 int cl_page_own_try(const struct lu_env *env, struct cl_io *io,
 		    struct cl_page *pg)
 {
-	return cl_page_own0(env, io, pg, 1);
+	return __cl_page_own(env, io, pg, 1);
 }
 EXPORT_SYMBOL(cl_page_own_try);
 
@@ -576,7 +576,7 @@ void cl_page_disown(const struct lu_env *env,
 		pg->cp_state == CPS_FREEING);
 
 	io = cl_io_top(io);
-	cl_page_disown0(env, io, pg);
+	__cl_page_disown(env, io, pg);
 }
 EXPORT_SYMBOL(cl_page_disown);
 
@@ -607,10 +607,10 @@ EXPORT_SYMBOL(cl_page_discard);
 
 /**
 * Version of cl_page_delete() that can be called for not fully constructed
- * pages, e.g,. in a error handling cl_page_find()->cl_page_delete0()
+ * pages, e.g,. in a error handling cl_page_find()->__cl_page_delete()
 * path. Doesn't check page invariant.
 */
-static void cl_page_delete0(const struct lu_env *env, struct cl_page *pg)
+static void __cl_page_delete(const struct lu_env *env, struct cl_page *pg)
 {
 	const struct cl_page_slice *slice;
 
@@ -620,7 +620,7 @@ static void cl_page_delete0(const struct lu_env *env, struct cl_page *pg)
 	 * Sever all ways to obtain new pointers to @pg.
 	 */
 	cl_page_owner_clear(pg);
-	cl_page_state_set0(env, pg, CPS_FREEING);
+	__cl_page_state_set(env, pg, CPS_FREEING);
 
 	list_for_each_entry_reverse(slice, &pg->cp_layers, cpl_linkage) {
 		if (slice->cpl_ops->cpo_delete)
@@ -655,7 +655,7 @@ static void cl_page_delete0(const struct lu_env *env, struct cl_page *pg)
 void cl_page_delete(const struct lu_env *env, struct cl_page *pg)
 {
 	PINVRNT(env, pg, cl_page_invariant(pg));
-	cl_page_delete0(env, pg);
+	__cl_page_delete(env, pg);
 }
 EXPORT_SYMBOL(cl_page_delete);
 
drivers/staging/lustre/lustre/obdecho/echo_client.c +10 -10
index 887df7ce6b5c..39b7ab1447a4 100644
@@ -910,9 +910,9 @@ static int cl_echo_object_put(struct echo_object *eco)
 	return 0;
 }
 
-static int cl_echo_enqueue0(struct lu_env *env, struct echo_object *eco,
-			    u64 start, u64 end, int mode,
-			    __u64 *cookie, __u32 enqflags)
+static int __cl_echo_enqueue(struct lu_env *env, struct echo_object *eco,
+			     u64 start, u64 end, int mode,
+			     __u64 *cookie, __u32 enqflags)
 {
 	struct cl_io *io;
 	struct cl_lock *lck;
@@ -953,8 +953,8 @@ static int cl_echo_enqueue0(struct lu_env *env, struct echo_object *eco,
 	return rc;
 }
 
-static int cl_echo_cancel0(struct lu_env *env, struct echo_device *ed,
-			   __u64 cookie)
+static int __cl_echo_cancel(struct lu_env *env, struct echo_device *ed,
+			    __u64 cookie)
 {
 	struct echo_client_obd *ec = ed->ed_ec;
 	struct echo_lock       *ecl = NULL;
@@ -1028,10 +1028,10 @@ static int cl_echo_object_brw(struct echo_object *eco, int rw, u64 offset,
 		goto out;
 	LASSERT(rc == 0);
 
-	rc = cl_echo_enqueue0(env, eco, offset,
-			      offset + npages * PAGE_SIZE - 1,
-			      rw == READ ? LCK_PR : LCK_PW, &lh.cookie,
-			      CEF_NEVER);
+	rc = __cl_echo_enqueue(env, eco, offset,
+			       offset + npages * PAGE_SIZE - 1,
+			       rw == READ ? LCK_PR : LCK_PW, &lh.cookie,
+			       CEF_NEVER);
 	if (rc < 0)
 		goto error_lock;
 
@@ -1079,7 +1079,7 @@ static int cl_echo_object_brw(struct echo_object *eco, int rw, u64 offset,
 		       async ? "async" : "sync", rc);
 	}
 
-	cl_echo_cancel0(env, ed, lh.cookie);
+	__cl_echo_cancel(env, ed, lh.cookie);

error_lock:

Quoted 4 lines
	cl_2queue_discard(env, io, queue);
	cl_2queue_disown(env, io, queue);

Cheers, Andreas
---
Andreas Dilger
CTO Whamcloud

author
#7 lore raw

PATCH 4/4 lustre: ptlrpc: change some foo0() to __foo()

In reply to NeilBrown

Change:
nrs_policy_stop0 -> __nrs_policy_stop nrs_svcpt_setup_locked0 -> __nrs_svcpt_setup_locked ptlrpc_nrs_req_get_nolock0 -> __ptlrpc_nrs_req_get_nolock

This is more consistent with Linux naming style.

---
 drivers/staging/lustre/lustre/ptlrpc/nrs.c         |   20 ++++++++++----------
 drivers/staging/lustre/lustre/ptlrpc/nrs_fifo.c    |    2 +-
 .../staging/lustre/lustre/ptlrpc/ptlrpc_internal.h |    6 +++---
 3 files changed, 14 insertions(+), 14 deletions(-)
drivers/staging/lustre/lustre/ptlrpc/nrs.c +10 -10
index e09b86529c5d..248ba045fb79 100644
@@ -82,7 +82,7 @@ static int nrs_policy_ctl_locked(struct ptlrpc_nrs_policy *policy,
 	       -ENOSYS;
 }
 
-static void nrs_policy_stop0(struct ptlrpc_nrs_policy *policy)
+static void __nrs_policy_stop(struct ptlrpc_nrs_policy *policy)
 {
 	if (policy->pol_desc->pd_ops->op_policy_stop)
 		policy->pol_desc->pd_ops->op_policy_stop(policy);
@@ -126,7 +126,7 @@ static int nrs_policy_stop_locked(struct ptlrpc_nrs_policy *policy)
 
 	/* I have the only refcount */
 	if (policy->pol_ref == 1)
-		nrs_policy_stop0(policy);
+		__nrs_policy_stop(policy);
 
 	return 0;
 }
@@ -151,7 +151,7 @@ static void nrs_policy_stop_primary(struct ptlrpc_nrs *nrs)
 	tmp->pol_state = NRS_POL_STATE_STOPPING;
 
 	if (tmp->pol_ref == 0)
-		nrs_policy_stop0(tmp);
+		__nrs_policy_stop(tmp);
 }
 
 /**
@@ -300,7 +300,7 @@ static void nrs_policy_put_locked(struct ptlrpc_nrs_policy *policy)
 	policy->pol_ref--;
 	if (unlikely(policy->pol_ref == 0 &&
 		     policy->pol_state == NRS_POL_STATE_STOPPING))
-		nrs_policy_stop0(policy);
+		__nrs_policy_stop(policy);
 }
 
 static void nrs_policy_put(struct ptlrpc_nrs_policy *policy)
@@ -888,8 +888,8 @@ static int nrs_register_policies_locked(struct ptlrpc_nrs *nrs)
  *
  * \pre mutex_is_locked(&nrs_core.nrs_mutex)
  */
-static int nrs_svcpt_setup_locked0(struct ptlrpc_nrs *nrs,
-				   struct ptlrpc_service_part *svcpt)
+static int __nrs_svcpt_setup_locked(struct ptlrpc_nrs *nrs,
+				    struct ptlrpc_service_part *svcpt)
 {
 	enum ptlrpc_nrs_queue_type queue;
 
@@ -931,7 +931,7 @@ static int nrs_svcpt_setup_locked(struct ptlrpc_service_part *svcpt)
 	 * Initialize the regular NRS head.
 	 */
 	nrs = nrs_svcpt2nrs(svcpt, false);
-	rc = nrs_svcpt_setup_locked0(nrs, svcpt);
+	rc = __nrs_svcpt_setup_locked(nrs, svcpt);
 	if (rc < 0)
 		goto out;
 
@@ -951,7 +951,7 @@ static int nrs_svcpt_setup_locked(struct ptlrpc_service_part *svcpt)
 	}
 
 	nrs = nrs_svcpt2nrs(svcpt, true);
-	rc = nrs_svcpt_setup_locked0(nrs, svcpt);
+	rc = __nrs_svcpt_setup_locked(nrs, svcpt);
 
 out:
 	return rc;
@@ -1444,8 +1444,8 @@ static void nrs_request_removed(struct ptlrpc_nrs_policy *policy)
  * \retval NULL the head has no requests to serve
  */
 struct ptlrpc_request *
-ptlrpc_nrs_req_get_nolock0(struct ptlrpc_service_part *svcpt, bool hp,
-			   bool peek, bool force)
+__ptlrpc_nrs_req_get_nolock(struct ptlrpc_service_part *svcpt, bool hp,
+			    bool peek, bool force)
 {
 	struct ptlrpc_nrs *nrs = nrs_svcpt2nrs(svcpt, hp);
 	struct ptlrpc_nrs_policy *policy;
drivers/staging/lustre/lustre/ptlrpc/nrs_fifo.c +1 -1
index ff630d94dd26..7fe8aeeff428 100644
@@ -96,7 +96,7 @@ static int nrs_fifo_start(struct ptlrpc_nrs_policy *policy)
  *
  * \param[in] policy The policy to stop
  *
- * \see nrs_policy_stop0()
+ * \see __nrs_policy_stop()
  */
 static void nrs_fifo_stop(struct ptlrpc_nrs_policy *policy)
 {
drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h +3 -3
index 177010cf7148..da42b99fc36f 100644
@@ -133,14 +133,14 @@ void ptlrpc_nrs_req_add(struct ptlrpc_service_part *svcpt,
 			struct ptlrpc_request *req, bool hp);
 
 struct ptlrpc_request *
-ptlrpc_nrs_req_get_nolock0(struct ptlrpc_service_part *svcpt, bool hp,
-			   bool peek, bool force);
+__ptlrpc_nrs_req_get_nolock(struct ptlrpc_service_part *svcpt, bool hp,
+			    bool peek, bool force);
 
 static inline struct ptlrpc_request *
 ptlrpc_nrs_req_get_nolock(struct ptlrpc_service_part *svcpt, bool hp,
 			  bool force)
 {
-	return ptlrpc_nrs_req_get_nolock0(svcpt, hp, false, force);
+	return __ptlrpc_nrs_req_get_nolock(svcpt, hp, false, force);
 }
 
 bool ptlrpc_nrs_req_pending_nolock(struct ptlrpc_service_part *svcpt, bool hp);
#8 lore raw

PATCH 4/4 lustre: ptlrpc: change some foo0() to __foo()

Quoted 9 lines · NeilBrown

Change:
nrs_policy_stop0 -> __nrs_policy_stop nrs_svcpt_setup_locked0 -> __nrs_svcpt_setup_locked ptlrpc_nrs_req_get_nolock0 -> __ptlrpc_nrs_req_get_nolock

This is more consistent with Linux naming style.

Quoted 120 lines

---

drivers/staging/lustre/lustre/ptlrpc/nrs.c         |   20 ++++++++++----------
drivers/staging/lustre/lustre/ptlrpc/nrs_fifo.c    |    2 +-
.../staging/lustre/lustre/ptlrpc/ptlrpc_internal.h |    6 +++---
3 files changed, 14 insertions(+), 14 deletions(-)
drivers/staging/lustre/lustre/ptlrpc/nrs.c +8 -8
index e09b86529c5d..248ba045fb79 100644
@@ -82,7 +82,7 @@ static int nrs_policy_ctl_locked(struct ptlrpc_nrs_policy *policy,
 	       -ENOSYS;
 }
 
-static void nrs_policy_stop0(struct ptlrpc_nrs_policy *policy)
+static void __nrs_policy_stop(struct ptlrpc_nrs_policy *policy)
 {
 	if (policy->pol_desc->pd_ops->op_policy_stop)
 		policy->pol_desc->pd_ops->op_policy_stop(policy);
@@ -126,7 +126,7 @@ static int nrs_policy_stop_locked(struct ptlrpc_nrs_policy *policy)
 
 	/* I have the only refcount */
 	if (policy->pol_ref == 1)
-		nrs_policy_stop0(policy);
+		__nrs_policy_stop(policy);
 
 	return 0;
 }
@@ -151,7 +151,7 @@ static void nrs_policy_stop_primary(struct ptlrpc_nrs *nrs)
 	tmp->pol_state = NRS_POL_STATE_STOPPING;
 
 	if (tmp->pol_ref == 0)
-		nrs_policy_stop0(tmp);
+		__nrs_policy_stop(tmp);
 }
 
 /**
@@ -300,7 +300,7 @@ static void nrs_policy_put_locked(struct ptlrpc_nrs_policy *policy)
 	policy->pol_ref--;
 	if (unlikely(policy->pol_ref == 0 &&
 		     policy->pol_state == NRS_POL_STATE_STOPPING))
-		nrs_policy_stop0(policy);
+		__nrs_policy_stop(policy);
 }
 
 static void nrs_policy_put(struct ptlrpc_nrs_policy *policy)
@@ -888,8 +888,8 @@ static int nrs_register_policies_locked(struct ptlrpc_nrs *nrs)
 *
 * \pre mutex_is_locked(&nrs_core.nrs_mutex)
 */
-static int nrs_svcpt_setup_locked0(struct ptlrpc_nrs *nrs,
-				   struct ptlrpc_service_part *svcpt)
+static int __nrs_svcpt_setup_locked(struct ptlrpc_nrs *nrs,
+				    struct ptlrpc_service_part *svcpt)
 {
 	enum ptlrpc_nrs_queue_type queue;
 
@@ -931,7 +931,7 @@ static int nrs_svcpt_setup_locked(struct ptlrpc_service_part *svcpt)
 	 * Initialize the regular NRS head.
 	 */
 	nrs = nrs_svcpt2nrs(svcpt, false);
-	rc = nrs_svcpt_setup_locked0(nrs, svcpt);
+	rc = __nrs_svcpt_setup_locked(nrs, svcpt);
 	if (rc < 0)
 		goto out;
 
@@ -951,7 +951,7 @@ static int nrs_svcpt_setup_locked(struct ptlrpc_service_part *svcpt)
 	}
 
 	nrs = nrs_svcpt2nrs(svcpt, true);
-	rc = nrs_svcpt_setup_locked0(nrs, svcpt);
+	rc = __nrs_svcpt_setup_locked(nrs, svcpt);
 

out:

	return rc;
drivers/staging/lustre/lustre/ptlrpc/nrs.c +0 -0
@@ -1444,8 +1444,8 @@ static void nrs_request_removed(struct ptlrpc_nrs_policy *policy)
 * \retval NULL the head has no requests to serve
 */

struct ptlrpc_request *

drivers/staging/lustre/lustre/ptlrpc/nrs.c +2 -2
-ptlrpc_nrs_req_get_nolock0(struct ptlrpc_service_part *svcpt, bool hp,
-			   bool peek, bool force)
+__ptlrpc_nrs_req_get_nolock(struct ptlrpc_service_part *svcpt, bool hp,
+			    bool peek, bool force)
{
	struct ptlrpc_nrs *nrs = nrs_svcpt2nrs(svcpt, hp);
	struct ptlrpc_nrs_policy *policy;
drivers/staging/lustre/lustre/ptlrpc/nrs_fifo.c +1 -1
index ff630d94dd26..7fe8aeeff428 100644
@@ -96,7 +96,7 @@ static int nrs_fifo_start(struct ptlrpc_nrs_policy *policy)
 *
 * \param[in] policy The policy to stop
 *
- * \see nrs_policy_stop0()
+ * \see __nrs_policy_stop()
 */
 static void nrs_fifo_stop(struct ptlrpc_nrs_policy *policy)
 {
drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h +0 -0
index 177010cf7148..da42b99fc36f 100644
@@ -133,14 +133,14 @@ void ptlrpc_nrs_req_add(struct ptlrpc_service_part *svcpt,
 			struct ptlrpc_request *req, bool hp);
 

struct ptlrpc_request *

drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h +2 -2
-ptlrpc_nrs_req_get_nolock0(struct ptlrpc_service_part *svcpt, bool hp,
-			   bool peek, bool force);
+__ptlrpc_nrs_req_get_nolock(struct ptlrpc_service_part *svcpt, bool hp,
+			    bool peek, bool force);

static inline struct ptlrpc_request * ptlrpc_nrs_req_get_nolock(struct ptlrpc_service_part *svcpt, bool hp,
bool force)
{

drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h +1 -1
-	return ptlrpc_nrs_req_get_nolock0(svcpt, hp, false, force);
+	return __ptlrpc_nrs_req_get_nolock(svcpt, hp, false, force);

}

Quoted 3 lines

bool ptlrpc_nrs_req_pending_nolock(struct ptlrpc_service_part *svcpt, bool hp);

Cheers, Andreas
---
Andreas Dilger
Principal Lustre Architect
Whamcloud

#9 lore raw

PATCH 4/4 lustre: ptlrpc: change some foo0() to __foo()

In reply to NeilBrown

On 1/10/19, 4:01 PM, "NeilBrown" <[email protected]> wrote:

    Change:
      nrs_policy_stop0 -> __nrs_policy_stop
      nrs_svcpt_setup_locked0 -> __nrs_svcpt_setup_locked
      ptlrpc_nrs_req_get_nolock0 -> __ptlrpc_nrs_req_get_nolock
    
    This is more consistent with Linux naming style.
    
    Signed-off-by: NeilBrown <[email protected]>
    ---
     drivers/staging/lustre/lustre/ptlrpc/nrs.c         |   20 ++++++++++----------
     drivers/staging/lustre/lustre/ptlrpc/nrs_fifo.c    |    2 +-
     .../staging/lustre/lustre/ptlrpc/ptlrpc_internal.h |    6 +++---
     3 files changed, 14 insertions(+), 14 deletions(-)
    
    diff --git a/drivers/staging/lustre/lustre/ptlrpc/nrs.c b/drivers/staging/lustre/lustre/ptlrpc/nrs.c
    index e09b86529c5d..248ba045fb79 100644
    --- a/drivers/staging/lustre/lustre/ptlrpc/nrs.c
    +++ b/drivers/staging/lustre/lustre/ptlrpc/nrs.c
    @@ -82,7 +82,7 @@ static int nrs_policy_ctl_locked(struct ptlrpc_nrs_policy *policy,
     	       -ENOSYS;
     }
     
    -static void nrs_policy_stop0(struct ptlrpc_nrs_policy *policy)
    +static void __nrs_policy_stop(struct ptlrpc_nrs_policy *policy)
     {
     	if (policy->pol_desc->pd_ops->op_policy_stop)
     		policy->pol_desc->pd_ops->op_policy_stop(policy);
    @@ -126,7 +126,7 @@ static int nrs_policy_stop_locked(struct ptlrpc_nrs_policy *policy)
     
     	/* I have the only refcount */
     	if (policy->pol_ref == 1)
    -		nrs_policy_stop0(policy);
    +		__nrs_policy_stop(policy);
     
     	return 0;
     }
    @@ -151,7 +151,7 @@ static void nrs_policy_stop_primary(struct ptlrpc_nrs *nrs)
     	tmp->pol_state = NRS_POL_STATE_STOPPING;
     
     	if (tmp->pol_ref == 0)
    -		nrs_policy_stop0(tmp);
    +		__nrs_policy_stop(tmp);
     }
     
     /**
    @@ -300,7 +300,7 @@ static void nrs_policy_put_locked(struct ptlrpc_nrs_policy *policy)
     	policy->pol_ref--;
     	if (unlikely(policy->pol_ref == 0 &&
     		     policy->pol_state == NRS_POL_STATE_STOPPING))
    -		nrs_policy_stop0(policy);
    +		__nrs_policy_stop(policy);
     }

"nrs_policy_stop0()" also appears in a comment in drivers/staging/lustre/lustre/include/lustre_nrs.h, if you would like to change that as well? Other than that, please feel free to add:

     static void nrs_policy_put(struct ptlrpc_nrs_policy *policy)
    @@ -888,8 +888,8 @@ static int nrs_register_policies_locked(struct ptlrpc_nrs *nrs)
      *
      * \pre mutex_is_locked(&nrs_core.nrs_mutex)
      */
    -static int nrs_svcpt_setup_locked0(struct ptlrpc_nrs *nrs,
    -				   struct ptlrpc_service_part *svcpt)
    +static int __nrs_svcpt_setup_locked(struct ptlrpc_nrs *nrs,
    +				    struct ptlrpc_service_part *svcpt)
     {
     	enum ptlrpc_nrs_queue_type queue;
     
    @@ -931,7 +931,7 @@ static int nrs_svcpt_setup_locked(struct ptlrpc_service_part *svcpt)
     	 * Initialize the regular NRS head.
     	 */
     	nrs = nrs_svcpt2nrs(svcpt, false);
    -	rc = nrs_svcpt_setup_locked0(nrs, svcpt);
    +	rc = __nrs_svcpt_setup_locked(nrs, svcpt);
     	if (rc < 0)
     		goto out;
     
    @@ -951,7 +951,7 @@ static int nrs_svcpt_setup_locked(struct ptlrpc_service_part *svcpt)
     	}
     
     	nrs = nrs_svcpt2nrs(svcpt, true);
    -	rc = nrs_svcpt_setup_locked0(nrs, svcpt);
    +	rc = __nrs_svcpt_setup_locked(nrs, svcpt);
     
     out:
     	return rc;
    @@ -1444,8 +1444,8 @@ static void nrs_request_removed(struct ptlrpc_nrs_policy *policy)
      * \retval NULL the head has no requests to serve
      */
     struct ptlrpc_request *
    -ptlrpc_nrs_req_get_nolock0(struct ptlrpc_service_part *svcpt, bool hp,
    -			   bool peek, bool force)
    +__ptlrpc_nrs_req_get_nolock(struct ptlrpc_service_part *svcpt, bool hp,
    +			    bool peek, bool force)
     {
     	struct ptlrpc_nrs *nrs = nrs_svcpt2nrs(svcpt, hp);
     	struct ptlrpc_nrs_policy *policy;
    diff --git a/drivers/staging/lustre/lustre/ptlrpc/nrs_fifo.c b/drivers/staging/lustre/lustre/ptlrpc/nrs_fifo.c
    index ff630d94dd26..7fe8aeeff428 100644
    --- a/drivers/staging/lustre/lustre/ptlrpc/nrs_fifo.c
    +++ b/drivers/staging/lustre/lustre/ptlrpc/nrs_fifo.c
    @@ -96,7 +96,7 @@ static int nrs_fifo_start(struct ptlrpc_nrs_policy *policy)
      *
      * \param[in] policy The policy to stop
      *
    - * \see nrs_policy_stop0()
    + * \see __nrs_policy_stop()
      */
     static void nrs_fifo_stop(struct ptlrpc_nrs_policy *policy)
     {
    diff --git a/drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h b/drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h
    index 177010cf7148..da42b99fc36f 100644
    --- a/drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h
    +++ b/drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h
    @@ -133,14 +133,14 @@ void ptlrpc_nrs_req_add(struct ptlrpc_service_part *svcpt,
     			struct ptlrpc_request *req, bool hp);
     
     struct ptlrpc_request *
    -ptlrpc_nrs_req_get_nolock0(struct ptlrpc_service_part *svcpt, bool hp,
    -			   bool peek, bool force);
    +__ptlrpc_nrs_req_get_nolock(struct ptlrpc_service_part *svcpt, bool hp,
    +			    bool peek, bool force);
     
     static inline struct ptlrpc_request *
     ptlrpc_nrs_req_get_nolock(struct ptlrpc_service_part *svcpt, bool hp,
     			  bool force)
     {
    -	return ptlrpc_nrs_req_get_nolock0(svcpt, hp, false, force);
    +	return __ptlrpc_nrs_req_get_nolock(svcpt, hp, false, force);
     }
     
     bool ptlrpc_nrs_req_pending_nolock(struct ptlrpc_service_part *svcpt, bool hp);

Cheers,
Nikitas

author
#10 lore raw

PATCH 4/4 lustre: ptlrpc: change some foo0() to __foo()

Quoted 54 lines · Nikitas Angelinas

On 1/10/19, 4:01 PM, "NeilBrown" <[email protected]> wrote:

    Change:
      nrs_policy_stop0 -> __nrs_policy_stop
      nrs_svcpt_setup_locked0 -> __nrs_svcpt_setup_locked
      ptlrpc_nrs_req_get_nolock0 -> __ptlrpc_nrs_req_get_nolock
    
    This is more consistent with Linux naming style.
    
    Signed-off-by: NeilBrown <[email protected]>
    ---
     drivers/staging/lustre/lustre/ptlrpc/nrs.c         |   20 ++++++++++----------
     drivers/staging/lustre/lustre/ptlrpc/nrs_fifo.c    |    2 +-
     .../staging/lustre/lustre/ptlrpc/ptlrpc_internal.h |    6 +++---
     3 files changed, 14 insertions(+), 14 deletions(-)
    
    diff --git a/drivers/staging/lustre/lustre/ptlrpc/nrs.c b/drivers/staging/lustre/lustre/ptlrpc/nrs.c
    index e09b86529c5d..248ba045fb79 100644
    --- a/drivers/staging/lustre/lustre/ptlrpc/nrs.c
    +++ b/drivers/staging/lustre/lustre/ptlrpc/nrs.c
    @@ -82,7 +82,7 @@ static int nrs_policy_ctl_locked(struct ptlrpc_nrs_policy *policy,
     	       -ENOSYS;
     }
     
    -static void nrs_policy_stop0(struct ptlrpc_nrs_policy *policy)
    +static void __nrs_policy_stop(struct ptlrpc_nrs_policy *policy)
     {
     	if (policy->pol_desc->pd_ops->op_policy_stop)
     		policy->pol_desc->pd_ops->op_policy_stop(policy);
    @@ -126,7 +126,7 @@ static int nrs_policy_stop_locked(struct ptlrpc_nrs_policy *policy)
     
     	/* I have the only refcount */
     	if (policy->pol_ref == 1)
    -		nrs_policy_stop0(policy);
    +		__nrs_policy_stop(policy);
     
     	return 0;
     }
    @@ -151,7 +151,7 @@ static void nrs_policy_stop_primary(struct ptlrpc_nrs *nrs)
     	tmp->pol_state = NRS_POL_STATE_STOPPING;
     
     	if (tmp->pol_ref == 0)
    -		nrs_policy_stop0(tmp);
    +		__nrs_policy_stop(tmp);
     }
     
     /**
    @@ -300,7 +300,7 @@ static void nrs_policy_put_locked(struct ptlrpc_nrs_policy *policy)
     	policy->pol_ref--;
     	if (unlikely(policy->pol_ref == 0 &&
     		     policy->pol_state == NRS_POL_STATE_STOPPING))
    -		nrs_policy_stop0(policy);
    +		__nrs_policy_stop(policy);
     }
Quoted 3 lines

"nrs_policy_stop0()" also appears in a comment in drivers/staging/lustre/lustre/include/lustre_nrs.h, if you would like to change that as well? Other than that, please feel free to add:

Thanks! I've fixed that missing change, and added your Reviewed-by.

NeilBrown
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://lists.lustre.org/pipermail/lustre-devel-lustre.org/attachments/20190130/12cd3a12/attachment.sig>