mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 11:46:19 +00:00
[PATCH] update filesystems for new delete_inode behavior
Update the file systems in fs/ implementing a delete_inode() callback to call truncate_inode_pages(). One implementation note: In developing this patch I put the calls to truncate_inode_pages() at the very top of those filesystems delete_inode() callbacks in order to retain the previous behavior. I'm guessing that some of those could probably be optimized. Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com> Acked-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Hugh Dickins <hugh@veritas.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
e85b565233
commit
fef266580e
20 changed files with 30 additions and 0 deletions
|
@ -255,6 +255,7 @@ void
|
||||||
affs_delete_inode(struct inode *inode)
|
affs_delete_inode(struct inode *inode)
|
||||||
{
|
{
|
||||||
pr_debug("AFFS: delete_inode(ino=%lu, nlink=%u)\n", inode->i_ino, inode->i_nlink);
|
pr_debug("AFFS: delete_inode(ino=%lu, nlink=%u)\n", inode->i_ino, inode->i_nlink);
|
||||||
|
truncate_inode_pages(&inode->i_data, 0);
|
||||||
inode->i_size = 0;
|
inode->i_size = 0;
|
||||||
if (S_ISREG(inode->i_mode))
|
if (S_ISREG(inode->i_mode))
|
||||||
affs_truncate(inode);
|
affs_truncate(inode);
|
||||||
|
|
|
@ -143,6 +143,8 @@ static void bfs_delete_inode(struct inode * inode)
|
||||||
|
|
||||||
dprintf("ino=%08lx\n", inode->i_ino);
|
dprintf("ino=%08lx\n", inode->i_ino);
|
||||||
|
|
||||||
|
truncate_inode_pages(&inode->i_data, 0);
|
||||||
|
|
||||||
if (inode->i_ino < BFS_ROOT_INO || inode->i_ino > info->si_lasti) {
|
if (inode->i_ino < BFS_ROOT_INO || inode->i_ino > info->si_lasti) {
|
||||||
printf("invalid ino=%08lx\n", inode->i_ino);
|
printf("invalid ino=%08lx\n", inode->i_ino);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -71,6 +71,8 @@ void ext2_put_inode(struct inode *inode)
|
||||||
*/
|
*/
|
||||||
void ext2_delete_inode (struct inode * inode)
|
void ext2_delete_inode (struct inode * inode)
|
||||||
{
|
{
|
||||||
|
truncate_inode_pages(&inode->i_data, 0);
|
||||||
|
|
||||||
if (is_bad_inode(inode))
|
if (is_bad_inode(inode))
|
||||||
goto no_delete;
|
goto no_delete;
|
||||||
EXT2_I(inode)->i_dtime = get_seconds();
|
EXT2_I(inode)->i_dtime = get_seconds();
|
||||||
|
|
|
@ -187,6 +187,8 @@ void ext3_delete_inode (struct inode * inode)
|
||||||
{
|
{
|
||||||
handle_t *handle;
|
handle_t *handle;
|
||||||
|
|
||||||
|
truncate_inode_pages(&inode->i_data, 0);
|
||||||
|
|
||||||
if (is_bad_inode(inode))
|
if (is_bad_inode(inode))
|
||||||
goto no_delete;
|
goto no_delete;
|
||||||
|
|
||||||
|
|
|
@ -335,6 +335,8 @@ EXPORT_SYMBOL(fat_build_inode);
|
||||||
|
|
||||||
static void fat_delete_inode(struct inode *inode)
|
static void fat_delete_inode(struct inode *inode)
|
||||||
{
|
{
|
||||||
|
truncate_inode_pages(&inode->i_data, 0);
|
||||||
|
|
||||||
if (!is_bad_inode(inode)) {
|
if (!is_bad_inode(inode)) {
|
||||||
inode->i_size = 0;
|
inode->i_size = 0;
|
||||||
fat_truncate(inode);
|
fat_truncate(inode);
|
||||||
|
|
|
@ -284,6 +284,7 @@ static struct inode *hostfs_alloc_inode(struct super_block *sb)
|
||||||
|
|
||||||
static void hostfs_delete_inode(struct inode *inode)
|
static void hostfs_delete_inode(struct inode *inode)
|
||||||
{
|
{
|
||||||
|
truncate_inode_pages(&inode->i_data, 0);
|
||||||
if(HOSTFS_I(inode)->fd != -1) {
|
if(HOSTFS_I(inode)->fd != -1) {
|
||||||
close_file(&HOSTFS_I(inode)->fd);
|
close_file(&HOSTFS_I(inode)->fd);
|
||||||
HOSTFS_I(inode)->fd = -1;
|
HOSTFS_I(inode)->fd = -1;
|
||||||
|
|
|
@ -284,6 +284,7 @@ void hpfs_write_if_changed(struct inode *inode)
|
||||||
|
|
||||||
void hpfs_delete_inode(struct inode *inode)
|
void hpfs_delete_inode(struct inode *inode)
|
||||||
{
|
{
|
||||||
|
truncate_inode_pages(&inode->i_data, 0);
|
||||||
lock_kernel();
|
lock_kernel();
|
||||||
hpfs_remove_fnode(inode->i_sb, inode->i_ino);
|
hpfs_remove_fnode(inode->i_sb, inode->i_ino);
|
||||||
unlock_kernel();
|
unlock_kernel();
|
||||||
|
|
|
@ -1744,6 +1744,7 @@ jffs_delete_inode(struct inode *inode)
|
||||||
D3(printk("jffs_delete_inode(): inode->i_ino == %lu\n",
|
D3(printk("jffs_delete_inode(): inode->i_ino == %lu\n",
|
||||||
inode->i_ino));
|
inode->i_ino));
|
||||||
|
|
||||||
|
truncate_inode_pages(&inode->i_data, 0);
|
||||||
lock_kernel();
|
lock_kernel();
|
||||||
inode->i_size = 0;
|
inode->i_size = 0;
|
||||||
inode->i_blocks = 0;
|
inode->i_blocks = 0;
|
||||||
|
|
|
@ -132,6 +132,8 @@ void jfs_delete_inode(struct inode *inode)
|
||||||
(JFS_IP(inode)->fileset != cpu_to_le32(FILESYSTEM_I)))
|
(JFS_IP(inode)->fileset != cpu_to_le32(FILESYSTEM_I)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
truncate_inode_pages(&inode->i_data, 0);
|
||||||
|
|
||||||
if (test_cflag(COMMIT_Freewmap, inode))
|
if (test_cflag(COMMIT_Freewmap, inode))
|
||||||
jfs_free_zero_link(inode);
|
jfs_free_zero_link(inode);
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,7 @@ static int minix_remount (struct super_block * sb, int * flags, char * data);
|
||||||
|
|
||||||
static void minix_delete_inode(struct inode *inode)
|
static void minix_delete_inode(struct inode *inode)
|
||||||
{
|
{
|
||||||
|
truncate_inode_pages(&inode->i_data, 0);
|
||||||
inode->i_size = 0;
|
inode->i_size = 0;
|
||||||
minix_truncate(inode);
|
minix_truncate(inode);
|
||||||
minix_free_inode(inode);
|
minix_free_inode(inode);
|
||||||
|
|
|
@ -286,6 +286,8 @@ ncp_iget(struct super_block *sb, struct ncp_entry_info *info)
|
||||||
static void
|
static void
|
||||||
ncp_delete_inode(struct inode *inode)
|
ncp_delete_inode(struct inode *inode)
|
||||||
{
|
{
|
||||||
|
truncate_inode_pages(&inode->i_data, 0);
|
||||||
|
|
||||||
if (S_ISDIR(inode->i_mode)) {
|
if (S_ISDIR(inode->i_mode)) {
|
||||||
DDPRINTK("ncp_delete_inode: put directory %ld\n", inode->i_ino);
|
DDPRINTK("ncp_delete_inode: put directory %ld\n", inode->i_ino);
|
||||||
}
|
}
|
||||||
|
|
|
@ -146,6 +146,8 @@ nfs_delete_inode(struct inode * inode)
|
||||||
{
|
{
|
||||||
dprintk("NFS: delete_inode(%s/%ld)\n", inode->i_sb->s_id, inode->i_ino);
|
dprintk("NFS: delete_inode(%s/%ld)\n", inode->i_sb->s_id, inode->i_ino);
|
||||||
|
|
||||||
|
truncate_inode_pages(&inode->i_data, 0);
|
||||||
|
|
||||||
nfs_wb_all(inode);
|
nfs_wb_all(inode);
|
||||||
/*
|
/*
|
||||||
* The following should never happen...
|
* The following should never happen...
|
||||||
|
|
|
@ -60,6 +60,8 @@ static void proc_delete_inode(struct inode *inode)
|
||||||
struct proc_dir_entry *de;
|
struct proc_dir_entry *de;
|
||||||
struct task_struct *tsk;
|
struct task_struct *tsk;
|
||||||
|
|
||||||
|
truncate_inode_pages(&inode->i_data, 0);
|
||||||
|
|
||||||
/* Let go of any associated process */
|
/* Let go of any associated process */
|
||||||
tsk = PROC_I(inode)->task;
|
tsk = PROC_I(inode)->task;
|
||||||
if (tsk)
|
if (tsk)
|
||||||
|
|
|
@ -63,6 +63,7 @@ int qnx4_sync_inode(struct inode *inode)
|
||||||
static void qnx4_delete_inode(struct inode *inode)
|
static void qnx4_delete_inode(struct inode *inode)
|
||||||
{
|
{
|
||||||
QNX4DEBUG(("qnx4: deleting inode [%lu]\n", (unsigned long) inode->i_ino));
|
QNX4DEBUG(("qnx4: deleting inode [%lu]\n", (unsigned long) inode->i_ino));
|
||||||
|
truncate_inode_pages(&inode->i_data, 0);
|
||||||
inode->i_size = 0;
|
inode->i_size = 0;
|
||||||
qnx4_truncate(inode);
|
qnx4_truncate(inode);
|
||||||
lock_kernel();
|
lock_kernel();
|
||||||
|
|
|
@ -33,6 +33,8 @@ void reiserfs_delete_inode(struct inode *inode)
|
||||||
2 * REISERFS_QUOTA_INIT_BLOCKS(inode->i_sb);
|
2 * REISERFS_QUOTA_INIT_BLOCKS(inode->i_sb);
|
||||||
struct reiserfs_transaction_handle th;
|
struct reiserfs_transaction_handle th;
|
||||||
|
|
||||||
|
truncate_inode_pages(&inode->i_data, 0);
|
||||||
|
|
||||||
reiserfs_write_lock(inode->i_sb);
|
reiserfs_write_lock(inode->i_sb);
|
||||||
|
|
||||||
/* The = 0 happens when we abort creating a new inode for some reason like lack of space.. */
|
/* The = 0 happens when we abort creating a new inode for some reason like lack of space.. */
|
||||||
|
|
|
@ -331,6 +331,7 @@ static void
|
||||||
smb_delete_inode(struct inode *ino)
|
smb_delete_inode(struct inode *ino)
|
||||||
{
|
{
|
||||||
DEBUG1("ino=%ld\n", ino->i_ino);
|
DEBUG1("ino=%ld\n", ino->i_ino);
|
||||||
|
truncate_inode_pages(&ino->i_data, 0);
|
||||||
lock_kernel();
|
lock_kernel();
|
||||||
if (smb_close(ino))
|
if (smb_close(ino))
|
||||||
PARANOIA("could not close inode %ld\n", ino->i_ino);
|
PARANOIA("could not close inode %ld\n", ino->i_ino);
|
||||||
|
|
|
@ -292,6 +292,7 @@ int sysv_sync_inode(struct inode * inode)
|
||||||
|
|
||||||
static void sysv_delete_inode(struct inode *inode)
|
static void sysv_delete_inode(struct inode *inode)
|
||||||
{
|
{
|
||||||
|
truncate_inode_pages(&inode->i_data, 0);
|
||||||
inode->i_size = 0;
|
inode->i_size = 0;
|
||||||
sysv_truncate(inode);
|
sysv_truncate(inode);
|
||||||
lock_kernel();
|
lock_kernel();
|
||||||
|
|
|
@ -87,6 +87,8 @@ static int udf_get_block(struct inode *, sector_t, struct buffer_head *, int);
|
||||||
*/
|
*/
|
||||||
void udf_delete_inode(struct inode * inode)
|
void udf_delete_inode(struct inode * inode)
|
||||||
{
|
{
|
||||||
|
truncate_inode_pages(&inode->i_data, 0);
|
||||||
|
|
||||||
if (is_bad_inode(inode))
|
if (is_bad_inode(inode))
|
||||||
goto no_delete;
|
goto no_delete;
|
||||||
|
|
||||||
|
|
|
@ -804,6 +804,7 @@ int ufs_sync_inode (struct inode *inode)
|
||||||
|
|
||||||
void ufs_delete_inode (struct inode * inode)
|
void ufs_delete_inode (struct inode * inode)
|
||||||
{
|
{
|
||||||
|
truncate_inode_pages(&inode->i_data, 0);
|
||||||
/*UFS_I(inode)->i_dtime = CURRENT_TIME;*/
|
/*UFS_I(inode)->i_dtime = CURRENT_TIME;*/
|
||||||
lock_kernel();
|
lock_kernel();
|
||||||
mark_inode_dirty(inode);
|
mark_inode_dirty(inode);
|
||||||
|
|
|
@ -666,6 +666,7 @@ static void shmem_delete_inode(struct inode *inode)
|
||||||
struct shmem_inode_info *info = SHMEM_I(inode);
|
struct shmem_inode_info *info = SHMEM_I(inode);
|
||||||
|
|
||||||
if (inode->i_op->truncate == shmem_truncate) {
|
if (inode->i_op->truncate == shmem_truncate) {
|
||||||
|
truncate_inode_pages(inode->i_mapping, 0);
|
||||||
shmem_unacct_size(info->flags, inode->i_size);
|
shmem_unacct_size(info->flags, inode->i_size);
|
||||||
inode->i_size = 0;
|
inode->i_size = 0;
|
||||||
shmem_truncate(inode);
|
shmem_truncate(inode);
|
||||||
|
|
Loading…
Reference in a new issue