INT32 FsMoveFile(struct inode *old_parent_inode, FILE_ID_T *fid, struct inode *new_parent_inode, struct dentry *new_dentry) { INT32 err; struct super_block *sb = old_parent_inode->i_sb; FS_INFO_T *p_fs = &(EXFAT_SB(sb)->fs_info); if (fid == NULL) return(FFS_INVALIDFID); sm_P(&(fs_struct[p_fs->drv].v_sem)); err = ffsMoveFile(old_parent_inode, fid, new_parent_inode, new_dentry); sm_V(&(fs_struct[p_fs->drv].v_sem)); return(err); }
/* FsMoveFile : move(rename) a old file into a new file */ INT32 FsMoveFile(struct inode *old_parent_inode, FILE_ID_T *fid, struct inode *new_parent_inode, struct dentry *new_dentry) { INT32 err; struct super_block *sb = old_parent_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); /* acquire the lock for file system critical section */ sm_P(&(fs_struct[p_fs->drv].v_sem)); err = ffsMoveFile(old_parent_inode, fid, new_parent_inode, new_dentry); /* release the lock for file system critical section */ sm_V(&(fs_struct[p_fs->drv].v_sem)); return(err); } /* end of FsMoveFile */