mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
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>
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
#include "dir.h"
|
||||
#include "buffer_head_io.h"
|
||||
#include "suballoc.h"
|
||||
#include "move_extents.h"
|
||||
|
||||
#include <linux/ext2_fs.h>
|
||||
|
||||
@@ -951,6 +952,8 @@ long ocfs2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
|
||||
return -EFAULT;
|
||||
|
||||
return ocfs2_info_handle(inode, &info, 0);
|
||||
case OCFS2_IOC_MOVE_EXT:
|
||||
return ocfs2_ioctl_move_extents(filp, (void __user *)arg);
|
||||
default:
|
||||
return -ENOTTY;
|
||||
}
|
||||
@@ -993,6 +996,8 @@ long ocfs2_compat_ioctl(struct file *file, unsigned cmd, unsigned long arg)
|
||||
return -EFAULT;
|
||||
|
||||
return ocfs2_info_handle(inode, &info, 1);
|
||||
case OCFS2_IOC_MOVE_EXT:
|
||||
break;
|
||||
default:
|
||||
return -ENOIOCTLCMD;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user