minix/servers/pfs/misc.c
Lionel Sambuc ea84447ccd Message types for VFS chmod
Change-Id: I76e5df4c0a386682e863e640182c59e4ab7e30be
2014-07-28 17:05:29 +02:00

28 lines
988 B
C

#include "fs.h"
#include "inode.h"
/*===========================================================================*
* fs_sync *
*===========================================================================*/
int fs_sync(message *fs_m_in, message *fs_m_out)
{
/* Perform the sync() system call. No-op on this FS. */
return(OK); /* sync() can't fail */
}
/*===========================================================================*
* fs_chmod *
*===========================================================================*/
int fs_chmod(message *fs_m_in, message *fs_m_out)
{
struct inode *rip; /* target inode */
mode_t mode = fs_m_in->m_vfs_fs_chmod.mode;
if( (rip = find_inode(fs_m_in->m_vfs_fs_chmod.inode)) == NULL) return(EINVAL);
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;
}