* Most of the other file systems now maintain the st_blocks value. It might not
always be correct, but should be at least close. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27793 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -446,10 +446,12 @@ fill_stat_buffer(Volume* volume, Inode* inode, Attribute* attribute,
|
|||||||
|
|
||||||
if (attribute != NULL) {
|
if (attribute != NULL) {
|
||||||
stat.st_size = attribute->Size();
|
stat.st_size = attribute->Size();
|
||||||
|
stat.st_blocks = 0;
|
||||||
stat.st_mode = S_ATTR | 0666;
|
stat.st_mode = S_ATTR | 0666;
|
||||||
stat.st_type = attribute->Type();
|
stat.st_type = attribute->Type();
|
||||||
} else {
|
} else {
|
||||||
stat.st_size = inode->Size() + sizeof(wav_header);
|
stat.st_size = inode->Size() + sizeof(wav_header);
|
||||||
|
stat.st_blocks = inode->Size() / 512;
|
||||||
stat.st_mode = inode->Type();
|
stat.st_mode = inode->Type();
|
||||||
stat.st_type = 0;
|
stat.st_type = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -338,6 +338,8 @@ ext2_read_stat(fs_volume* _volume, fs_vnode* _node, struct stat* stat)
|
|||||||
stat->st_crtime = node.CreationTime();
|
stat->st_crtime = node.CreationTime();
|
||||||
|
|
||||||
stat->st_size = inode->Size();
|
stat->st_size = inode->Size();
|
||||||
|
stat->st_blocks = (inode->Size() + 511) / 512;
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -195,6 +195,7 @@ dosfs_rstat(fs_volume *_vol, fs_vnode *_node, struct stat *st)
|
|||||||
st->st_uid = 0;
|
st->st_uid = 0;
|
||||||
st->st_gid = 0;
|
st->st_gid = 0;
|
||||||
st->st_size = node->st_size;
|
st->st_size = node->st_size;
|
||||||
|
st->st_blocks = (node->st_size + 511) / 512;
|
||||||
st->st_blksize = 0x10000; /* this value was chosen arbitrarily */
|
st->st_blksize = 0x10000; /* this value was chosen arbitrarily */
|
||||||
st->st_atime = st->st_mtime = st->st_ctime = st->st_crtime = node->st_time;
|
st->st_atime = st->st_mtime = st->st_ctime = st->st_crtime = node->st_time;
|
||||||
|
|
||||||
|
|||||||
@@ -433,6 +433,7 @@ fs_read_stat(fs_volume *_vol, fs_vnode *_node, struct stat *st)
|
|||||||
|
|
||||||
// Same for file/dir in ISO9660
|
// Same for file/dir in ISO9660
|
||||||
st->st_size = node->dataLen[FS_DATA_FORMAT];
|
st->st_size = node->dataLen[FS_DATA_FORMAT];
|
||||||
|
st->st_blocks = (st->st_size + 511) / 512;
|
||||||
if (ConvertRecDate(&(node->recordDate), &time) == B_NO_ERROR)
|
if (ConvertRecDate(&(node->recordDate), &time) == B_NO_ERROR)
|
||||||
st->st_ctime = st->st_mtime = st->st_atime = time;
|
st->st_ctime = st->st_mtime = st->st_atime = time;
|
||||||
|
|
||||||
|
|||||||
@@ -232,6 +232,7 @@ udf_read_stat(fs_volume *_volume, fs_vnode *node, struct stat *stat)
|
|||||||
|
|
||||||
stat->st_mode = icb->Mode();
|
stat->st_mode = icb->Mode();
|
||||||
stat->st_size = icb->Length();
|
stat->st_size = icb->Length();
|
||||||
|
stat->st_blocks = (stat->st_size + 511) / 512;
|
||||||
|
|
||||||
// File times. For now, treat the modification time as creation
|
// File times. For now, treat the modification time as creation
|
||||||
// time as well, since true creation time is an optional extended
|
// time as well, since true creation time is an optional extended
|
||||||
|
|||||||
@@ -1789,6 +1789,7 @@ devfs_read_stat(fs_volume* _volume, fs_vnode* _vnode, struct stat* stat)
|
|||||||
|
|
||||||
stat->st_nlink = 1;
|
stat->st_nlink = 1;
|
||||||
stat->st_blksize = 65536;
|
stat->st_blksize = 65536;
|
||||||
|
stat->st_blocks = 0;
|
||||||
|
|
||||||
stat->st_uid = vnode->uid;
|
stat->st_uid = vnode->uid;
|
||||||
stat->st_gid = vnode->gid;
|
stat->st_gid = vnode->gid;
|
||||||
|
|||||||
@@ -1008,6 +1008,7 @@ rootfs_read_stat(fs_volume *_volume, fs_vnode *_v, struct stat *stat)
|
|||||||
|
|
||||||
stat->st_nlink = 1;
|
stat->st_nlink = 1;
|
||||||
stat->st_blksize = 65536;
|
stat->st_blksize = 65536;
|
||||||
|
stat->st_blocks = 0;
|
||||||
|
|
||||||
stat->st_uid = vnode->uid;
|
stat->st_uid = vnode->uid;
|
||||||
stat->st_gid = vnode->gid;
|
stat->st_gid = vnode->gid;
|
||||||
|
|||||||
Reference in New Issue
Block a user