Skip to content

Commit da6d503

Browse files
Trond MyklebustTrond Myklebust
authored andcommitted
NFS: Remove nfs_delete_inode()
Now that we have a real nfs_invalidate_page() to ensure that truncate_inode_pages() does the right thing when there are pending dirty pages, we can get rid of nfs_delete_inode(). Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
1 parent d2ccddf commit da6d503

1 file changed

Lines changed: 4 additions & 22 deletions

File tree

‎fs/nfs/inode.c‎

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ static int nfs_update_inode(struct inode *, struct nfs_fattr *);
6262
static struct inode *nfs_alloc_inode(struct super_block *sb);
6363
static void nfs_destroy_inode(struct inode *);
6464
static int nfs_write_inode(struct inode *,int);
65-
static void nfs_delete_inode(struct inode *);
6665
static void nfs_clear_inode(struct inode *);
6766
static void nfs_umount_begin(struct super_block *);
6867
static int nfs_statfs(struct super_block *, struct kstatfs *);
@@ -76,7 +75,6 @@ static struct super_operations nfs_sops = {
7675
.alloc_inode = nfs_alloc_inode,
7776
.destroy_inode = nfs_destroy_inode,
7877
.write_inode = nfs_write_inode,
79-
.delete_inode = nfs_delete_inode,
8078
.statfs = nfs_statfs,
8179
.clear_inode = nfs_clear_inode,
8280
.umount_begin = nfs_umount_begin,
@@ -146,31 +144,16 @@ nfs_write_inode(struct inode *inode, int sync)
146144
return 0;
147145
}
148146

149-
static void
150-
nfs_delete_inode(struct inode * inode)
151-
{
152-
dprintk("NFS: delete_inode(%s/%ld)\n", inode->i_sb->s_id, inode->i_ino);
153-
154-
truncate_inode_pages(&inode->i_data, 0);
155-
156-
nfs_wb_all(inode);
157-
/*
158-
* The following should never happen...
159-
*/
160-
if (nfs_have_writebacks(inode)) {
161-
printk(KERN_ERR "nfs_delete_inode: inode %ld has pending RPC requests\n", inode->i_ino);
162-
}
163-
164-
clear_inode(inode);
165-
}
166-
167147
static void
168148
nfs_clear_inode(struct inode *inode)
169149
{
170150
struct nfs_inode *nfsi = NFS_I(inode);
171151
struct rpc_cred *cred;
172152

173-
nfs_wb_all(inode);
153+
/*
154+
* The following should never happen...
155+
*/
156+
BUG_ON(nfs_have_writebacks(inode));
174157
BUG_ON (!list_empty(&nfsi->open_files));
175158
nfs_zap_acl_cache(inode);
176159
cred = nfsi->cache_access.cred;
@@ -1821,7 +1804,6 @@ static struct super_operations nfs4_sops = {
18211804
.alloc_inode = nfs_alloc_inode,
18221805
.destroy_inode = nfs_destroy_inode,
18231806
.write_inode = nfs_write_inode,
1824-
.delete_inode = nfs_delete_inode,
18251807
.statfs = nfs_statfs,
18261808
.clear_inode = nfs4_clear_inode,
18271809
.umount_begin = nfs_umount_begin,

0 commit comments

Comments
 (0)