Changeset View
Changeset View
Standalone View
Standalone View
stand/libsa/dosfs.c
Show All 32 Lines | |||||
* also supports VFAT. | * also supports VFAT. | ||||
*/ | */ | ||||
#include <sys/types.h> | #include <sys/types.h> | ||||
#include <string.h> | #include <string.h> | ||||
#include <stddef.h> | #include <stddef.h> | ||||
#include "stand.h" | #include "stand.h" | ||||
#include "disk.h" | |||||
#include "dosfs.h" | #include "dosfs.h" | ||||
typedef struct dos_mnt { | typedef struct dos_mnt { | ||||
char *dos_dev; | char *dos_dev; | ||||
DOS_FS *dos_fs; | DOS_FS *dos_fs; | ||||
int dos_fd; | int dos_fd; | ||||
STAILQ_ENTRY(dos_mnt) dos_link; | STAILQ_ENTRY(dos_mnt) dos_link; | ||||
▲ Show 20 Lines • Show All 259 Lines • ▼ Show 20 Lines | dos_open(const char *path, struct open_file *fd) | ||||
DOS_DE *de; | DOS_DE *de; | ||||
DOS_FILE *f; | DOS_FILE *f; | ||||
DOS_FS *fs; | DOS_FS *fs; | ||||
dos_mnt_t *mnt; | dos_mnt_t *mnt; | ||||
const char *dev; | const char *dev; | ||||
u_int size, clus; | u_int size, clus; | ||||
int err; | int err; | ||||
dev = disk_fmtdev(fd->f_devdata); | dev = devformat((struct devdesc *)fd->f_devdata); | ||||
STAILQ_FOREACH(mnt, &mnt_list, dos_link) { | STAILQ_FOREACH(mnt, &mnt_list, dos_link) { | ||||
if (strcmp(dev, mnt->dos_dev) == 0) | if (strcmp(dev, mnt->dos_dev) == 0) | ||||
break; | break; | ||||
} | } | ||||
if (mnt == NULL) { | if (mnt == NULL) { | ||||
/* Allocate mount structure, associate with open */ | /* Allocate mount structure, associate with open */ | ||||
if ((fs = malloc(sizeof(DOS_FS))) == NULL) | if ((fs = malloc(sizeof(DOS_FS))) == NULL) | ||||
▲ Show 20 Lines • Show All 644 Lines • Show Last 20 Lines |