All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] Declare local functions as static
@ 2015-10-05  0:02 Shraddha Barke
  2015-10-05  0:02 ` [PATCH v2 1/4] Staging: lustre: obdclass: llog_swab: " Shraddha Barke
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Shraddha Barke @ 2015-10-05  0:02 UTC (permalink / raw)
  To: outreachy-kernel

Declare functions as static since they are used only in a particular file. 

Changes in v2-
 Made commit log and subject clearer.

Shraddha Barke (4):
  Staging: lustre: obdclass: llog_swab: Declare local functions as
    static
  Staging: lustre: obdclass: lprocfs_status: Declare typedefs as static
  Staging: lustre: ptlrpc: pack_generic: Declare local functions as
    static
  Staging: lustre: ptlrcpc: sec: Declare local functions as static

 drivers/staging/lustre/lustre/include/lprocfs_status.h    |  5 -----
 drivers/staging/lustre/lustre/include/lustre/lustre_idl.h |  5 -----
 drivers/staging/lustre/lustre/include/lustre_sec.h        |  7 -------
 drivers/staging/lustre/lustre/obdclass/llog_swab.c        |  6 ++----
 drivers/staging/lustre/lustre/obdclass/lprocfs_status.c   | 11 +++++------
 drivers/staging/lustre/lustre/ptlrpc/pack_generic.c       |  5 ++---
 drivers/staging/lustre/lustre/ptlrpc/sec.c                | 10 ++++------
 7 files changed, 13 insertions(+), 36 deletions(-)

-- 
2.1.4



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2 1/4] Staging: lustre: obdclass: llog_swab: Declare local functions as static
  2015-10-05  0:02 [PATCH v2 0/4] Declare local functions as static Shraddha Barke
@ 2015-10-05  0:02 ` Shraddha Barke
  2015-10-05  0:02 ` [PATCH v2 2/4] Staging: lustre: obdclass: lprocfs_status: Declare typedefs " Shraddha Barke
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Shraddha Barke @ 2015-10-05  0:02 UTC (permalink / raw)
  To: outreachy-kernel

Declare functions lustre_swab_llog_id and lustre_swab_ll_fid as static
since they are used only in this particular file. Also remove them from
corresponding header files.

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
---
Changes in v2-
 Made commit message and subject clearer.

 drivers/staging/lustre/lustre/include/lustre/lustre_idl.h | 2 --
 drivers/staging/lustre/lustre/obdclass/llog_swab.c        | 6 ++----
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index 9cc92bb..94d4028 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -2116,7 +2116,6 @@ void lustre_swab_generic_32s(__u32 *val);
 /* This FULL lock is useful to take on unlink sort of operations */
 #define MDS_INODELOCK_FULL ((1<<(MDS_INODELOCK_MAXSHIFT+1))-1)
 
-void lustre_swab_ll_fid(struct ll_fid *fid);
 
 /* NOTE: until Lustre 1.8.7/2.1.1 the fid_ver() was packed into name[2],
  * but was moved into name[1] along with the OID to avoid consuming the
@@ -3349,7 +3348,6 @@ void lustre_swab_llogd_body(struct llogd_body *d);
 void lustre_swab_llog_hdr(struct llog_log_hdr *h);
 void lustre_swab_llogd_conn_body(struct llogd_conn_body *d);
 void lustre_swab_llog_rec(struct llog_rec_hdr *rec);
-void lustre_swab_llog_id(struct llog_logid *lid);
 
 struct lustre_cfg;
 void lustre_swab_lustre_cfg(struct lustre_cfg *lcfg);
diff --git a/drivers/staging/lustre/lustre/obdclass/llog_swab.c b/drivers/staging/lustre/lustre/obdclass/llog_swab.c
index a2d5aa1..054fd31 100644
--- a/drivers/staging/lustre/lustre/obdclass/llog_swab.c
+++ b/drivers/staging/lustre/lustre/obdclass/llog_swab.c
@@ -78,13 +78,12 @@ void lustre_swab_ost_id(struct ost_id *oid)
 }
 EXPORT_SYMBOL(lustre_swab_ost_id);
 
-void lustre_swab_llog_id(struct llog_logid *log_id)
+static void lustre_swab_llog_id(struct llog_logid *log_id)
 {
 	__swab64s(&log_id->lgl_oi.oi.oi_id);
 	__swab64s(&log_id->lgl_oi.oi.oi_seq);
 	__swab32s(&log_id->lgl_ogen);
 }
-EXPORT_SYMBOL(lustre_swab_llog_id);
 
 void lustre_swab_llogd_body(struct llogd_body *d)
 {
@@ -109,13 +108,12 @@ void lustre_swab_llogd_conn_body(struct llogd_conn_body *d)
 }
 EXPORT_SYMBOL(lustre_swab_llogd_conn_body);
 
-void lustre_swab_ll_fid(struct ll_fid *fid)
+static void lustre_swab_ll_fid(struct ll_fid *fid)
 {
 	__swab64s(&fid->id);
 	__swab32s(&fid->generation);
 	__swab32s(&fid->f_type);
 }
-EXPORT_SYMBOL(lustre_swab_ll_fid);
 
 void lustre_swab_lu_seq_range(struct lu_seq_range *range)
 {
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v2 2/4] Staging: lustre: obdclass: lprocfs_status: Declare typedefs as static
  2015-10-05  0:02 [PATCH v2 0/4] Declare local functions as static Shraddha Barke
  2015-10-05  0:02 ` [PATCH v2 1/4] Staging: lustre: obdclass: llog_swab: " Shraddha Barke
@ 2015-10-05  0:02 ` Shraddha Barke
  2015-10-08  9:19   ` [Outreachy kernel] " Greg KH
  2015-10-05  0:02 ` [PATCH v2 3/4] Staging: lustre: ptlrpc: pack_generic: Declare local functions " Shraddha Barke
  2015-10-05  0:02 ` [PATCH v2 4/4] Staging: lustre: ptlrcpc: sec: " Shraddha Barke
  3 siblings, 1 reply; 7+ messages in thread
From: Shraddha Barke @ 2015-10-05  0:02 UTC (permalink / raw)
  To: outreachy-kernel

Declare typedefs  lustre_attr_show and lustre_attr_store as static
since they are used only in this particular file. Also remove them from
corresponding header files.

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
---
Changes in v2-
 Made commit message and subject clearer.

 drivers/staging/lustre/lustre/include/lprocfs_status.h  |  5 -----
 drivers/staging/lustre/lustre/obdclass/lprocfs_status.c | 11 +++++------
 2 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lprocfs_status.h b/drivers/staging/lustre/lustre/include/lprocfs_status.h
index 22f3777..6d127a0 100644
--- a/drivers/staging/lustre/lustre/include/lprocfs_status.h
+++ b/drivers/staging/lustre/lustre/include/lprocfs_status.h
@@ -713,11 +713,6 @@ static struct lustre_attr lustre_attr_##name = __ATTR(name, mode, show, store)
 #define LUSTRE_RO_ATTR(name) LUSTRE_ATTR(name, 0444, name##_show, NULL)
 #define LUSTRE_RW_ATTR(name) LUSTRE_ATTR(name, 0644, name##_show, name##_store)
 
-ssize_t lustre_attr_show(struct kobject *kobj, struct attribute *attr,
-			 char *buf);
-ssize_t lustre_attr_store(struct kobject *kobj, struct attribute *attr,
-			  const char *buf, size_t len);
-
 extern const struct sysfs_ops lustre_sysfs_ops;
 
 /* all quota proc functions */
diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
index da4afe0..65819bf 100644
--- a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
+++ b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
@@ -1467,23 +1467,22 @@ void lprocfs_oh_clear(struct obd_histogram *oh)
 }
 EXPORT_SYMBOL(lprocfs_oh_clear);
 
-ssize_t lustre_attr_show(struct kobject *kobj,
-			 struct attribute *attr, char *buf)
+static ssize_t lustre_attr_show(struct kobject *kobj,
+				struct attribute *attr, char *buf)
 {
 	struct lustre_attr *a = container_of(attr, struct lustre_attr, attr);
 
 	return a->show ? a->show(kobj, attr, buf) : 0;
 }
-EXPORT_SYMBOL_GPL(lustre_attr_show);
 
-ssize_t lustre_attr_store(struct kobject *kobj, struct attribute *attr,
-			  const char *buf, size_t len)
+static ssize_t lustre_attr_store(struct kobject *kobj, struct attribute *attr,
+				 const char *buf, size_t len)
 {
 	struct lustre_attr *a = container_of(attr, struct lustre_attr, attr);
 
 	return a->store ? a->store(kobj, attr, buf, len) : len;
 }
-EXPORT_SYMBOL_GPL(lustre_attr_store);
+
 
 const struct sysfs_ops lustre_sysfs_ops = {
 	.show  = lustre_attr_show,
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v2 3/4] Staging: lustre: ptlrpc: pack_generic: Declare local functions as static
  2015-10-05  0:02 [PATCH v2 0/4] Declare local functions as static Shraddha Barke
  2015-10-05  0:02 ` [PATCH v2 1/4] Staging: lustre: obdclass: llog_swab: " Shraddha Barke
  2015-10-05  0:02 ` [PATCH v2 2/4] Staging: lustre: obdclass: lprocfs_status: Declare typedefs " Shraddha Barke
@ 2015-10-05  0:02 ` Shraddha Barke
  2015-10-05  0:02 ` [PATCH v2 4/4] Staging: lustre: ptlrcpc: sec: " Shraddha Barke
  3 siblings, 0 replies; 7+ messages in thread
From: Shraddha Barke @ 2015-10-05  0:02 UTC (permalink / raw)
  To: outreachy-kernel

Declare functions lustre_swab_ldlm_lock_desc and dump_obdo as static since
they are used only in this particular file. Also remove them from
corresponding header files.

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
---
Changes in v2-
 Made commit message and subject clearer.

 drivers/staging/lustre/lustre/include/lustre/lustre_idl.h | 3 ---
 drivers/staging/lustre/lustre/ptlrpc/pack_generic.c       | 5 ++---
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index 94d4028..e629ca3 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -2785,8 +2785,6 @@ struct ldlm_lock_desc {
 	ldlm_wire_policy_data_t l_policy_data;
 };
 
-void lustre_swab_ldlm_lock_desc(struct ldlm_lock_desc *l);
-
 #define LDLM_LOCKREQ_HANDLES 2
 #define LDLM_ENQUEUE_CANCEL_OFF 1
 
@@ -3355,7 +3353,6 @@ void lustre_swab_lustre_cfg(struct lustre_cfg *lcfg);
 /* Functions for dumping PTLRPC fields */
 void dump_rniobuf(struct niobuf_remote *rnb);
 void dump_ioo(struct obd_ioobj *nb);
-void dump_obdo(struct obdo *oa);
 void dump_ost_body(struct ost_body *ob);
 void dump_rcs(__u32 *rc);
 
diff --git a/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c b/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c
index 3241b1f..23cf1b0 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c
@@ -1977,14 +1977,13 @@ void lustre_swab_ldlm_resource_desc(struct ldlm_resource_desc *r)
 }
 EXPORT_SYMBOL(lustre_swab_ldlm_resource_desc);
 
-void lustre_swab_ldlm_lock_desc(struct ldlm_lock_desc *l)
+static void lustre_swab_ldlm_lock_desc(struct ldlm_lock_desc *l)
 {
 	lustre_swab_ldlm_resource_desc(&l->l_resource);
 	__swab32s(&l->l_req_mode);
 	__swab32s(&l->l_granted_mode);
 	lustre_swab_ldlm_policy_data(&l->l_policy_data);
 }
-EXPORT_SYMBOL(lustre_swab_ldlm_lock_desc);
 
 void lustre_swab_ldlm_request(struct ldlm_request *rq)
 {
@@ -2033,7 +2032,7 @@ void dump_rniobuf(struct niobuf_remote *nb)
 }
 EXPORT_SYMBOL(dump_rniobuf);
 
-void dump_obdo(struct obdo *oa)
+static void dump_obdo(struct obdo *oa)
 {
 	__u32 valid = oa->o_valid;
 
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v2 4/4] Staging: lustre: ptlrcpc: sec: Declare local functions as static
  2015-10-05  0:02 [PATCH v2 0/4] Declare local functions as static Shraddha Barke
                   ` (2 preceding siblings ...)
  2015-10-05  0:02 ` [PATCH v2 3/4] Staging: lustre: ptlrpc: pack_generic: Declare local functions " Shraddha Barke
@ 2015-10-05  0:02 ` Shraddha Barke
  3 siblings, 0 replies; 7+ messages in thread
From: Shraddha Barke @ 2015-10-05  0:02 UTC (permalink / raw)
  To: outreachy-kernel

Declare functions sptlrpc_secflags2str, sptlrpc_sec_get and
sptlrpc_svc_install_rvs_ctx as static since they are used only
in this particular file. Also remove them from corresponding
header files.

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
---
Changes in v2-
 Made commit message and subject clearer.

 drivers/staging/lustre/lustre/include/lustre_sec.h |  7 -------
 drivers/staging/lustre/lustre/ptlrpc/sec.c         | 10 ++++------
 2 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_sec.h b/drivers/staging/lustre/lustre/include/lustre_sec.h
index fc1f573..76b3a84 100644
--- a/drivers/staging/lustre/lustre/include/lustre_sec.h
+++ b/drivers/staging/lustre/lustre/include/lustre_sec.h
@@ -916,7 +916,6 @@ const char *sptlrpc_flavor2name_base(__u32 flvr);
 char *sptlrpc_flavor2name_bulk(struct sptlrpc_flavor *sf,
 			       char *buf, int bufsize);
 char *sptlrpc_flavor2name(struct sptlrpc_flavor *sf, char *buf, int bufsize);
-char *sptlrpc_secflags2str(__u32 flags, char *buf, int bufsize);
 
 static inline
 struct ptlrpc_sec_policy *sptlrpc_policy_get(struct ptlrpc_sec_policy *policy)
@@ -979,7 +978,6 @@ int cli_ctx_is_eternal(struct ptlrpc_cli_ctx *ctx)
 /*
  * sec get/put
  */
-struct ptlrpc_sec *sptlrpc_sec_get(struct ptlrpc_sec *sec);
 void sptlrpc_sec_put(struct ptlrpc_sec *sec);
 
 /*
@@ -1058,11 +1056,6 @@ void sptlrpc_svc_ctx_decref(struct ptlrpc_request *req);
 
 int  sptlrpc_target_export_check(struct obd_export *exp,
 				 struct ptlrpc_request *req);
-/*
- * reverse context
- */
-int sptlrpc_svc_install_rvs_ctx(struct obd_import *imp,
-				struct ptlrpc_svc_ctx *ctx);
 
 /* bulk security api */
 void sptlrpc_enc_pool_put_pages(struct ptlrpc_bulk_desc *desc);
diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec.c b/drivers/staging/lustre/lustre/ptlrpc/sec.c
index 84e9881..3a6539c 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/sec.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/sec.c
@@ -227,7 +227,7 @@ char *sptlrpc_flavor2name(struct sptlrpc_flavor *sf, char *buf, int bufsize)
 }
 EXPORT_SYMBOL(sptlrpc_flavor2name);
 
-char *sptlrpc_secflags2str(__u32 flags, char *buf, int bufsize)
+static char *sptlrpc_secflags2str(__u32 flags, char *buf, int bufsize)
 {
 	buf[0] = '\0';
 
@@ -244,7 +244,6 @@ char *sptlrpc_secflags2str(__u32 flags, char *buf, int bufsize)
 
 	return buf;
 }
-EXPORT_SYMBOL(sptlrpc_secflags2str);
 
 /**************************************************
  * client context APIs			    *
@@ -1199,14 +1198,13 @@ static void sptlrpc_sec_kill(struct ptlrpc_sec *sec)
 	}
 }
 
-struct ptlrpc_sec *sptlrpc_sec_get(struct ptlrpc_sec *sec)
+static struct ptlrpc_sec *sptlrpc_sec_get(struct ptlrpc_sec *sec)
 {
 	if (sec)
 		atomic_inc(&sec->ps_refcount);
 
 	return sec;
 }
-EXPORT_SYMBOL(sptlrpc_sec_get);
 
 void sptlrpc_sec_put(struct ptlrpc_sec *sec)
 {
@@ -1643,8 +1641,8 @@ void sptlrpc_cli_free_repbuf(struct ptlrpc_request *req)
 	req->rq_repmsg = NULL;
 }
 
-int sptlrpc_svc_install_rvs_ctx(struct obd_import *imp,
-				struct ptlrpc_svc_ctx *ctx)
+static int sptlrpc_svc_install_rvs_ctx(struct obd_import *imp,
+				       struct ptlrpc_svc_ctx *ctx)
 {
 	struct ptlrpc_sec_policy *policy = ctx->sc_policy;
 
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [Outreachy kernel] [PATCH v2 2/4] Staging: lustre: obdclass: lprocfs_status: Declare typedefs as static
  2015-10-05  0:02 ` [PATCH v2 2/4] Staging: lustre: obdclass: lprocfs_status: Declare typedefs " Shraddha Barke
@ 2015-10-08  9:19   ` Greg KH
  2015-10-08 10:49     ` Shraddha Barke
  0 siblings, 1 reply; 7+ messages in thread
From: Greg KH @ 2015-10-08  9:19 UTC (permalink / raw)
  To: Shraddha Barke; +Cc: outreachy-kernel

On Mon, Oct 05, 2015 at 05:32:37AM +0530, Shraddha Barke wrote:
> Declare typedefs  lustre_attr_show and lustre_attr_store as static
> since they are used only in this particular file. Also remove them from
> corresponding header files.

"typedefs"?  I see no typedef changes here :(



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Outreachy kernel] [PATCH v2 2/4] Staging: lustre: obdclass: lprocfs_status: Declare typedefs as static
  2015-10-08  9:19   ` [Outreachy kernel] " Greg KH
@ 2015-10-08 10:49     ` Shraddha Barke
  0 siblings, 0 replies; 7+ messages in thread
From: Shraddha Barke @ 2015-10-08 10:49 UTC (permalink / raw)
  To: Greg KH; +Cc: outreachy-kernel



On Thu, 8 Oct 2015, Greg KH wrote:

> On Mon, Oct 05, 2015 at 05:32:37AM +0530, Shraddha Barke wrote:
>> Declare typedefs  lustre_attr_show and lustre_attr_store as static
>> since they are used only in this particular file. Also remove them from
>> corresponding header files.
>
> "typedefs"?  I see no typedef changes here :(


Shoot, my bad :( I'll fix it up and resend.

Thanks,

Shraddha
>
>


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-10-08 10:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-05  0:02 [PATCH v2 0/4] Declare local functions as static Shraddha Barke
2015-10-05  0:02 ` [PATCH v2 1/4] Staging: lustre: obdclass: llog_swab: " Shraddha Barke
2015-10-05  0:02 ` [PATCH v2 2/4] Staging: lustre: obdclass: lprocfs_status: Declare typedefs " Shraddha Barke
2015-10-08  9:19   ` [Outreachy kernel] " Greg KH
2015-10-08 10:49     ` Shraddha Barke
2015-10-05  0:02 ` [PATCH v2 3/4] Staging: lustre: ptlrpc: pack_generic: Declare local functions " Shraddha Barke
2015-10-05  0:02 ` [PATCH v2 4/4] Staging: lustre: ptlrcpc: sec: " Shraddha Barke

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.