Пример #1
0
INT32 FsWriteFile(struct inode *inode, FILE_ID_T *fid, void *buffer, UINT64 count, UINT64 *wcount)
{
	INT32 err;
	struct super_block *sb = inode->i_sb;
	FS_INFO_T *p_fs = &(EXFAT_SB(sb)->fs_info);

	if (fid == NULL) return(FFS_INVALIDFID);

	if (buffer == NULL) return(FFS_ERROR);

	sm_P(&(fs_struct[p_fs->drv].v_sem));

	err = ffsWriteFile(inode, fid, buffer, count, wcount);

	sm_V(&(fs_struct[p_fs->drv].v_sem));

	return(err);
}
Пример #2
0
INT32 FsWriteFile(struct inode *inode, FILE_ID_T *fid, void *buffer, UINT64 count, UINT64 *wcount)
{
	INT32 err;
	struct super_block *sb = inode->i_sb;
	FS_INFO_T *p_fs = &(EXFAT_SB(sb)->fs_info);

	/* check the validity of the given file id */
	if (fid == NULL) return(FFS_INVALIDFID);

	/* check the validity of pointer parameters */
	if (buffer == NULL) return(FFS_ERROR);

	/* acquire the lock for file system critical section */
	sm_P(&(fs_struct[p_fs->drv].v_sem));

	err = ffsWriteFile(inode, fid, buffer, count, wcount);

	/* release the lock for file system critical section */
	sm_V(&(fs_struct[p_fs->drv].v_sem));

	return(err);
} /* end of FsWriteFile */