* [PATCH 44/58] switch gfs2 to ->evict_inode()
@ 2010-06-08 22:22 Al Viro
2010-06-09 9:28 ` Steven Whitehouse
0 siblings, 1 reply; 2+ messages in thread
From: Al Viro @ 2010-06-08 22:22 UTC (permalink / raw)
To: linux-fsdevel
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
fs/gfs2/super.c | 39 +++++++++++++++------------------------
1 files changed, 15 insertions(+), 24 deletions(-)
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c
index 4d1aad3..555f5a4 100644
--- a/fs/gfs2/super.c
+++ b/fs/gfs2/super.c
@@ -1203,25 +1203,6 @@ static void gfs2_drop_inode(struct inode *inode)
generic_drop_inode(inode);
}
-/**
- * gfs2_clear_inode - Deallocate an inode when VFS is done with it
- * @inode: The VFS inode
- *
- */
-
-static void gfs2_clear_inode(struct inode *inode)
-{
- struct gfs2_inode *ip = GFS2_I(inode);
-
- ip->i_gl->gl_object = NULL;
- gfs2_glock_put(ip->i_gl);
- ip->i_gl = NULL;
- if (ip->i_iopen_gh.gh_gl) {
- ip->i_iopen_gh.gh_gl->gl_object = NULL;
- gfs2_glock_dq_uninit(&ip->i_iopen_gh);
- }
-}
-
static int is_ancestor(const struct dentry *d1, const struct dentry *d2)
{
do {
@@ -1347,13 +1328,16 @@ static int gfs2_show_options(struct seq_file *s, struct vfsmount *mnt)
* is safe, just less efficient.
*/
-static void gfs2_delete_inode(struct inode *inode)
+static void gfs2_evict_inode(struct inode *inode)
{
struct gfs2_sbd *sdp = inode->i_sb->s_fs_info;
struct gfs2_inode *ip = GFS2_I(inode);
struct gfs2_holder gh;
int error;
+ if (inode->i_nlink)
+ goto out;
+
error = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &gh);
if (unlikely(error)) {
gfs2_glock_dq_uninit(&ip->i_iopen_gh);
@@ -1407,10 +1391,18 @@ out_unlock:
gfs2_holder_uninit(&ip->i_iopen_gh);
gfs2_glock_dq_uninit(&gh);
if (error && error != GLR_TRYFAILED && error != -EROFS)
- fs_warn(sdp, "gfs2_delete_inode: %d\n", error);
+ fs_warn(sdp, "gfs2_evict_inode: %d\n", error);
out:
truncate_inode_pages(&inode->i_data, 0);
- clear_inode(inode);
+ end_writeback(inode);
+
+ ip->i_gl->gl_object = NULL;
+ gfs2_glock_put(ip->i_gl);
+ ip->i_gl = NULL;
+ if (ip->i_iopen_gh.gh_gl) {
+ ip->i_iopen_gh.gh_gl->gl_object = NULL;
+ gfs2_glock_dq_uninit(&ip->i_iopen_gh);
+ }
}
static struct inode *gfs2_alloc_inode(struct super_block *sb)
@@ -1434,14 +1426,13 @@ const struct super_operations gfs2_super_ops = {
.alloc_inode = gfs2_alloc_inode,
.destroy_inode = gfs2_destroy_inode,
.write_inode = gfs2_write_inode,
- .delete_inode = gfs2_delete_inode,
+ .evict_inode = gfs2_evict_inode,
.put_super = gfs2_put_super,
.sync_fs = gfs2_sync_fs,
.freeze_fs = gfs2_freeze,
.unfreeze_fs = gfs2_unfreeze,
.statfs = gfs2_statfs,
.remount_fs = gfs2_remount_fs,
- .clear_inode = gfs2_clear_inode,
.drop_inode = gfs2_drop_inode,
.show_options = gfs2_show_options,
};
--
1.5.6.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 44/58] switch gfs2 to ->evict_inode()
2010-06-08 22:22 [PATCH 44/58] switch gfs2 to ->evict_inode() Al Viro
@ 2010-06-09 9:28 ` Steven Whitehouse
0 siblings, 0 replies; 2+ messages in thread
From: Steven Whitehouse @ 2010-06-09 9:28 UTC (permalink / raw)
To: Al Viro; +Cc: linux-fsdevel
Hi,
This looks ok for GFS2 to me. Also the drop_inode changes, so:
Acked-by: Steven Whitehouse <swhiteho@redhat.com>
for both,
Steve.
On Tue, 2010-06-08 at 23:22 +0100, Al Viro wrote:
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
> ---
> fs/gfs2/super.c | 39 +++++++++++++++------------------------
> 1 files changed, 15 insertions(+), 24 deletions(-)
>
> diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c
> index 4d1aad3..555f5a4 100644
> --- a/fs/gfs2/super.c
> +++ b/fs/gfs2/super.c
> @@ -1203,25 +1203,6 @@ static void gfs2_drop_inode(struct inode *inode)
> generic_drop_inode(inode);
> }
>
> -/**
> - * gfs2_clear_inode - Deallocate an inode when VFS is done with it
> - * @inode: The VFS inode
> - *
> - */
> -
> -static void gfs2_clear_inode(struct inode *inode)
> -{
> - struct gfs2_inode *ip = GFS2_I(inode);
> -
> - ip->i_gl->gl_object = NULL;
> - gfs2_glock_put(ip->i_gl);
> - ip->i_gl = NULL;
> - if (ip->i_iopen_gh.gh_gl) {
> - ip->i_iopen_gh.gh_gl->gl_object = NULL;
> - gfs2_glock_dq_uninit(&ip->i_iopen_gh);
> - }
> -}
> -
> static int is_ancestor(const struct dentry *d1, const struct dentry *d2)
> {
> do {
> @@ -1347,13 +1328,16 @@ static int gfs2_show_options(struct seq_file *s, struct vfsmount *mnt)
> * is safe, just less efficient.
> */
>
> -static void gfs2_delete_inode(struct inode *inode)
> +static void gfs2_evict_inode(struct inode *inode)
> {
> struct gfs2_sbd *sdp = inode->i_sb->s_fs_info;
> struct gfs2_inode *ip = GFS2_I(inode);
> struct gfs2_holder gh;
> int error;
>
> + if (inode->i_nlink)
> + goto out;
> +
> error = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &gh);
> if (unlikely(error)) {
> gfs2_glock_dq_uninit(&ip->i_iopen_gh);
> @@ -1407,10 +1391,18 @@ out_unlock:
> gfs2_holder_uninit(&ip->i_iopen_gh);
> gfs2_glock_dq_uninit(&gh);
> if (error && error != GLR_TRYFAILED && error != -EROFS)
> - fs_warn(sdp, "gfs2_delete_inode: %d\n", error);
> + fs_warn(sdp, "gfs2_evict_inode: %d\n", error);
> out:
> truncate_inode_pages(&inode->i_data, 0);
> - clear_inode(inode);
> + end_writeback(inode);
> +
> + ip->i_gl->gl_object = NULL;
> + gfs2_glock_put(ip->i_gl);
> + ip->i_gl = NULL;
> + if (ip->i_iopen_gh.gh_gl) {
> + ip->i_iopen_gh.gh_gl->gl_object = NULL;
> + gfs2_glock_dq_uninit(&ip->i_iopen_gh);
> + }
> }
>
> static struct inode *gfs2_alloc_inode(struct super_block *sb)
> @@ -1434,14 +1426,13 @@ const struct super_operations gfs2_super_ops = {
> .alloc_inode = gfs2_alloc_inode,
> .destroy_inode = gfs2_destroy_inode,
> .write_inode = gfs2_write_inode,
> - .delete_inode = gfs2_delete_inode,
> + .evict_inode = gfs2_evict_inode,
> .put_super = gfs2_put_super,
> .sync_fs = gfs2_sync_fs,
> .freeze_fs = gfs2_freeze,
> .unfreeze_fs = gfs2_unfreeze,
> .statfs = gfs2_statfs,
> .remount_fs = gfs2_remount_fs,
> - .clear_inode = gfs2_clear_inode,
> .drop_inode = gfs2_drop_inode,
> .show_options = gfs2_show_options,
> };
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-06-09 10:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-08 22:22 [PATCH 44/58] switch gfs2 to ->evict_inode() Al Viro
2010-06-09 9:28 ` Steven Whitehouse
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).