* Added support for files larger than 4GB - not yet tested, though.
* The stat::st_nlink value is now correctly reported. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26188 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -30,6 +30,7 @@ Inode::Inode(Volume* volume, ino_t id)
|
||||
}
|
||||
|
||||
if (fNode != NULL) {
|
||||
// TODO: we don't need a cache for short symlinks
|
||||
fCache = file_cache_create(fVolume->ID(), ID(), Size());
|
||||
fMap = file_map_create(fVolume->ID(), ID(), Size());
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
#define EXT2_H
|
||||
|
||||
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <ByteOrder.h>
|
||||
#include <fs_interface.h>
|
||||
|
||||
@@ -160,7 +162,11 @@ struct ext2_inode {
|
||||
};
|
||||
uint32 generation;
|
||||
uint32 file_access_control;
|
||||
uint32 directory_access_control;
|
||||
union {
|
||||
// for directories vs. files
|
||||
uint32 directory_access_control;
|
||||
uint32 size_high;
|
||||
};
|
||||
uint32 fragment;
|
||||
uint8 fragment_number;
|
||||
uint8 fragment_size;
|
||||
@@ -170,14 +176,24 @@ struct ext2_inode {
|
||||
uint32 _reserved2;
|
||||
|
||||
uint16 Mode() const { return B_LENDIAN_TO_HOST_INT16(mode); }
|
||||
uint32 Size() const { return B_LENDIAN_TO_HOST_INT32(size); }
|
||||
uint32 Flags() const { return B_LENDIAN_TO_HOST_INT32(flags); }
|
||||
uint16 NumLinks() const { return B_LENDIAN_TO_HOST_INT16(num_links); }
|
||||
|
||||
time_t AccessTime() const { return B_LENDIAN_TO_HOST_INT32(access_time); }
|
||||
time_t CreationTime() const { return B_LENDIAN_TO_HOST_INT32(creation_time); }
|
||||
time_t ModificationTime() const { return B_LENDIAN_TO_HOST_INT32(modification_time); }
|
||||
time_t DeletionTime() const { return B_LENDIAN_TO_HOST_INT32(deletion_time); }
|
||||
|
||||
off_t Size() const
|
||||
{
|
||||
if (S_ISREG(Mode())) {
|
||||
return B_LENDIAN_TO_HOST_INT32(size)
|
||||
| ((off_t)B_LENDIAN_TO_HOST_INT32(size_high) << 32);
|
||||
}
|
||||
|
||||
return B_LENDIAN_TO_HOST_INT32(size);
|
||||
}
|
||||
|
||||
uint16 UserID() const
|
||||
{
|
||||
return B_LENDIAN_TO_HOST_INT16(uid)
|
||||
|
||||
@@ -327,7 +327,7 @@ ext2_read_stat(fs_volume* _volume, fs_vnode* _node, struct stat* stat)
|
||||
|
||||
stat->st_dev = inode->GetVolume()->ID();
|
||||
stat->st_ino = inode->ID();
|
||||
stat->st_nlink = 1;
|
||||
stat->st_nlink = node.NumLinks();
|
||||
stat->st_blksize = EXT2_IO_SIZE;
|
||||
|
||||
stat->st_uid = node.UserID();
|
||||
|
||||
Reference in New Issue
Block a user