~ubuntu-branches/ubuntu/natty/hdparm/natty

« back to all changes in this revision

Viewing changes to wiper-2.5/fiemap_compat_ioctl.patch

  • Committer: Bazaar Package Importer
  • Author(s): Stephen Gran
  • Date: 2010-01-17 18:02:44 UTC
  • mto: (2.1.5 sid)
  • mto: This revision was merged to the branch mainline in revision 31.
  • Revision ID: james.westby@ubuntu.com-20100117180244-p53m2zbnkf9my7sp
Tags: upstream-9.27
ImportĀ upstreamĀ versionĀ 9.27

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Add support for the FIEMAP ioctl for 32-bit user on 64-bit kernel.
 
2
 
 
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.
 
5
 
 
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).
 
8
 
 
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.
 
12
 
 
13
Once upstream, this patch could also be a candidate for -stable.
 
14
 
 
15
Signed-off-by: Mark Lord <mlord@pobox.com> 
 
16
 
 
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
 
19
@@ -35,6 +35,7 @@
 
20
 #include <linux/falloc.h>
 
21
 #include <linux/fs.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>
 
27
@@ -1907,6 +1908,7 @@
 
28
 COMPATIBLE_IOCTL(FIONREAD)  /* This is also TIOCINQ */
 
29
 /* 0x00 */
 
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)
 
35
@@ -2805,6 +2807,7 @@
 
36
                goto out_fput;
 
37
 #endif
 
38
 
 
39
+       case FS_IOC_FIEMAP:
 
40
        case FIBMAP:
 
41
        case FIGETBSZ:
 
42
        case FIONREAD: