52 |
spin_unlock (&diskfs_node_refcnt_lock); |
spin_unlock (&diskfs_node_refcnt_lock); |
53 |
|
|
54 |
dn->type = IFTODT (mode & S_IFMT); |
dn->type = IFTODT (mode & S_IFMT); |
55 |
return diskfs_cached_lookup ((ino_t) dn, npp); |
return diskfs_cached_lookup ((ino_t) (uintptr_t) dn, npp); |
56 |
} |
} |
57 |
|
|
58 |
void |
void |
154 |
/* Fetch inode INUM, set *NPP to the node structure; |
/* Fetch inode INUM, set *NPP to the node structure; |
155 |
gain one user reference and lock the node. */ |
gain one user reference and lock the node. */ |
156 |
error_t |
error_t |
157 |
diskfs_cached_lookup (int inum, struct node **npp) |
diskfs_cached_lookup (ino_t inum, struct node **npp) |
158 |
{ |
{ |
159 |
struct disknode *dn = (void *) inum; |
struct disknode *dn = (void *) (uintptr_t) inum; |
160 |
struct node *np; |
struct node *np; |
161 |
|
|
162 |
assert (npp); |
assert (npp); |
175 |
struct stat *st; |
struct stat *st; |
176 |
|
|
177 |
np = diskfs_make_node (dn); |
np = diskfs_make_node (dn); |
178 |
np->cache_id = (ino_t) dn; |
np->cache_id = (ino_t) (uintptr_t) dn; |
179 |
|
|
180 |
spin_lock (&diskfs_node_refcnt_lock); |
spin_lock (&diskfs_node_refcnt_lock); |
181 |
dn->hnext = all_nodes; |
dn->hnext = all_nodes; |
191 |
st->st_fsid = getpid (); |
st->st_fsid = getpid (); |
192 |
st->st_blksize = vm_page_size; |
st->st_blksize = vm_page_size; |
193 |
|
|
194 |
st->st_ino = (ino_t) dn; |
st->st_ino = (ino_t) (uintptr_t) dn; |
195 |
st->st_gen = dn->gen; |
st->st_gen = dn->gen; |
196 |
|
|
197 |
st->st_size = dn->size; |
st->st_size = dn->size; |