Fixes for the changes in khash.
Now the d_reclen field of struct dirent is correctly calculated in all file systems (read_dir() function). git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2114 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -91,8 +91,8 @@ struct bootfs_cookie {
|
||||
#define BOOTFS_HASH_SIZE 16
|
||||
|
||||
|
||||
static unsigned int
|
||||
bootfs_vnode_hash_func(void *_v, const void *_key, unsigned int range)
|
||||
static uint32
|
||||
bootfs_vnode_hash_func(void *_v, const void *_key, uint32 range)
|
||||
{
|
||||
struct bootfs_vnode *v = _v;
|
||||
const vnode_id *key = _key;
|
||||
@@ -840,9 +840,9 @@ bootfs_read_dir(fs_volume _fs, fs_vnode _vnode, fs_cookie _cookie, struct dirent
|
||||
|
||||
dirent->d_dev = fs->id;
|
||||
dirent->d_ino = cookie->u.dir.ptr->id;
|
||||
dirent->d_reclen = strlen(cookie->u.dir.ptr->name);
|
||||
dirent->d_reclen = strlen(cookie->u.dir.ptr->name) + sizeof(struct dirent);
|
||||
|
||||
if (sizeof(struct dirent) + dirent->d_reclen + 1 > bufferSize) {
|
||||
if (dirent->d_reclen > bufferSize) {
|
||||
status = ENOBUFS;
|
||||
goto err;
|
||||
}
|
||||
|
||||
@@ -106,8 +106,8 @@ static struct devfs *gDeviceFileSystem = NULL;
|
||||
#define BOOTFS_HASH_SIZE 16
|
||||
|
||||
|
||||
static unsigned int
|
||||
devfs_vnode_hash_func(void *_v, const void *_key, unsigned int range)
|
||||
static uint32
|
||||
devfs_vnode_hash_func(void *_v, const void *_key, uint32 range)
|
||||
{
|
||||
struct devfs_vnode *v = _v;
|
||||
const vnode_id *key = _key;
|
||||
@@ -829,9 +829,9 @@ devfs_read_dir(fs_volume _fs, fs_vnode _vnode, fs_cookie _cookie, struct dirent
|
||||
|
||||
dirent->d_dev = fs->id;
|
||||
dirent->d_ino = cookie->u.dir.ptr->id;
|
||||
dirent->d_reclen = strlen(cookie->u.dir.ptr->name);
|
||||
dirent->d_reclen = strlen(cookie->u.dir.ptr->name) + sizeof(struct dirent);
|
||||
|
||||
if (sizeof(struct dirent) + dirent->d_reclen + 1 > bufferSize) {
|
||||
if (dirent->d_reclen > bufferSize) {
|
||||
status = ENOBUFS;
|
||||
goto err;
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ struct rootfs {
|
||||
mount_id id;
|
||||
mutex lock;
|
||||
vnode_id next_vnode_id;
|
||||
void *vnode_list_hash;
|
||||
hash_table *vnode_list_hash;
|
||||
struct rootfs_vnode *root_vnode;
|
||||
};
|
||||
|
||||
@@ -74,8 +74,8 @@ struct rootfs_cookie {
|
||||
#define ROOTFS_HASH_SIZE 16
|
||||
|
||||
|
||||
static unsigned int
|
||||
rootfs_vnode_hash_func(void *_v, const void *_key, unsigned int range)
|
||||
static uint32
|
||||
rootfs_vnode_hash_func(void *_v, const void *_key, uint32 range)
|
||||
{
|
||||
struct rootfs_vnode *vnode = _v;
|
||||
const vnode_id *key = _key;
|
||||
@@ -668,10 +668,10 @@ rootfs_read_dir(fs_volume _fs, fs_vnode _vnode, fs_cookie _cookie, struct dirent
|
||||
|
||||
dirent->d_dev = fs->id;
|
||||
dirent->d_ino = cookie->ptr->id;
|
||||
dirent->d_reclen = strlen(cookie->ptr->name);
|
||||
dirent->d_reclen = strlen(cookie->ptr->name) + sizeof(struct dirent);
|
||||
|
||||
if (sizeof(struct dirent) + dirent->d_reclen + 1 > bufferSize) {
|
||||
status = ERR_VFS_INSUFFICIENT_BUF;
|
||||
if (dirent->d_reclen > bufferSize) {
|
||||
status = ENOBUFS;
|
||||
goto err;
|
||||
}
|
||||
|
||||
|
||||
@@ -257,8 +257,8 @@ mount_compare(void *_m, const void *_key)
|
||||
}
|
||||
|
||||
|
||||
static unsigned int
|
||||
mount_hash(void *_m, const void *_key, unsigned int range)
|
||||
static uint32
|
||||
mount_hash(void *_m, const void *_key, uint32 range)
|
||||
{
|
||||
struct fs_mount *mount = _m;
|
||||
const mount_id *id = _key;
|
||||
@@ -429,22 +429,22 @@ get_file_system(const char *name)
|
||||
|
||||
|
||||
static int
|
||||
vnode_compare(void *_v, const void *_key)
|
||||
vnode_compare(void *_vnode, const void *_key)
|
||||
{
|
||||
struct vnode *v = _v;
|
||||
struct vnode *vnode = _vnode;
|
||||
const struct vnode_hash_key *key = _key;
|
||||
|
||||
if (v->mount_id == key->mount_id && v->id == key->vnode_id)
|
||||
if (vnode->mount_id == key->mount_id && vnode->id == key->vnode_id)
|
||||
return 0;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
static unsigned int
|
||||
vnode_hash(void *_v, const void *_key, unsigned int range)
|
||||
static uint32
|
||||
vnode_hash(void *_vnode, const void *_key, uint32 range)
|
||||
{
|
||||
struct vnode *vnode = _v;
|
||||
struct vnode *vnode = _vnode;
|
||||
const struct vnode_hash_key *key = _key;
|
||||
|
||||
#define VHASH(mountid, vnodeid) (((uint32)((vnodeid) >> 32) + (uint32)(vnodeid)) ^ (uint32)(mountid))
|
||||
|
||||
Reference in New Issue
Block a user