<div><br>Cool, Tiger.</div><div> </div><div>SOB</div><div> </div><div>BTW, I guess a defrag utility calling ioctl(MOVE_EXT) will be posted later?</div><div> </div><div class="gmail_quote">On Tue, Aug 30, 2011 at 11:13 AM, Tiger Yang <span dir="ltr">&lt;<a href="mailto:tiger.yang@oracle.com">tiger.yang@oracle.com</a>&gt;</span> wrote:<br>
<blockquote style="margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: solid;" class="gmail_quote">This patch update the definition of ocfs2_move_extents from<br>

kernel head file.<br>
<br>
Signed-off-by: Tiger Yang &lt;<a href="mailto:tiger.yang@oracle.com">tiger.yang@oracle.com</a>&gt;<br>
---<br>
 include/ocfs2-kernel/ocfs2_ioctl.h |   34 ++++++++++++++++++++++++++++++++++<br>
 1 files changed, 34 insertions(+), 0 deletions(-)<br>
<br>
diff --git a/include/ocfs2-kernel/ocfs2_ioctl.h b/include/ocfs2-kernel/ocfs2_ioctl.h<br>
index 05ea113..0ba4f2e 100644<br>
--- a/include/ocfs2-kernel/ocfs2_ioctl.h<br>
+++ b/include/ocfs2-kernel/ocfs2_ioctl.h<br>
@@ -205,4 +205,38 @@ enum ocfs2_info_type {<br>
<br>
 #define OCFS2_IOC_INFO         _IOR(&#39;o&#39;, 5, struct ocfs2_info)<br>
<br>
+struct ocfs2_move_extents {<br>
+/* All values are in bytes */<br>
+       /* in */<br>
+       __u64 me_start;         /* Virtual start in the file to move */<br>
+       __u64 me_len;           /* Length of the extents to be moved */<br>
+       __u64 me_goal;          /* Physical offset of the goal,<br>
+                                  it&#39;s in block unit */<br>
+       __u64 me_threshold;     /* Maximum distance from goal or threshold<br>
+                                  for auto defragmentation */<br>
+       __u64 me_flags;         /* Flags for the operation:<br>
+                                * - auto defragmentation.<br>
+                                * - refcount,xattr cases.<br>
+                                */<br>
+       /* out */<br>
+       __u64 me_moved_len;     /* Moved/defraged length */<br>
+       __u64 me_new_offset;    /* Resulting physical location */<br>
+       __u32 me_reserved[2];   /* Reserved for futhure */<br>
+};<br>
+<br>
+#define OCFS2_MOVE_EXT_FL_AUTO_DEFRAG  (0x00000001)    /* Kernel manages to<br>
+                                                          claim new clusters<br>
+                                                          as the goal place<br>
+                                                          for extents moving */<br>
+#define OCFS2_MOVE_EXT_FL_PART_DEFRAG  (0x00000002)    /* Allow partial extent<br>
+                                                          moving, is to make<br>
+                                                          movement less likely<br>
+                                                          to fail, may make fs<br>
+                                                          even more fragmented */<br>
+#define OCFS2_MOVE_EXT_FL_COMPLETE     (0x00000004)    /* Move or defragmenation<br>
+                                                          completely gets done.<br>
+                                                        */<br>
+<br>
+#define OCFS2_IOC_MOVE_EXT     _IOW(&#39;o&#39;, 6, struct ocfs2_move_extents)<br>
+<br>
 #endif /* OCFS2_IOCTL_H */<br>
<font color="#888888">--<br>
1.7.4.4<br>
<br>
<br>
_______________________________________________<br>
Ocfs2-tools-devel mailing list<br>
<a href="mailto:Ocfs2-tools-devel@oss.oracle.com">Ocfs2-tools-devel@oss.oracle.com</a><br>
<a href="http://oss.oracle.com/mailman/listinfo/ocfs2-tools-devel" target="_blank">http://oss.oracle.com/mailman/listinfo/ocfs2-tools-devel</a><br>
</font></blockquote></div><br>