void udf_free_inode(struct inode * inode) { struct super_block *sb = inode->i_sb; struct udf_sb_info *sbi = UDF_SB(sb); /* * Note: we must free any quota before locking the superblock, * as writing the quota to disk may need the lock as well. */ DQUOT_FREE_INODE(inode); DQUOT_DROP(inode); clear_inode(inode); lock_udf_alloc_sem(sbi); if (sbi->s_lvidbh) { if (S_ISDIR(inode->i_mode)) UDF_SB_LVIDIU(sb)->numDirs = cpu_to_le32(le32_to_cpu(UDF_SB_LVIDIU(sb)->numDirs) - 1); else UDF_SB_LVIDIU(sb)->numFiles = cpu_to_le32(le32_to_cpu(UDF_SB_LVIDIU(sb)->numFiles) - 1); mark_buffer_dirty(sbi->s_lvidbh); } unlock_udf_alloc_sem(sbi); udf_free_blocks(sb, NULL, UDF_I_LOCATION(inode), 0, 1); }
void udf_free_inode(struct inode *inode) { struct super_block *sb = inode->i_sb; struct udf_sb_info *sbi = UDF_SB(sb); /* * Note: we must free any quota before locking the superblock, * as writing the quota to disk may need the lock as well. */ DQUOT_FREE_INODE(inode); DQUOT_DROP(inode); clear_inode(inode); mutex_lock(&sbi->s_alloc_mutex); if (sbi->s_lvid_bh) { struct logicalVolIntegrityDescImpUse *lvidiu = udf_sb_lvidiu(sbi); if (S_ISDIR(inode->i_mode)) le32_add_cpu(&lvidiu->numDirs, -1); else le32_add_cpu(&lvidiu->numFiles, -1); mark_buffer_dirty(sbi->s_lvid_bh); } mutex_unlock(&sbi->s_alloc_mutex); udf_free_blocks(sb, NULL, UDF_I(inode)->i_location, 0, 1); }
void udf_free_inode(struct inode *inode) { struct super_block *sb = inode->i_sb; struct udf_sb_info *sbi = UDF_SB(sb); struct logicalVolIntegrityDescImpUse *lvidiu = udf_sb_lvidiu(sb); if (lvidiu) { mutex_lock(&sbi->s_alloc_mutex); if (S_ISDIR(inode->i_mode)) le32_add_cpu(&lvidiu->numDirs, -1); else le32_add_cpu(&lvidiu->numFiles, -1); udf_updated_lvid(sb); mutex_unlock(&sbi->s_alloc_mutex); } udf_free_blocks(sb, NULL, &UDF_I(inode)->i_location, 0, 1); }
void udf_free_inode(struct inode * inode) { struct super_block * sb = inode->i_sb; int is_directory; unsigned long ino; ino = inode->i_ino; /* * Note: we must free any quota before locking the superblock, * as writing the quota to disk may need the lock as well. */ DQUOT_FREE_INODE(inode); DQUOT_DROP(inode); lock_super(sb); is_directory = S_ISDIR(inode->i_mode); clear_inode(inode); if (UDF_SB_LVIDBH(sb)) { if (is_directory) UDF_SB_LVIDIU(sb)->numDirs = cpu_to_le32(le32_to_cpu(UDF_SB_LVIDIU(sb)->numDirs) - 1); else UDF_SB_LVIDIU(sb)->numFiles = cpu_to_le32(le32_to_cpu(UDF_SB_LVIDIU(sb)->numFiles) - 1); mark_buffer_dirty(UDF_SB_LVIDBH(sb)); } unlock_super(sb); udf_free_blocks(sb, NULL, UDF_I_LOCATION(inode), 0, 1); }