minix/servers/pfs/misc.c

29 lines
978 B
C
Raw Normal View History

2009-12-20 21:41:50 +01:00
#include "fs.h"
#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 */
}
/*===========================================================================*
* fs_chmod *
*===========================================================================*/
int fs_chmod(message *fs_m_in, message *fs_m_out)
{
struct inode *rip; /* target inode */
mode_t mode = (mode_t) fs_m_in->REQ_MODE;
if( (rip = find_inode(fs_m_in->REQ_INODE_NR)) == 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;
}