nfs4: Fill struct stat st_blksize and st_blocks fields
This commit is contained in:
@@ -534,6 +534,10 @@ Inode::GetStat(struct stat* st, OpenAttrCookie* attr)
|
||||
memset(&st->st_mtim, 0, sizeof(timespec));
|
||||
delete[] values;
|
||||
|
||||
st->st_blksize = fFileSystem->Root()->IOSize();
|
||||
st->st_blocks = st->st_size / st->st_blksize;
|
||||
st->st_blocks += st->st_size % st->st_blksize == 0 ? 0 : 1;
|
||||
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,8 @@ MetadataCache::GetStat(struct stat* st)
|
||||
st->st_ctim = fStatCache.st_ctim;
|
||||
st->st_crtim = fStatCache.st_crtim;
|
||||
st->st_mtim = fStatCache.st_mtim;
|
||||
|
||||
st->st_blksize = fStatCache.st_blksize;
|
||||
st->st_blocks = fStatCache.st_blocks;
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user