git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Changed spinlock mechananisim
[tpg/acess2.git]
/
Kernel
/
vfs
/
mount.c
diff --git
a/Kernel/vfs/mount.c
b/Kernel/vfs/mount.c
index
eb6a5b1
..
0436043
100644
(file)
--- a/
Kernel/vfs/mount.c
+++ b/
Kernel/vfs/mount.c
@@
-1,7
+1,7
@@
/*
* Acess Micro - VFS Server version 1
*/
/*
* Acess Micro - VFS Server version 1
*/
-#include <
common
.h>
+#include <
acess
.h>
#include <vfs.h>
#include <vfs_int.h>
#include <fs_sysfs.h>
#include <vfs.h>
#include <vfs_int.h>
#include <fs_sysfs.h>
@@
-11,36
+11,39
@@
extern int giVFS_MountFileID;
extern char *gsVFS_MountFile;
// === PROTOTYPES ===
extern char *gsVFS_MountFile;
// === PROTOTYPES ===
- int VFS_Mount(char *Device, char *MountPoint, char *Filesystem, char *
ArgString
);
-void VFS_UpdateMountFile();
+ int VFS_Mount(char *Device, char *MountPoint, char *Filesystem, char *
Options
);
+void VFS_UpdateMountFile(
void
);
// === GLOBALS ===
// === GLOBALS ===
-
int glVFS_MountList = 0
;
+
tMutex glVFS_MountList
;
tVFS_Mount *gVFS_Mounts;
tVFS_Mount *gVFS_RootMount = NULL;
// === CODE ===
/**
tVFS_Mount *gVFS_Mounts;
tVFS_Mount *gVFS_RootMount = NULL;
// === CODE ===
/**
- * \fn int VFS_Mount(char *Device, char *MountPoint, char *Filesystem, char *ArgString)
* \brief Mount a device
* \param Device Device string to mount
* \param MountPoint Destination for the mount
* \param Filesystem Filesystem to use for the mount
* \brief Mount a device
* \param Device Device string to mount
* \param MountPoint Destination for the mount
* \param Filesystem Filesystem to use for the mount
- * \param
ArgString
Options to be passed to the filesystem
+ * \param
Options
Options to be passed to the filesystem
* \return -1 on Invalid FS, -2 on No Mem, 0 on success
* \return -1 on Invalid FS, -2 on No Mem, 0 on success
+ *
+ * Mounts the filesystem on \a Device at \a MountPoint using the driver
+ * \a Filesystem. The options in the string \a Options is passed to the
+ * driver's mount.
*/
*/
-int VFS_Mount(char *Device, char *MountPoint, char *Filesystem, char *
ArgString
)
+int VFS_Mount(char *Device, char *MountPoint, char *Filesystem, char *
Options
)
{
tVFS_Mount *mnt;
tVFS_Driver *fs;
int deviceLen = strlen(Device);
int mountLen = strlen(MountPoint);
{
tVFS_Mount *mnt;
tVFS_Driver *fs;
int deviceLen = strlen(Device);
int mountLen = strlen(MountPoint);
- int argLen = strlen(
ArgString
);
+ int argLen = strlen(
Options
);
// Get the filesystem
fs = VFS_GetFSByName(Filesystem);
if(!fs) {
// Get the filesystem
fs = VFS_GetFSByName(Filesystem);
if(!fs) {
-
Warning(
"VFS_Mount - Unknown FS Type '%s'", Filesystem);
+
Log_Warning("VFS",
"VFS_Mount - Unknown FS Type '%s'", Filesystem);
return -1;
}
return -1;
}
@@
-66,7
+69,7
@@
int VFS_Mount(char *Device, char *MountPoint, char *Filesystem, char *ArgString)
memcpy( mnt->MountPoint, MountPoint, mountLen+1 );
mnt->Options = &mnt->StrData[deviceLen+1+mountLen+1];
memcpy( mnt->MountPoint, MountPoint, mountLen+1 );
mnt->Options = &mnt->StrData[deviceLen+1+mountLen+1];
- memcpy( mnt->Options,
ArgString
, argLen+1 );
+ memcpy( mnt->Options,
Options
, argLen+1 );
// Initialise Volume
mnt->RootNode = fs->InitDevice(Device, NULL); //&ArgString);
// Initialise Volume
mnt->RootNode = fs->InitDevice(Device, NULL); //&ArgString);
@@
-79,7
+82,7
@@
int VFS_Mount(char *Device, char *MountPoint, char *Filesystem, char *ArgString)
if(!gVFS_RootMount) gVFS_RootMount = mnt;
// Add to mount list
if(!gVFS_RootMount) gVFS_RootMount = mnt;
// Add to mount list
-
LOCK
( &glVFS_MountList );
+
Mutex_Acquire
( &glVFS_MountList );
{
tVFS_Mount *tmp;
mnt->Next = NULL;
{
tVFS_Mount *tmp;
mnt->Next = NULL;
@@
-91,9
+94,9
@@
int VFS_Mount(char *Device, char *MountPoint, char *Filesystem, char *ArgString)
gVFS_Mounts = mnt;
}
}
gVFS_Mounts = mnt;
}
}
-
RELEASE
( &glVFS_MountList );
+
Mutex_Release
( &glVFS_MountList );
- Log
("VFS_Mount:
Mounted '%s' to '%s' ('%s')", Device, MountPoint, Filesystem);
+ Log
_Log("VFS", "
Mounted '%s' to '%s' ('%s')", Device, MountPoint, Filesystem);
VFS_UpdateMountFile();
VFS_UpdateMountFile();
@@
-101,10
+104,11
@@
int VFS_Mount(char *Device, char *MountPoint, char *Filesystem, char *ArgString)
}
/**
}
/**
- * \fn void VFS_UpdateMountFile()
* \brief Updates the mount file buffer
* \brief Updates the mount file buffer
+ *
+ * Updates the ProcFS mounts file buffer to match the current mounts list.
*/
*/
-void VFS_UpdateMountFile()
+void VFS_UpdateMountFile(
void
)
{
int len = 0;
char *buf;
{
int len = 0;
char *buf;
UCC
git Repository :: git.ucc.asn.au