diff options
author | Alejandro Pulver <alepulver@FreeBSD.org> | 2007-10-30 03:22:04 +0000 |
---|---|---|
committer | Alejandro Pulver <alepulver@FreeBSD.org> | 2007-10-30 03:22:04 +0000 |
commit | cf9758e30f7959f1f1b7627500276d3eaf2990ae (patch) | |
tree | 82ca3b72ed42f5d8e9a9ad64ce4891d5142af653 /sysutils/ntfsprogs/files/patch-libntfs-device.c | |
parent | - Update to 0.2.7 (diff) |
- Bump PORTREVISION.
- Remove FreeBSD 4.x code (USE_GCC=3.4+, USE_GETOPT_LONG and BROKEN).
- Use ARCH instead of MACHINE_ARCH for possible future cross-compilation
support.
- Add UBLIO option, which uses devel/libublio for greatly improved speed (when
reading an NTFS volume). Also print a warning when disabling UBLIO.
- Add pkg-message mentioning UBLIO and this port's limitations.
- Change mount.ntfs-fuse -> mount_ntfs-fuse manpage link and symlink to the
binary in /usr/sbin to allow using with 'mount -t ntfs-fuse' and in
/etc/fstab after mounting /usr.
- Add a note in pkg-descr about the fusefs driver and ntfs-3g split project.
- Add LOCK option to avoid access to the device while it's mounted.
PR: ports/116287
Submitted by: alepulver (myself)
Approved by: miwi, farrokhi (implicitly to miwi)
Diffstat (limited to 'sysutils/ntfsprogs/files/patch-libntfs-device.c')
-rw-r--r-- | sysutils/ntfsprogs/files/patch-libntfs-device.c | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/sysutils/ntfsprogs/files/patch-libntfs-device.c b/sysutils/ntfsprogs/files/patch-libntfs-device.c new file mode 100644 index 000000000000..dfcc22a5eb05 --- /dev/null +++ b/sysutils/ntfsprogs/files/patch-libntfs-device.c @@ -0,0 +1,56 @@ +--- ./libntfs/device.c.orig Tue Jan 9 18:22:57 2007 ++++ ./libntfs/device.c Mon Apr 30 13:40:54 2007 +@@ -63,6 +63,9 @@ + #ifdef HAVE_LINUX_HDREG_H + #include <linux/hdreg.h> + #endif ++#ifdef __FreeBSD__ ++#include <sys/disk.h> ++#endif + + #include "types.h" + #include "mst.h" +@@ -533,6 +536,17 @@ + } + } + #endif ++#ifdef DIOCGMEDIASIZE ++ { off_t size; ++ ++ if (dev->d_ops->ioctl(dev, DIOCGMEDIASIZE, &size) >= 0) { ++ ntfs_log_debug("DIOCGMEDIASIZE nr bytes = %llu (0x%llx)\n", ++ (unsigned long long)size, ++ (unsigned long long)size); ++ return (s64)size / block_size; ++ } ++ } ++#endif + /* + * We couldn't figure it out by using a specialized ioctl, + * so do binary search to find the size of the device. +@@ -681,7 +695,24 @@ + return sect_size; + } + } +-#else ++#elif defined(DIOCGSECTORSIZE) ++ /* ++ * XXX On FreeBSD (where we have DIOCGSECTORSIZE) the low-level I/O ++ * system already knows the sector size, and doing an ioctl is needless. ++ * However, I don't know how to extract that information cleanly, ++ * without letting a bunch of platform specific #ifdef-s to sneak in. ++ * So now I rather just re-do the ioctl... ++ */ ++ { ++ size_t sect_size = 0; ++ ++ if (!dev->d_ops->ioctl(dev, DIOCGSECTORSIZE, §_size)) { ++ ntfs_log_debug("DIOCGSECTORSIZE sector size = %d bytes\n", ++ (int)sect_size); ++ return sect_size; ++ } ++ } ++#else + errno = EOPNOTSUPP; + #endif + return -1; |