summaryrefslogtreecommitdiff
path: root/libinstaller
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2010-06-15 17:24:32 -0700
committerH. Peter Anvin <hpa@linux.intel.com>2010-06-15 17:24:32 -0700
commit76d5e47c0ddec4f5d792d8753056ab46e5fc9e8c (patch)
treede27cf05b1ba11588c3166c5a8b79e79059774c9 /libinstaller
parent07fa0f9de655e41e153aaed17398f0d02768d323 (diff)
downloadsyslinux-76d5e47c0ddec4f5d792d8753056ab46e5fc9e8c.tar.gz
installer: fix use of FIEMAP
Correct the implementation of block mapping using FIEMAP (as opposed to FIBMAP). Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'libinstaller')
-rw-r--r--libinstaller/syslxcom.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libinstaller/syslxcom.c b/libinstaller/syslxcom.c
index 013b69af..85b3f6ea 100644
--- a/libinstaller/syslxcom.c
+++ b/libinstaller/syslxcom.c
@@ -209,7 +209,7 @@ static int sectmap_fie(int fd, sector_t *sectors, int nsectors)
fm->fm_flags = FIEMAP_FLAG_SYNC;
fm->fm_extent_count = nsectors;
- if (ioctl(fd, FS_IOC_FIEMAP, &fm))
+ if (ioctl(fd, FS_IOC_FIEMAP, fm))
return -1;
memset(sectors, 0, nsectors * sizeof *sectors);
@@ -225,7 +225,7 @@ static int sectmap_fie(int fd, sector_t *sectors, int nsectors)
if (fe->fe_flags & FIEMAP_EXTENT_LAST) {
/* If this is the *final* extent, pad the length */
fe->fe_length = (fe->fe_length + SECTOR_SIZE - 1)
- & (SECTOR_SIZE - 1);
+ & ~(SECTOR_SIZE - 1);
}
if ((fe->fe_logical | fe->fe_physical| fe->fe_length) &