if (!S_ISBLK(vp->v_mode)) continue;
/* Reopen the device on the driver, once per filp. */
- bits = mode_map[rfilp->filp_mode & O_ACCMODE];
+ bits = rfilp->filp_mode & (R_BIT|W_BIT);
if ((r = bdev_open(vp->v_sdev, bits)) != OK) {
printf("VFS: mounted dev %d/%d re-open failed: %d.\n",
maj, minor(vp->v_sdev), r);
if (rfilp->filp_flags & O_REOPEN) {
/* Try to reopen a file upon driver restart */
r = dev_reopen(vp->v_sdev, rfilp-filp,
- vp->v_mode & (R_BIT|W_BIT));
+ rfilp->filp_mode & (R_BIT|W_BIT));
if (r == OK)
return;
/* Data initialized elsewhere. */
extern int(*call_vec[]) (message *);
extern int(*pfs_call_vec[]) (message *m_out);
-extern char mode_map[]; /* mapping from O_ACCMODE mask to R_BIT/W_BIT flags */
EXTERN struct kinfo kinfo; /* kernel information */
#include "vmnt.h"
#include "path.h"
-char mode_map[] = {R_BIT, W_BIT, R_BIT|W_BIT, 0};
+static char mode_map[] = {R_BIT, W_BIT, R_BIT|W_BIT, 0};
static struct vnode *new_node(struct lookup *resolve, int oflags,
mode_t bits);