allocation unit is cluster, not sector
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@262 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
cf935803a0
commit
f1170204c5
@ -2154,8 +2154,8 @@ static int fat_stat(struct inode *mountpt, const char *relpath, struct stat *buf
|
||||
/* File/directory size, access block size */
|
||||
|
||||
buf->st_size = DIR_GETFILESIZE(dirinfo.fd_entry);
|
||||
buf->st_blksize = fs->fs_hwsectorsize;
|
||||
buf->st_blocks = SEC_NSECTORS(fs, buf->st_size + SEC_NDXMASK(fs));
|
||||
buf->st_blksize = fs->fs_fatsecperclus * fs->fs_hwsectorsize;
|
||||
buf->st_blocks = (buf->st_size + buf->st_blksize - 1) / buf->st_blksize;
|
||||
|
||||
/* Times */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user