phunix/minix/fs/pfs/mount.c
David van Moolenbroek f859061eaf PFS: use libfsdriver
In order to avoid creating libfsdriver exceptions, two changes to VFS
are necessary:

- the returned position field for reads/writes is no longer abused to
  return the new pipe size; VFS is perfectly capable of updating the
  size itself;
- during system startup, PFS is now sent a mount request, just like all
  other file systems.

In proper "two steps forward, one step back" fashion, the latter point
has the consequence that PFS can no longer drop its privileges at
startup.  This is probably best resolved with a more general solution
for all boot image system services.  The upside is that PFS no longer
needs to be linked with libc.

Change-Id: I92e2410cdb0d93d0e6107bae10bc08efc2dbb8b3
2014-09-18 12:46:28 +00:00

36 lines
1.1 KiB
C

#include "fs.h"
#include "glo.h"
/*===========================================================================*
* fs_mount *
*===========================================================================*/
int fs_mount(dev_t __unused dev, unsigned int __unused flags,
struct fsdriver_node *node, unsigned int *res_flags)
{
/* Mount Pipe File Server. */
/* This function does not do much. PFS has no root node, and VFS will ignore
* the returned node details anyway. The whole idea is to provide symmetry
* with other file systems, thus keeping libfsdriver simple and free of
* special cases. Everything else (e.g., mounting PFS in VFS) is already an
* exception anyway.
*/
memset(node, 0, sizeof(*node));
*res_flags = 0;
return(OK);
}
/*===========================================================================*
* fs_unmount *
*===========================================================================*/
void fs_unmount(void)
{
/* Unmount Pipe File Server. */
if (busy)
printf("PFS: unmounting while busy!\n"); /* nothing we can do anyway */
}