[sheepdog] [PATCH 2/6] sheep: use default nr_copies when no vdi is created
MORITA Kazutaka
morita.kazutaka at lab.ntt.co.jp
Tue Feb 26 05:06:46 CET 2013
Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
sheep/vdi.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/sheep/vdi.c b/sheep/vdi.c
index 1f23415..8d32217 100644
--- a/sheep/vdi.c
+++ b/sheep/vdi.c
@@ -111,7 +111,12 @@ int get_req_copy_number(struct request *req)
int get_max_copy_number(void)
{
- return uatomic_read(&max_copies);
+ int nr_copies = uatomic_read(&max_copies);
+
+ if (nr_copies == 0)
+ nr_copies = sys->nr_copies;
+
+ return nr_copies;
}
int add_vdi_copy_number(uint32_t vid, int nr_copies)
--
1.8.1.3.566.gaa39828
More information about the sheepdog
mailing list