From: xie xingguo Date: Thu, 16 Jun 2016 06:42:50 +0000 (+0800) Subject: ceph-fs: kill the public ceph_file_layout_is_valid() method X-Git-Tag: v11.0.0~38^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=314005a730bfdd1642c3bd3c97061472c3297457;p=ceph.git ceph-fs: kill the public ceph_file_layout_is_valid() method Which is deprecated file_layout_t::is_valid(), and removing the unnecessary code is always the preferred option. Signed-off-by: xie xingguo --- diff --git a/src/common/ceph_fs.cc b/src/common/ceph_fs.cc index 6b69e267b70f..a4f71be943ac 100644 --- a/src/common/ceph_fs.cc +++ b/src/common/ceph_fs.cc @@ -11,30 +11,6 @@ */ #include "include/types.h" -/* - * return true if @layout appears to be valid - */ -int ceph_file_layout_is_valid(const struct ceph_file_layout *layout) -{ - __u32 su = le32_to_cpu(layout->fl_stripe_unit); - __u32 sc = le32_to_cpu(layout->fl_stripe_count); - __u32 os = le32_to_cpu(layout->fl_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; -} - - int ceph_flags_to_mode(int flags) { /* because CEPH_FILE_MODE_PIN is zero, so mode = -1 is error */ diff --git a/src/include/ceph_fs.h b/src/include/ceph_fs.h index 2a3992522e4c..45188ddb6378 100644 --- a/src/include/ceph_fs.h +++ b/src/include/ceph_fs.h @@ -56,8 +56,6 @@ struct ceph_file_layout { #define CEPH_MIN_STRIPE_UNIT 65536 -int ceph_file_layout_is_valid(const struct ceph_file_layout *layout); - struct ceph_dir_layout { __u8 dl_dir_hash; /* see ceph_hash.h for ids */ __u8 dl_unused1;