diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-28 14:02:23 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-28 14:02:23 -0500 |
| commit | d891ea23d5203e5c47439b2a174f86a00b356a6c (patch) | |
| tree | 3876cefcced9df5519f437cd8eb275cb979b93f6 | |
| parent | 08d21b5f93eb92a781daea71b6fcb3a340909141 (diff) | |
| parent | 125d725c923527a85876c031028c7f55c28b74b3 (diff) | |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client
Pull ceph updates from Sage Weil:
"This is a big batch. From Ilya we have:
- rbd support for more than ~250 mapped devices (now uses same scheme
that SCSI does for device major/minor numbering)
- crush updates for new mapping behaviors (will be needed for coming
erasure coding support, among other things)
- preliminary support for tiered storage pools
There is also a big series fixing a pile cephfs bugs with clustered
MDSs from Yan Zheng, ACL support for cephfs from Guangliang Zhao, ceph
fscache improvements from Li Wang, improved behavior when we get
ENOSPC from Josh Durgin, some readv/writev improvements from
Majianpeng, and the usual mix of small cleanups"
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client: (76 commits)
ceph: cast PAGE_SIZE to size_t in ceph_sync_write()
ceph: fix dout() compile warnings in ceph_filemap_fault()
libceph: support CEPH_FEATURE_OSD_CACHEPOOL feature
libceph: follow redirect replies from osds
libceph: rename ceph_osd_request::r_{oloc,oid} to r_base_{oloc,oid}
libceph: follow {read,write}_tier fields on osd request submission
libceph: add ceph_pg_pool_by_id()
libceph: CEPH_OSD_FLAG_* enum update
libceph: replace ceph_calc_ceph_pg() with ceph_oloc_oid_to_pg()
libceph: introduce and start using oid abstraction
libceph: rename MAX_OBJ_NAME_SIZE to CEPH_MAX_OID_NAME_LEN
libceph: move ceph_file_layout helpers to ceph_fs.h
libceph: start using oloc abstraction
libceph: dout() is missing a newline
libceph: add ceph_kv{malloc,free}() and switch to them
libceph: support CEPH_FEATURE_EXPORT_PEER
ceph: add imported caps when handling cap export message
ceph: add open export target session helper
ceph: remove exported caps when handling cap import message
ceph: handle session flush message
...
38 files changed, 2261 insertions, 679 deletions
diff --git a/Documentation/ABI/testing/sysfs-bus-rbd b/Documentation/ABI/testing/sysfs-bus-rbd index 0a306476424e..501adc2a9ec7 100644 --- a/Documentation/ABI/testing/sysfs-bus-rbd +++ b/Documentation/ABI/testing/sysfs-bus-rbd | |||
| @@ -18,6 +18,28 @@ Removal of a device: | |||
| 18 | 18 | ||
| 19 | $ echo <dev-id> > /sys/bus/rbd/remove | 19 | $ echo <dev-id> > /sys/bus/rbd/remove |
| 20 | 20 | ||
| 21 | What: /sys/bus/rbd/add_single_major | ||
| 22 | Date: December 2013 | ||
| 23 | KernelVersion: 3.14 | ||
| 24 | Contact: Sage Weil <sage@inktank.com> | ||
| 25 | Description: Available only if rbd module is inserted with single_major | ||
| 26 | parameter set to true. | ||
| 27 | Usage is the same as for /sys/bus/rbd/add. If present, | ||
| 28 | should be used instead of the latter: any attempts to use | ||
| 29 | /sys/bus/rbd/add if /sys/bus/rbd/add_single_major is | ||
| 30 | available will fail for backwards compatibility reasons. | ||
| 31 | |||
| 32 | What: /sys/bus/rbd/remove_single_major | ||
| 33 | Date: December 2013 | ||
| 34 | KernelVersion: 3.14 | ||
| 35 | Contact: Sage Weil <sage@inktank.com> | ||
| 36 | Description: Available only if rbd module is inserted with single_major | ||
| 37 | parameter set to true. | ||
| 38 | Usage is the same as for /sys/bus/rbd/remove. If present, | ||
| 39 | should be used instead of the latter: any attempts to use | ||
| 40 | /sys/bus/rbd/remove if /sys/bus/rbd/remove_single_major is | ||
| 41 | available will fail for backwards compatibility reasons. | ||
| 42 | |||
| 21 | Entries under /sys/bus/rbd/devices/<dev-id>/ | 43 | Entries under /sys/bus/rbd/devices/<dev-id>/ |
| 22 | -------------------------------------------- | 44 | -------------------------------------------- |
| 23 | 45 | ||
| @@ -33,6 +55,10 @@ major | |||
| 33 | 55 | ||
| 34 | The block device major number. | 56 | The block device major number. |
| 35 | 57 | ||
| 58 | minor | ||
| 59 | |||
| 60 | The block device minor number. (December 2013, since 3.14.) | ||
| 61 | |||
| 36 | name | 62 | name |
| 37 | 63 | ||
| 38 | The name of the rbd image. | 64 | The name of the rbd image. |
diff --git a/MAINTAINERS b/MAINTAINERS index 2507f38b208f..9bf651c57806 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
| @@ -7075,7 +7075,7 @@ F: drivers/media/parport/*-qcam* | |||
| 7075 | RADOS BLOCK DEVICE (RBD) | 7075 | RADOS BLOCK DEVICE (RBD) |
| 7076 | M: Yehuda Sadeh <yehuda@inktank.com> | 7076 | M: Yehuda Sadeh <yehuda@inktank.com> |
| 7077 | M: Sage Weil <sage@inktank.com> | 7077 | M: Sage Weil <sage@inktank.com> |
| 7078 | M: Alex Elder <elder@inktank.com> | 7078 | M: Alex Elder <elder@kernel.org> |
| 7079 | M: ceph-devel@vger.kernel.org | 7079 | M: ceph-devel@vger.kernel.org |
| 7080 | W: http://ceph.com/ | 7080 | W: http://ceph.com/ |
| 7081 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client.git | 7081 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client.git |
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index cb1db2979d3d..16cab6635163 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c | |||
| @@ -41,6 +41,7 @@ | |||
| 41 | #include <linux/fs.h> | 41 | #include <linux/fs.h> |
| 42 | #include <linux/blkdev.h> | 42 | #include <linux/blkdev.h> |
| 43 | #include <linux/slab.h> | 43 | #include <linux/slab.h> |
| 44 | #include <linux/idr.h> | ||
| 44 | 45 | ||
| 45 | #include "rbd_types.h" | 46 | #include "rbd_types.h" |
| 46 | 47 | ||
| @@ -89,9 +90,9 @@ static int atomic_dec_return_safe(atomic_t *v) | |||
| 89 | } | 90 | } |
| 90 | 91 | ||
| 91 | #define RBD_DRV_NAME "rbd" | 92 | #define RBD_DRV_NAME "rbd" |
| 92 | #define RBD_DRV_NAME_LONG "rbd (rados block device)" | ||
| 93 | 93 | ||
| 94 | #define RBD_MINORS_PER_MAJOR 256 /* max minors per blkdev */ | 94 | #define RBD_MINORS_PER_MAJOR 256 |
| 95 | #define RBD_SINGLE_MAJOR_PART_SHIFT 4 | ||
| 95 | 96 | ||
| 96 | #define RBD_SNAP_DEV_NAME_PREFIX "snap_" | 97 | #define RBD_SNAP_DEV_NAME_PREFIX "snap_" |
| 97 | #define RBD_MAX_SNAP_NAME_LEN \ | 98 | #define RBD_MAX_SNAP_NAME_LEN \ |
| @@ -323,6 +324,7 @@ struct rbd_device { | |||
| 323 | int dev_id; /* blkdev unique id */ | 324 | int dev_id; /* blkdev unique id */ |
| 324 | 325 | ||
| 325 | int major; /* blkdev assigned major */ | 326 | int major; /* blkdev assigned major */ |
| 327 | int minor; | ||
| 326 | struct gendisk *disk; /* blkdev's gendisk and rq */ | 328 | struct gendisk *disk; /* blkdev's gendisk and rq */ |
| 327 | 329 | ||
| 328 | u32 image_format; /* Either 1 or 2 */ | 330 | u32 image_format; /* Either 1 or 2 */ |
| @@ -386,6 +388,17 @@ static struct kmem_cache *rbd_img_request_cache; | |||
| 386 | static struct kmem_cache *rbd_obj_request_cache; | 388 | static struct kmem_cache *rbd_obj_request_cache; |
| 387 | static struct kmem_cache *rbd_segment_name_cache; | 389 | static struct kmem_cache *rbd_segment_name_cache; |
| 388 | 390 | ||
| 391 | static int rbd_major; | ||
| 392 | static DEFINE_IDA(rbd_dev_id_ida); | ||
| 393 | |||
| 394 | /* | ||
| 395 | * Default to false for now, as single-major requires >= 0.75 version of | ||
| 396 | * userspace rbd utility. | ||
| 397 | */ | ||
| 398 | static bool single_major = false; | ||
| 399 | module_param(single_major, bool, S_IRUGO); | ||
| 400 | MODULE_PARM_DESC(single_major, "Use a single major number for all rbd devices (default: false)"); | ||
| 401 | |||
| 389 | static int rbd_img_request_submit(struct rbd_img_request *img_request); | 402 | static int rbd_img_request_submit(struct rbd_img_request *img_request); |
| 390 | 403 | ||
| 391 | static void rbd_dev_device_release(struct device *dev); | 404 | static void rbd_dev_device_release(struct device *dev); |
| @@ -394,18 +407,52 @@ static ssize_t rbd_add(struct bus_type *bus, const char *buf, | |||
| 394 | size_t count); | 407 | size_t count); |
| 395 | static ssize_t rbd_remove(struct bus_type *bus, const char *buf, | 408 | static ssize_t rbd_remove(struct bus_type *bus, const char *buf, |
| 396 | size_t count); | 409 | size_t count); |
| 410 | static ssize_t rbd_add_single_major(struct bus_type *bus, const char *buf, | ||
| 411 | size_t count); | ||
| 412 | static ssize_t rbd_remove_single_major(struct bus_type *bus, const char *buf, | ||
| 413 | size_t count); | ||
| 397 | static int rbd_dev_image_probe(struct rbd_device *rbd_dev, bool mapping); | 414 | static int rbd_dev_image_probe(struct rbd_device *rbd_dev, bool mapping); |
| 398 | static void rbd_spec_put(struct rbd_spec *spec); | ||
