Sage Weil | 8f4e91d | 2009-10-06 11:31:14 -0700 | [diff] [blame] | 1 | #ifndef FS_CEPH_IOCTL_H |
| 2 | #define FS_CEPH_IOCTL_H |
| 3 | |
| 4 | #include <linux/ioctl.h> |
| 5 | #include <linux/types.h> |
| 6 | |
Sage Weil | 1cd275f | 2010-12-06 09:45:22 -0800 | [diff] [blame] | 7 | #define CEPH_IOCTL_MAGIC 0x97 |
Sage Weil | 8f4e91d | 2009-10-06 11:31:14 -0700 | [diff] [blame] | 8 | |
| 9 | /* just use u64 to align sanely on all archs */ |
| 10 | struct ceph_ioctl_layout { |
| 11 | __u64 stripe_unit, stripe_count, object_size; |
| 12 | __u64 data_pool; |
Sage Weil | 33d4909 | 2009-12-02 14:42:39 -0800 | [diff] [blame] | 13 | __s64 preferred_osd; |
Sage Weil | 8f4e91d | 2009-10-06 11:31:14 -0700 | [diff] [blame] | 14 | }; |
| 15 | |
| 16 | #define CEPH_IOC_GET_LAYOUT _IOR(CEPH_IOCTL_MAGIC, 1, \ |
| 17 | struct ceph_ioctl_layout) |
| 18 | #define CEPH_IOC_SET_LAYOUT _IOW(CEPH_IOCTL_MAGIC, 2, \ |
| 19 | struct ceph_ioctl_layout) |
Greg Farnum | 571dba5 | 2010-09-24 14:56:40 -0700 | [diff] [blame] | 20 | #define CEPH_IOC_SET_LAYOUT_POLICY _IOW(CEPH_IOCTL_MAGIC, 5, \ |
| 21 | struct ceph_ioctl_layout) |
Sage Weil | 8f4e91d | 2009-10-06 11:31:14 -0700 | [diff] [blame] | 22 | |
| 23 | /* |
| 24 | * Extract identity, address of the OSD and object storing a given |
| 25 | * file offset. |
| 26 | */ |
| 27 | struct ceph_ioctl_dataloc { |
| 28 | __u64 file_offset; /* in+out: file offset */ |
| 29 | __u64 object_offset; /* out: offset in object */ |
| 30 | __u64 object_no; /* out: object # */ |
| 31 | __u64 object_size; /* out: object size */ |
| 32 | char object_name[64]; /* out: object name */ |
| 33 | __u64 block_offset; /* out: offset in block */ |
| 34 | __u64 block_size; /* out: block length */ |
| 35 | __s64 osd; /* out: osd # */ |
| 36 | struct sockaddr_storage osd_addr; /* out: osd address */ |
| 37 | }; |
| 38 | |
| 39 | #define CEPH_IOC_GET_DATALOC _IOWR(CEPH_IOCTL_MAGIC, 3, \ |
| 40 | struct ceph_ioctl_dataloc) |
| 41 | |
Sage Weil | 8c6e922 | 2010-04-16 09:53:43 -0700 | [diff] [blame] | 42 | #define CEPH_IOC_LAZYIO _IO(CEPH_IOCTL_MAGIC, 4) |
| 43 | |
Sage Weil | 8f4e91d | 2009-10-06 11:31:14 -0700 | [diff] [blame] | 44 | #endif |