diff options
author | cinap_lenrek <cinap_lenrek@localhost> | 2011-05-10 07:26:31 +0000 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@localhost> | 2011-05-10 07:26:31 +0000 |
commit | 6063ab829f10853df8f38ea75de826501e30907a (patch) | |
tree | 046b6fcbad9b39873991cb301ec92ddba47eb677 /sys/src/boot | |
parent | 79af8162e8d76999a3f8c636fe84d5e9ffe14362 (diff) |
9bootfat: rename open() to fileinit and make it static as its really a internal function function
Diffstat (limited to 'sys/src/boot')
-rw-r--r-- | sys/src/boot/pc/fat.c | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/sys/src/boot/pc/fat.c b/sys/src/boot/pc/fat.c index 3de09cf48..adb4dae15 100644 --- a/sys/src/boot/pc/fat.c +++ b/sys/src/boot/pc/fat.c @@ -164,19 +164,6 @@ read(void *f, void *data, int len) } void -open(Fat *fat, void *f, ulong lba) -{ - File *fp = f; - - fp->fat = fat; - fp->lba = lba; - fp->len = 0; - fp->lbaoff = 0; - fp->clust = ~0U; - fp->rp = fp->ep = fp->buf + Sectsz; -} - -void close(void *) { } @@ -217,6 +204,17 @@ dirclust(Dir *d) return *((ushort*)d->starthi)<<16 | *((ushort*)d->startlo); } +static void +fileinit(File *fp, Fat *fat, ulong lba) +{ + fp->fat = fat; + fp->lba = lba; + fp->len = 0; + fp->lbaoff = 0; + fp->clust = ~0U; + fp->rp = fp->ep = fp->buf + Sectsz; +} + static int fatwalk(File *fp, Fat *fat, char *path) { @@ -225,11 +223,11 @@ fatwalk(File *fp, Fat *fat, char *path) Dir d; if(fat->ver == Fat32){ - open(fat, fp, 0); + fileinit(fp, fat, 0); fp->clust = fat->dirstart; fp->len = ~0U; }else{ - open(fat, fp, fat->dirstart); + fileinit(fp, fat, fat->dirstart); fp->len = fat->dirents * Dirsz; } for(;;){ @@ -243,7 +241,7 @@ fatwalk(File *fp, Fat *fat, char *path) end = path + strlen(path); j = end - path; if(i == j && memcmp(name, path, j) == 0){ - open(fat, fp, 0); + fileinit(fp, fat, 0); fp->clust = dirclust(&d); fp->len = *((ulong*)d.len); if(*end == 0) |