static status_t btrfs_read_stat(fs_volume* _volume, fs_vnode* _node, struct stat* stat) { Inode* inode = (Inode*)_node->private_node; stat->st_dev = inode->GetVolume()->ID(); stat->st_ino = inode->ID(); stat->st_nlink = 1; stat->st_blksize = BTRFS_IO_SIZE; stat->st_uid = inode->UserID(); stat->st_gid = inode->GroupID(); stat->st_mode = inode->Mode(); stat->st_type = 0; inode->GetAccessTime(stat->st_atim); inode->GetModificationTime(stat->st_mtim); inode->GetChangeTime(stat->st_ctim); inode->GetCreationTime(stat->st_crtim); stat->st_size = inode->Size(); stat->st_blocks = (inode->Size() + 511) / 512; return B_OK; }
static status_t ext2_read_stat(fs_volume* _volume, fs_vnode* _node, struct stat* stat) { Inode* inode = (Inode*)_node->private_node; const ext2_inode& node = inode->Node(); stat->st_dev = inode->GetVolume()->ID(); stat->st_ino = inode->ID(); stat->st_nlink = node.NumLinks(); stat->st_blksize = EXT2_IO_SIZE; stat->st_uid = node.UserID(); stat->st_gid = node.GroupID(); stat->st_mode = node.Mode(); stat->st_type = 0; inode->GetAccessTime(&stat->st_atim); inode->GetModificationTime(&stat->st_mtim); inode->GetChangeTime(&stat->st_ctim); inode->GetCreationTime(&stat->st_crtim); stat->st_size = inode->Size(); stat->st_blocks = (inode->Size() + 511) / 512; return B_OK; }