public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fs/ceph: delete unused ceph_file_layout_is_valid function
@ 2017-12-12  1:56 Yaowei Bai
  2017-12-12 10:15 ` Ilya Dryomov
  0 siblings, 1 reply; 3+ messages in thread
From: Yaowei Bai @ 2017-12-12  1:56 UTC (permalink / raw)
  To: zyan, sage, idryomov; +Cc: ceph-devel, linux-kernel, baiyaowei

There's no users of ceph_file_layout_is_valid, remove it.

Signed-off-by: Yaowei Bai <baiyaowei@cmss.chinamobile.com>
---
 include/linux/ceph/ceph_fs.h |  1 -
 net/ceph/ceph_fs.c           | 23 -----------------------
 2 files changed, 24 deletions(-)

diff --git a/include/linux/ceph/ceph_fs.h b/include/linux/ceph/ceph_fs.h
index 88dd513..4b63e7b 100644
--- a/include/linux/ceph/ceph_fs.h
+++ b/include/linux/ceph/ceph_fs.h
@@ -67,7 +67,6 @@ struct ceph_file_layout {
 	struct ceph_string __rcu *pool_ns; /* rados pool namespace */
 };
 
-extern int ceph_file_layout_is_valid(const struct ceph_file_layout *layout);
 extern void ceph_file_layout_from_legacy(struct ceph_file_layout *fl,
 				struct ceph_file_layout_legacy *legacy);
 extern void ceph_file_layout_to_legacy(struct ceph_file_layout *fl,
diff --git a/net/ceph/ceph_fs.c b/net/ceph/ceph_fs.c
index 756a2dc..020ae9f6 100644
--- a/net/ceph/ceph_fs.c
+++ b/net/ceph/ceph_fs.c
@@ -5,29 +5,6 @@
 #include <linux/module.h>
 #include <linux/ceph/types.h>
 
-/*
- * return true if @layout appears to be valid
- */
-int ceph_file_layout_is_valid(const struct ceph_file_layout *layout)
-{
-	__u32 su = layout->stripe_unit;
-	__u32 sc = layout->stripe_count;
-	__u32 os = layout->object_size;
-
-	/* stripe unit, object size must be non-zero, 64k increment */
-	if (!su || (su & (CEPH_MIN_STRIPE_UNIT-1)))
-		return 0;
-	if (!os || (os & (CEPH_MIN_STRIPE_UNIT-1)))
-		return 0;
-	/* object size must be a multiple of stripe unit */
-	if (os < su || os % su)
-		return 0;
-	/* stripe count must be non-zero */
-	if (!sc)
-		return 0;
-	return 1;
-}
-
 void ceph_file_layout_from_legacy(struct ceph_file_layout *fl,
 				  struct ceph_file_layout_legacy *legacy)
 {
-- 
1.8.3.1

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

* Re: [PATCH] fs/ceph: delete unused ceph_file_layout_is_valid function
  2017-12-12  1:56 [PATCH] fs/ceph: delete unused ceph_file_layout_is_valid function Yaowei Bai
@ 2017-12-12 10:15 ` Ilya Dryomov
  2017-12-13  1:52   ` Yaowei Bai
  0 siblings, 1 reply; 3+ messages in thread
From: Ilya Dryomov @ 2017-12-12 10:15 UTC (permalink / raw)
  To: Yaowei Bai; +Cc: Yan, Zheng, Sage Weil, Ceph Development, linux-kernel

On Tue, Dec 12, 2017 at 2:56 AM, Yaowei Bai
<baiyaowei@cmss.chinamobile.com> wrote:
> There's no users of ceph_file_layout_is_valid, remove it.

It'll get a user in the next kernel release -- we'll remove ad-hoc
checks from ceph_calc_file_object_mapping() which is executed on every
mapping and call ceph_file_layout_is_valid() once per layout instead.

Thanks,

                Ilya

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

* Re: [PATCH] fs/ceph: delete unused ceph_file_layout_is_valid function
  2017-12-12 10:15 ` Ilya Dryomov
@ 2017-12-13  1:52   ` Yaowei Bai
  0 siblings, 0 replies; 3+ messages in thread
From: Yaowei Bai @ 2017-12-13  1:52 UTC (permalink / raw)
  To: Ilya Dryomov; +Cc: Yan, Zheng, Sage Weil, Ceph Development, linux-kernel

On Tue, Dec 12, 2017 at 11:15:05AM +0100, Ilya Dryomov wrote:
> On Tue, Dec 12, 2017 at 2:56 AM, Yaowei Bai
> <baiyaowei@cmss.chinamobile.com> wrote:
> > There's no users of ceph_file_layout_is_valid, remove it.
> 
> It'll get a user in the next kernel release -- we'll remove ad-hoc
> checks from ceph_calc_file_object_mapping() which is executed on every
> mapping and call ceph_file_layout_is_valid() once per layout instead.

Maybe we can re-add it when it's used indeed.
 
> 
> Thanks,
> 
>                 Ilya

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

end of thread, other threads:[~2017-12-13  1:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-12  1:56 [PATCH] fs/ceph: delete unused ceph_file_layout_is_valid function Yaowei Bai
2017-12-12 10:15 ` Ilya Dryomov
2017-12-13  1:52   ` Yaowei Bai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox