else
wd = udata.u_cwd;
- i_ref(ninode = wd);
+ ninode = i_ref(wd);
i_ref(ninode);
for(;;)
}
-
-/* I_ref increases the reference count of the given inode table entry.
-*/
-
-void i_ref(inoptr ino)
-{
- ino->c_refs++;
-}
-
-
/* I_deref decreases the reference count of an inode, and frees it from
* the table if there are no more references to it. If it also has no
* links, the inode itself and its blocks(if not a device) is freed.
extern int8_t uf_alloc(void);
/* returns index of slot, or -1 on failure */
extern int8_t uf_alloc_n(int n);
-extern void i_ref(inoptr ino);
+#define i_ref(ino) ((ino)->c_refs++, (ino))
+//extern void i_ref(inoptr ino);
extern void i_deref(inoptr ino);
extern void wr_inode(inoptr ino);
extern bool isdevice(inoptr ino);
kputs("OK\n");
- i_ref(udata.u_cwd = root);
- i_ref(udata.u_root = root);
+ udata.u_cwd = i_ref(root);
+ udata.u_root = i_ref(root);
rdtime32(&udata.u_time);
exec_or_die();
}