mirror of
https://github.com/drasko/codezero.git
synced 2026-03-31 09:19:03 +02:00
Another minor fix in lookup.c
This commit is contained in:
@@ -76,7 +76,7 @@ struct vnode *generic_vnode_lookup(struct vnode *thisnode, char *path)
|
|||||||
/* Are there any more path components? */
|
/* Are there any more path components? */
|
||||||
if (path) {
|
if (path) {
|
||||||
/* Read directory contents */
|
/* Read directory contents */
|
||||||
if ((err = (int)d->vnode->ops.readdir(d->vnode)))
|
if ((err = d->vnode->ops.readdir(d->vnode)) < 0)
|
||||||
return PTR_ERR(err);
|
return PTR_ERR(err);
|
||||||
|
|
||||||
/* Search all children one level below. */
|
/* Search all children one level below. */
|
||||||
|
|||||||
@@ -229,7 +229,6 @@ int memfs_vnode_readdir(struct vnode *v)
|
|||||||
/* This is as big as a page */
|
/* This is as big as a page */
|
||||||
v->dirbuf.buffer = vfs_alloc_dirpage();
|
v->dirbuf.buffer = vfs_alloc_dirpage();
|
||||||
v->dirbuf.npages = 1;
|
v->dirbuf.npages = 1;
|
||||||
memfsd = (struct memfs_dentry *) v->dirbuf.buffer;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Fail if vnode size is bigger than a page. Since this allocation
|
* Fail if vnode size is bigger than a page. Since this allocation
|
||||||
@@ -241,6 +240,8 @@ int memfs_vnode_readdir(struct vnode *v)
|
|||||||
if ((err = v->fops.read(v, 0, 1, v->dirbuf.buffer)))
|
if ((err = v->fops.read(v, 0, 1, v->dirbuf.buffer)))
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
|
memfsd = (struct memfs_dentry *)v->dirbuf.buffer;
|
||||||
|
|
||||||
/* Read fs-specific directory entry into vnode and dentry caches. */
|
/* Read fs-specific directory entry into vnode and dentry caches. */
|
||||||
for (int i = 0; i < (v->size / sizeof(struct memfs_dentry)); i++) {
|
for (int i = 0; i < (v->size / sizeof(struct memfs_dentry)); i++) {
|
||||||
struct dentry *newd;
|
struct dentry *newd;
|
||||||
|
|||||||
Reference in New Issue
Block a user