]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
uclient: pull ioctl.h from kernel tree to out tree
authorSage Weil <sage@newdream.net>
Tue, 6 Oct 2009 20:41:42 +0000 (13:41 -0700)
committerSage Weil <sage@newdream.net>
Tue, 6 Oct 2009 21:00:54 +0000 (14:00 -0700)
src/client/ioctl.h [new file with mode: 0644]
src/client/test_ioctls.c
src/push_to_kclient.pl

diff --git a/src/client/ioctl.h b/src/client/ioctl.h
new file mode 100644 (file)
index 0000000..3c511da
--- /dev/null
@@ -0,0 +1,39 @@
+#ifndef FS_CEPH_IOCTL_H
+#define FS_CEPH_IOCTL_H
+
+#include <linux/ioctl.h>
+#include <linux/types.h>
+
+#define CEPH_IOCTL_MAGIC 0x97
+
+/* just use u64 to align sanely on all archs */
+struct ceph_ioctl_layout {
+       __u64 stripe_unit, stripe_count, object_size;
+       __u64 data_pool;
+};
+
+#define CEPH_IOC_GET_LAYOUT _IOR(CEPH_IOCTL_MAGIC, 1,          \
+                                  struct ceph_ioctl_layout)
+#define CEPH_IOC_SET_LAYOUT _IOW(CEPH_IOCTL_MAGIC, 2,          \
+                                  struct ceph_ioctl_layout)
+
+/*
+ * Extract identity, address of the OSD and object storing a given
+ * file offset.
+ */
+struct ceph_ioctl_dataloc {
+       __u64 file_offset;           /* in+out: file offset */
+       __u64 object_offset;         /* out: offset in object */
+       __u64 object_no;             /* out: object # */
+       __u64 object_size;           /* out: object size */
+       char object_name[64];        /* out: object name */
+       __u64 block_offset;          /* out: offset in block */
+       __u64 block_size;            /* out: block length */
+       __s64 osd;                   /* out: osd # */
+       struct sockaddr_storage osd_addr; /* out: osd address */
+};
+
+#define CEPH_IOC_GET_DATALOC _IOWR(CEPH_IOCTL_MAGIC, 3,        \
+                                  struct ceph_ioctl_dataloc)
+
+#endif
index 0b110a62aa115f37763e3cc9575d1f669cf67d8b..f06f215097191ad1c83d59df654bbef40413b7e6 100644 (file)
@@ -11,7 +11,7 @@
 #include <sys/socket.h>
 #include <netdb.h>
 
-#include "../kernel/ioctl.h"
+#include "ioctl.h"
 
 int main(int argc, char **argv)
 {
index 0c038b9890285e227161bda8166a65e73e11de7e..77a2f0c3c97a99a96269456c4efe3484da194462 100755 (executable)
@@ -15,7 +15,7 @@ until (-d "$dir/.git") {
     $dir .= "/..";
 }
 
-print "copy changed shared files from $dir to $kernel...\n";
+print "pushing changed shared files from $dir to $kernel...\n";
 my @files = split(/\n/, `cat $kernel/fs/ceph/README`);
 for (@files) {
     next if /^#/;
@@ -24,5 +24,8 @@ for (@files) {
     system "cp -uv $dir/$orig $kernel/$new";
 }
 
+print "pulling changed shared files from $dir to $kernel...\n";
+system "cp -uv $kernel/fs/ceph/ioctl.h $dir/src/client/ioctl.h";
+
 print "done.\n";