Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/makefs/msdos.c
Show First 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | |||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include <string.h> | #include <string.h> | ||||
#include <stdint.h> | #include <stdint.h> | ||||
#include <unistd.h> | #include <unistd.h> | ||||
#include <dirent.h> | #include <dirent.h> | ||||
#include <util.h> | #include <util.h> | ||||
#include "ffs/buf.h" | |||||
#include "makefs.h" | |||||
#include "msdos.h" | |||||
#include <mkfs_msdos.h> | #include <mkfs_msdos.h> | ||||
#include <fs/msdosfs/bpb.h> | #include <fs/msdosfs/bpb.h> | ||||
#include "msdos/direntry.h" | #include "msdos/direntry.h" | ||||
#include <fs/msdosfs/denode.h> | #include <fs/msdosfs/denode.h> | ||||
#include <fs/msdosfs/msdosfsmount.h> | #include <fs/msdosfs/msdosfsmount.h> | ||||
#undef clrbuf | |||||
#include "ffs/buf.h" | |||||
#include "makefs.h" | |||||
#include "msdos.h" | |||||
static int msdos_populate_dir(const char *, struct denode *, fsnode *, | static int msdos_populate_dir(const char *, struct denode *, fsnode *, | ||||
fsnode *, fsinfo_t *); | fsnode *, fsinfo_t *); | ||||
struct msdos_options_ex { | struct msdos_options_ex { | ||||
struct msdos_options options; | struct msdos_options options; | ||||
}; | }; | ||||
void | void | ||||
▲ Show 20 Lines • Show All 65 Lines • ▼ Show 20 Lines | msdos_parse_opts(const char *option, fsinfo_t *fsopts) | ||||
return 1; | return 1; | ||||
} | } | ||||
void | void | ||||
msdos_makefs(const char *image, const char *dir, fsnode *root, fsinfo_t *fsopts) | msdos_makefs(const char *image, const char *dir, fsnode *root, fsinfo_t *fsopts) | ||||
{ | { | ||||
struct msdos_options_ex *msdos_opt = fsopts->fs_specific; | struct msdos_options_ex *msdos_opt = fsopts->fs_specific; | ||||
struct vnode vp, rootvp; | struct m_vnode vp, rootvp; | ||||
struct timeval start; | struct timeval start; | ||||
struct msdosfsmount *pmp; | struct msdosfsmount *pmp; | ||||
uint32_t flags; | uint32_t flags; | ||||
assert(image != NULL); | assert(image != NULL); | ||||
assert(dir != NULL); | assert(dir != NULL); | ||||
assert(root != NULL); | assert(root != NULL); | ||||
assert(fsopts != NULL); | assert(fsopts != NULL); | ||||
Show All 21 Lines | msdos_makefs(const char *image, const char *dir, fsnode *root, fsinfo_t *fsopts) | ||||
if (mkfs_msdos(image, NULL, &msdos_opt->options) == -1) | if (mkfs_msdos(image, NULL, &msdos_opt->options) == -1) | ||||
return; | return; | ||||
TIMER_RESULTS(start, "mkfs_msdos"); | TIMER_RESULTS(start, "mkfs_msdos"); | ||||
fsopts->fd = open(image, O_RDWR); | fsopts->fd = open(image, O_RDWR); | ||||
vp.fs = fsopts; | vp.fs = fsopts; | ||||
flags = 0; | flags = 0; | ||||
if ((pmp = msdosfs_mount(&vp)) == NULL) | if ((pmp = m_msdosfs_mount(&vp)) == NULL) | ||||
err(1, "msdosfs_mount"); | err(1, "msdosfs_mount"); | ||||
if (msdosfs_root(pmp, &rootvp) != 0) | if (msdosfs_root(pmp, &rootvp) != 0) | ||||
err(1, "msdosfs_root"); | err(1, "msdosfs_root"); | ||||
if (debug & DEBUG_FS_MAKEFS) | if (debug & DEBUG_FS_MAKEFS) | ||||
printf("msdos_makefs: image %s directory %s root %p\n", | printf("msdos_makefs: image %s directory %s root %p\n", | ||||
image, dir, root); | image, dir, root); | ||||
▲ Show 20 Lines • Show All 77 Lines • Show Last 20 Lines |