[sheepdog] [PATCH] sheep: remove unused get_max_copy_number()
Liu Yuan
namei.unix at gmail.com
Sun Sep 1 09:24:52 CEST 2013
Signed-off-by: Liu Yuan <namei.unix at gmail.com>
---
sheep/sheep_priv.h | 1 -
sheep/vdi.c | 14 --------------
2 files changed, 15 deletions(-)
diff --git a/sheep/sheep_priv.h b/sheep/sheep_priv.h
index 9045112..1686a20 100644
--- a/sheep/sheep_priv.h
+++ b/sheep/sheep_priv.h
@@ -278,7 +278,6 @@ int fill_vdi_state_list(void *data);
bool oid_is_readonly(uint64_t oid);
int get_vdi_copy_number(uint32_t vid);
int get_obj_copy_number(uint64_t oid, int nr_zones);
-int get_max_copy_number(void);
int get_req_copy_number(struct request *req);
int add_vdi_state(uint32_t vid, int nr_copies, bool snapshot);
int vdi_exist(uint32_t vid);
diff --git a/sheep/vdi.c b/sheep/vdi.c
index 799cee6..31bd401 100644
--- a/sheep/vdi.c
+++ b/sheep/vdi.c
@@ -18,7 +18,6 @@ struct vdi_state_entry {
struct rb_node node;
};
-static uint32_t max_copies;
static struct rb_root vdi_state_root = RB_ROOT;
static struct sd_lock vdi_state_lock = SD_LOCK_INITIALIZER;
@@ -101,16 +100,6 @@ int get_req_copy_number(struct request *req)
return nr_copies;
}
-int get_max_copy_number(void)
-{
- int nr_copies = uatomic_read(&max_copies);
-
- if (nr_copies == 0)
- nr_copies = sys->cinfo.nr_copies;
-
- return nr_copies;
-}
-
int add_vdi_state(uint32_t vid, int nr_copies, bool snapshot)
{
struct vdi_state_entry *entry, *old;
@@ -131,9 +120,6 @@ int add_vdi_state(uint32_t vid, int nr_copies, bool snapshot)
entry->snapshot = snapshot;
}
- if (uatomic_read(&max_copies) == 0 ||
- nr_copies > uatomic_read(&max_copies))
- uatomic_set(&max_copies, nr_copies);
sd_unlock(&vdi_state_lock);
return SD_RES_SUCCESS;
--
1.7.9.5
More information about the sheepdog
mailing list