2009-12-20 21:41:50 +01:00
|
|
|
#include "fs.h"
|
2013-04-15 19:44:19 +02:00
|
|
|
#include "inode.h"
|
2009-12-20 21:41:50 +01:00
|
|
|
|
|
|
|
|
|
|
|
/*===========================================================================*
|
|
|
|
* fs_sync *
|
|
|
|
*===========================================================================*/
|
2012-03-25 20:25:53 +02:00
|
|
|
int fs_sync(message *fs_m_in, message *fs_m_out)
|
2009-12-20 21:41:50 +01:00
|
|
|
{
|
|
|
|
/* Perform the sync() system call. No-op on this FS. */
|
|
|
|
|
|
|
|
return(OK); /* sync() can't fail */
|
|
|
|
}
|
2013-04-15 19:44:19 +02:00
|
|
|
|
|
|
|
/*===========================================================================*
|
|
|
|
* fs_chmod *
|
|
|
|
*===========================================================================*/
|
|
|
|
int fs_chmod(message *fs_m_in, message *fs_m_out)
|
|
|
|
{
|
|
|
|
struct inode *rip; /* target inode */
|
2014-04-30 20:37:50 +02:00
|
|
|
mode_t mode = fs_m_in->m_vfs_fs_chmod.mode;
|
2013-04-15 19:44:19 +02:00
|
|
|
|
2014-04-30 20:37:50 +02:00
|
|
|
if( (rip = find_inode(fs_m_in->m_vfs_fs_chmod.inode)) == NULL) return(EINVAL);
|
2013-04-15 19:44:19 +02:00
|
|
|
get_inode(rip->i_dev, rip->i_num); /* mark inode in use */
|
|
|
|
rip->i_mode = (rip->i_mode & ~ALL_MODES) | (mode & ALL_MODES);
|
|
|
|
put_inode(rip); /* release the inode */
|
|
|
|
return OK;
|
|
|
|
}
|