aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/ioctl.c
diff options
context:
space:
mode:
authorTristan Ye <tristan.ye@oracle.com>2011-05-25 02:23:43 -0400
committerTristan Ye <tristan.ye@oracle.com>2011-05-25 03:17:12 -0400
commit53069d4e76954e2e63c1b3c501051c6fbcf7298c (patch)
tree6b906eb22fef78636c7d4db7120370d7715f5aef /fs/ocfs2/ioctl.c
parentee16cc037e255801892481a2d0b7c1fff2adf1aa (diff)
Ocfs2/move_extents: move/defrag extents within a certain range.
the basic logic of moving extents for a file is pretty like punching-hole sequence, walk the extents within the range as user specified, calculating an appropriate len to defrag/move, then let ocfs2_defrag/move_extent() to do the actual moving. This func ends up setting 'OCFS2_MOVE_EXT_FL_COMPLETE' to userpace if operation gets done successfully. Signed-off-by: Tristan Ye <tristan.ye@oracle.com>
Diffstat (limited to 'fs/ocfs2/ioctl.c')
-rw-r--r--fs/ocfs2/ioctl.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/ocfs2/ioctl.c b/fs/ocfs2/ioctl.c
index fd248ed53df7..59100598b0cb 100644
--- a/fs/ocfs2/ioctl.c
+++ b/fs/ocfs2/ioctl.c
@@ -26,6 +26,7 @@
26#include "dir.h" 26#include "dir.h"
27#include "buffer_head_io.h" 27#include "buffer_head_io.h"
28#include "suballoc.h" 28#include "suballoc.h"
29#include "move_extents.h"
29 30
30#include <linux/ext2_fs.h> 31#include <linux/ext2_fs.h>
31 32
@@ -951,6 +952,8 @@ long ocfs2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
951 return -EFAULT; 952 return -EFAULT;
952 953
953 return ocfs2_info_handle(inode, &info, 0); 954 return ocfs2_info_handle(inode, &info, 0);
955 case OCFS2_IOC_MOVE_EXT:
956 return ocfs2_ioctl_move_extents(filp, (void __user *)arg);
954 default: 957 default:
955 return -ENOTTY; 958 return -ENOTTY;
956 } 959 }
@@ -993,6 +996,8 @@ long ocfs2_compat_ioctl(struct file *file, unsigned cmd, unsigned long arg)
993 return -EFAULT; 996 return -EFAULT;
994 997
995 return ocfs2_info_handle(inode, &info, 1); 998 return ocfs2_info_handle(inode, &info, 1);
999 case OCFS2_IOC_MOVE_EXT:
1000 break;
996 default: 1001 default:
997 return -ENOIOCTLCMD; 1002 return -ENOIOCTLCMD;
998 } 1003 }