parent
a042aaae0a
commit
44635dd22e
19
fs/fs.c
19
fs/fs.c
|
@ -47,7 +47,7 @@ static int init_cwd(void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
core_initcall(init_cwd);
|
||||
postcore_initcall(init_cwd);
|
||||
|
||||
/*
|
||||
* - Remove all multiple slashes
|
||||
|
@ -448,6 +448,23 @@ out:
|
|||
return errno;
|
||||
}
|
||||
|
||||
int erase(int fd, size_t count, unsigned long offset)
|
||||
{
|
||||
struct device_d *dev;
|
||||
struct fs_driver_d *fsdrv;
|
||||
FILE *f = &files[fd];
|
||||
|
||||
dev = f->dev;
|
||||
|
||||
fsdrv = (struct fs_driver_d *)dev->driver->type_data;
|
||||
|
||||
if (f->pos + count > f->size)
|
||||
count = f->size - f->pos;
|
||||
errno = fsdrv->erase(dev, f, count, offset);
|
||||
|
||||
return errno;
|
||||
}
|
||||
|
||||
int close(int fd)
|
||||
{
|
||||
struct device_d *dev;
|
||||
|
|
Loading…
Reference in New Issue