aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph/ioctl.h
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2011-08-04 18:41:37 -0400
committerSage Weil <sage@newdream.net>2011-10-25 19:10:15 -0400
commit6a8ea4706adb4b4d8f77a8da5f9778b65fbf6f48 (patch)
tree263456e621ba9130f0f9bfec96f48cd597a75f88 /fs/ceph/ioctl.h
parent0d66a487c120012f33fbcd6af5cbf0a0cad71557 (diff)
ceph: document ioctls
...after some prodding by Christoph. Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph/ioctl.h')
-rw-r--r--fs/ceph/ioctl.h55
1 files changed, 54 insertions, 1 deletions
diff --git a/fs/ceph/ioctl.h b/fs/ceph/ioctl.h
index 0c5167e43180..be4a60487333 100644
--- a/fs/ceph/ioctl.h
+++ b/fs/ceph/ioctl.h
@@ -6,7 +6,31 @@
6 6
7#define CEPH_IOCTL_MAGIC 0x97 7#define CEPH_IOCTL_MAGIC 0x97
8 8
9/* just use u64 to align sanely on all archs */ 9/*
10 * CEPH_IOC_GET_LAYOUT - get file layout or dir layout policy
11 * CEPH_IOC_SET_LAYOUT - set file layout
12 * CEPH_IOC_SET_LAYOUT_POLICY - set dir layout policy
13 *
14 * The file layout specifies how file data is striped over objects in
15 * the distributed object store, which object pool they belong to (if
16 * it differs from the default), and an optional 'preferred osd' to
17 * store them on.
18 *
19 * Files get a new layout based on the policy set on the containing
20 * directory or one of its ancestors. The GET_LAYOUT ioctl will let
21 * you examine the layout for a file or the policy on a directory.
22 *
23 * SET_LAYOUT will let you set a layout on a newly created file. This
24 * only works immediately after the file is created and before any
25 * data is written to it.
26 *
27 * SET_LAYOUT_POLICY will let you set a layout policy (default layout)
28 * on a directory that will apply to any new files created in that
29 * directory (or any child directory that doesn't specify a layout of
30 * its own).
31 */
32
33/* use u64 to align sanely on all archs */
10struct ceph_ioctl_layout { 34struct ceph_ioctl_layout {
11 __u64 stripe_unit, stripe_count, object_size; 35 __u64 stripe_unit, stripe_count, object_size;
12 __u64 data_pool; 36 __u64 data_pool;
@@ -21,6 +45,8 @@ struct ceph_ioctl_layout {
21 struct ceph_ioctl_layout) 45 struct ceph_ioctl_layout)
22 46
23/* 47/*
48 * CEPH_IOC_GET_DATALOC - get location of file data in the cluster
49 *
24 * Extract identity, address of the OSD and object storing a given 50 * Extract identity, address of the OSD and object storing a given
25 * file offset. 51 * file offset.
26 */ 52 */
@@ -39,7 +65,34 @@ struct ceph_ioctl_dataloc {
39#define CEPH_IOC_GET_DATALOC _IOWR(CEPH_IOCTL_MAGIC, 3, \ 65#define CEPH_IOC_GET_DATALOC _IOWR(CEPH_IOCTL_MAGIC, 3, \
40 struct ceph_ioctl_dataloc) 66 struct ceph_ioctl_dataloc)
41 67
68/*
69 * CEPH_IOC_LAZYIO - relax consistency
70 *
71 * Normally Ceph switches to synchronous IO when multiple clients have
72 * the file open (and or more for write). Reads and writes bypass the
73 * page cache and go directly to the OSD. Setting this flag on a file
74 * descriptor will allow buffered IO for this file in cases where the
75 * application knows it won't interfere with other nodes (or doesn't
76 * care).
77 */
42#define CEPH_IOC_LAZYIO _IO(CEPH_IOCTL_MAGIC, 4) 78#define CEPH_IOC_LAZYIO _IO(CEPH_IOCTL_MAGIC, 4)
79
80/*
81 * CEPH_IOC_SYNCIO - force synchronous IO
82 *
83 * This ioctl sets a file flag that forces the synchronous IO that
84 * bypasses the page cache, even if it is not necessary. This is
85 * essentially the opposite behavior of IOC_LAZYIO. This forces the
86 * same read/write path as a file opened by multiple clients when one
87 * or more of those clients is opened for write.
88 *
89 * Note that this type of sync IO takes a different path than a file
90 * opened with O_SYNC/D_SYNC (writes hit the page cache and are
91 * immediately flushed on page boundaries). It is very similar to
92 * O_DIRECT (writes bypass the page cache) excep that O_DIRECT writes
93 * are not copied (user page must remain stable) and O_DIRECT writes
94 * have alignment restrictions (on the buffer and file offset).
95 */
43#define CEPH_IOC_SYNCIO _IO(CEPH_IOCTL_MAGIC, 5) 96#define CEPH_IOC_SYNCIO _IO(CEPH_IOCTL_MAGIC, 5)
44 97
45#endif 98#endif