From 05a034e423b748ae1d34ba522459695672f11d8d Mon Sep 17 00:00:00 2001 From: yura Date: Tue, 21 Nov 2006 16:24:37 +0000 Subject: [PATCH] fix st_blocks calculation --- ChangeLog | 3 ++- ntfsprogs/ntfsmount.c | 8 +++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index c5c243bc..755d6724 100644 --- a/ChangeLog +++ b/ChangeLog @@ -72,7 +72,8 @@ xx/xx/2006 - x.xx.x - . - Windows cares only about first 4 records in $MFTMirr and ignores everything beyond them. Update libntfs behaviour to be like in windows. (Yura) - - Fix free clusters and MFT records calculation. (Yura) + - ntfsmount: Fix free clusters and MFT records calculation. (Yura) + - ntfsmount: Fix st_blocks calculation. (Yuval, Yura) 21/06/2006 - 1.13.1 - Various fixes. diff --git a/ntfsprogs/ntfsmount.c b/ntfsprogs/ntfsmount.c index 2fbdf358..b25bb6b9 100644 --- a/ntfsprogs/ntfsmount.c +++ b/ntfsprogs/ntfsmount.c @@ -322,8 +322,7 @@ static int ntfs_fuse_getattr(const char *org_path, struct stat *stbuf) na = ntfs_attr_open(ni, AT_INDEX_ALLOCATION, NTFS_INDEX_I30, 4); if (na) { stbuf->st_size = na->data_size; - stbuf->st_blocks = na->allocated_size >> - vol->sector_size_bits; + stbuf->st_blocks = na->allocated_size >> 9; ntfs_attr_close(na); } else { stbuf->st_size = 0; @@ -334,7 +333,7 @@ static int ntfs_fuse_getattr(const char *org_path, struct stat *stbuf) /* Regular or Interix (INTX) file. */ stbuf->st_mode = S_IFREG; stbuf->st_size = ni->data_size; - stbuf->st_blocks = ni->allocated_size >> vol->sector_size_bits; + stbuf->st_blocks = ni->allocated_size >> 9; stbuf->st_nlink = le16_to_cpu(ni->mrec->link_count); if (ni->flags & FILE_ATTR_SYSTEM || stream_name_len) { na = ntfs_attr_open(ni, AT_DATA, stream_name, @@ -346,8 +345,7 @@ static int ntfs_fuse_getattr(const char *org_path, struct stat *stbuf) } if (stream_name_len) { stbuf->st_size = na->data_size; - stbuf->st_blocks = na->allocated_size >> - vol->sector_size_bits; + stbuf->st_blocks = ni->allocated_size >> 9; } /* Check whether it's Interix FIFO or socket. */ if (!(ni->flags & FILE_ATTR_HIDDEN) &&