Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 373507
b: refs/heads/master
c: fc71d83
h: refs/heads/master
i:
  373505: 84f5de3
  373503: 74e2e03
v: v3
  • Loading branch information
Alex Elder authored and Sage Weil committed May 2, 2013
1 parent d6a2148 commit a63f515
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e28626a08b3e7412158551a639dd36887e2d728d
refs/heads/master: fc71d8330e39ef3af816a9c869150250952cb712
18 changes: 9 additions & 9 deletions trunk/drivers/block/rbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -3170,13 +3170,9 @@ static ssize_t rbd_size_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct rbd_device *rbd_dev = dev_to_rbd_dev(dev);
sector_t size;

down_read(&rbd_dev->header_rwsem);
size = get_capacity(rbd_dev->disk);
up_read(&rbd_dev->header_rwsem);

return sprintf(buf, "%llu\n", (unsigned long long) size * SECTOR_SIZE);
return sprintf(buf, "%llu\n",
(unsigned long long)rbd_dev->mapping.size);
}

/*
Expand All @@ -3189,15 +3185,19 @@ static ssize_t rbd_features_show(struct device *dev,
struct rbd_device *rbd_dev = dev_to_rbd_dev(dev);

return sprintf(buf, "0x%016llx\n",
(unsigned long long) rbd_dev->mapping.features);
(unsigned long long)rbd_dev->mapping.features);
}

static ssize_t rbd_major_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct rbd_device *rbd_dev = dev_to_rbd_dev(dev);

return sprintf(buf, "%d\n", rbd_dev->major);
if (rbd_dev->major)
return sprintf(buf, "%d\n", rbd_dev->major);

return sprintf(buf, "(none)\n");

}

static ssize_t rbd_client_id_show(struct device *dev,
Expand All @@ -3223,7 +3223,7 @@ static ssize_t rbd_pool_id_show(struct device *dev,
struct rbd_device *rbd_dev = dev_to_rbd_dev(dev);

return sprintf(buf, "%llu\n",
(unsigned long long) rbd_dev->spec->pool_id);
(unsigned long long) rbd_dev->spec->pool_id);
}

static ssize_t rbd_name_show(struct device *dev,
Expand Down

0 comments on commit a63f515

Please sign in to comment.