INT32 FsLookupFile(struct inode *inode, UINT8 *path, FILE_ID_T *fid) { INT32 err; struct super_block *sb = inode->i_sb; FS_INFO_T *p_fs = &(EXFAT_SB(sb)->fs_info); if ((fid == NULL) || (path == NULL) || (STRLEN(path) == 0)) return(FFS_ERROR); sm_P(&(fs_struct[p_fs->drv].v_sem)); err = ffsLookupFile(inode, path, fid); sm_V(&(fs_struct[p_fs->drv].v_sem)); return(err); }
/* FsCreateFile : create a file */ INT32 FsLookupFile(struct inode *inode, UINT8 *path, FILE_ID_T *fid) { INT32 err; struct super_block *sb = inode->i_sb; FS_INFO_T *p_fs = &(EXFAT_SB(sb)->fs_info); /* check the validity of pointer parameters */ if ((fid == NULL) || (path == NULL) || (STRLEN(path) == 0)) return(FFS_ERROR); /* acquire the lock for file system critical section */ sm_P(&(fs_struct[p_fs->drv].v_sem)); err = ffsLookupFile(inode, path, fid); /* release the lock for file system critical section */ sm_V(&(fs_struct[p_fs->drv].v_sem)); return(err); } /* end of FsLookupFile */
/* FsCreateFile : create a file */ int FsLookupFile(struct inode *inode, char *path, FILE_ID_T *fid) { int err; struct super_block *sb = inode->i_sb; FS_INFO_T *p_fs = &(EXFAT_SB(sb)->fs_info); /* check the validity of pointer parameters */ if ((fid == NULL) || (path == NULL) || (*path == '\0')) return FFS_ERROR; /* acquire the lock for file system critical section */ sm_P(&p_fs->v_sem); err = ffsLookupFile(inode, path, fid); /* release the lock for file system critical section */ sm_V(&p_fs->v_sem); return err; } /* end of FsLookupFile */