1
Add support for the FIEMAP ioctl for 32-bit user on 64-bit kernel.
3
When using a 32-bit runtime on top of a 64-bit kernel,
4
programs like "filefrag" and "hdparm --fibmap" do not work correctly.
6
This is because there's no compat ioctl entry for the FIEMAP call.
7
FIEMAP returns file extent info, similar to FIBMAP (but better).
9
Since FIBMAP itself is b0rked on ext4, this leaves no way for a 32-bit
10
program to reliably get detailed block information for a file
11
when run on top of a 64-bit kernel. This patch addresses the issue.
13
Once upstream, this patch could also be a candidate for -stable.
15
Signed-off-by: Mark Lord <mlord@pobox.com>
17
--- old/fs/compat_ioctl.c 2009-08-01 10:47:16.601066905 -0400
18
+++ linux/fs/compat_ioctl.c 2009-08-01 10:49:23.054387926 -0400
20
#include <linux/falloc.h>
22
#include <linux/file.h>
23
+#include <linux/fiemap.h>
24
#include <linux/ppp_defs.h>
25
#include <linux/if_ppp.h>
26
#include <linux/if_pppox.h>
28
COMPATIBLE_IOCTL(FIONREAD) /* This is also TIOCINQ */
30
COMPATIBLE_IOCTL(FIBMAP)
31
+COMPATIBLE_IOCTL(FS_IOC_FIEMAP)
32
COMPATIBLE_IOCTL(FIGETBSZ)
33
/* 'X' - originally XFS but some now in the VFS */
34
COMPATIBLE_IOCTL(FIFREEZE)