linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joel Becker <Joel.Becker@oracle.com>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 43/58][v2] switch ocfs2 to ->evict_inode()
Date: Tue, 8 Jun 2010 18:53:26 -0700	[thread overview]
Message-ID: <20100609015326.GE6795@mail.oracle.com> (raw)
In-Reply-To: <20100609014418.GS31073@ZenIV.linux.org.uk>

On Wed, Jun 09, 2010 at 02:44:18AM +0100, Al Viro wrote:
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Acked-by: Joel Becker <joel.becker@oracle.com>

	Let me know when you push this to your next branch.  I want to
try and schedule some testing.

Joel

> diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c
> index abb0a95..eb7fd07 100644
> --- a/fs/ocfs2/inode.c
> +++ b/fs/ocfs2/inode.c
> @@ -969,7 +969,7 @@ static void ocfs2_cleanup_delete_inode(struct inode *inode,
>  	truncate_inode_pages(&inode->i_data, 0);
>  }
>  
> -void ocfs2_delete_inode(struct inode *inode)
> +static void ocfs2_delete_inode(struct inode *inode)
>  {
>  	int wipe, status;
>  	sigset_t oldset;
> @@ -1075,20 +1075,17 @@ bail_unlock_nfs_sync:
>  bail_unblock:
>  	ocfs2_unblock_signals(&oldset);
>  bail:
> -	clear_inode(inode);
>  	mlog_exit_void();
>  }
>  
> -void ocfs2_clear_inode(struct inode *inode)
> +static void ocfs2_clear_inode(struct inode *inode)
>  {
>  	int status;
>  	struct ocfs2_inode_info *oi = OCFS2_I(inode);
>  
>  	mlog_entry_void();
>  
> -	if (!inode)
> -		goto bail;
> -
> +	end_writeback(inode);
>  	mlog(0, "Clearing inode: %llu, nlink = %u\n",
>  	     (unsigned long long)OCFS2_I(inode)->ip_blkno, inode->i_nlink);
>  
> @@ -1180,10 +1177,20 @@ void ocfs2_clear_inode(struct inode *inode)
>  	jbd2_journal_release_jbd_inode(OCFS2_SB(inode->i_sb)->journal->j_journal,
>  				       &oi->ip_jinode);
>  
> -bail:
>  	mlog_exit_void();
>  }
>  
> +void ocfs2_evict_inode(struct inode *inode)
> +{
> +	if (!inode->i_nlink ||
> +	    (OCFS2_I(inode)->ip_flags & OCFS2_INODE_MAYBE_ORPHANED)) {
> +		ocfs2_delete_inode(inode);
> +	} else {
> +		truncate_inode_pages(&inode->i_data, 0);
> +	}
> +	ocfs2_clear_inode(inode);
> +}
> +
>  /* Called under inode_lock, with no more references on the
>   * struct inode, so it's safe here to check the flags field
>   * and to manipulate i_nlink without any other locks. */
> diff --git a/fs/ocfs2/inode.h b/fs/ocfs2/inode.h
> index 9f5f5fc..975eedd 100644
> --- a/fs/ocfs2/inode.h
> +++ b/fs/ocfs2/inode.h
> @@ -123,8 +123,7 @@ static inline struct ocfs2_caching_info *INODE_CACHE(struct inode *inode)
>  	return &OCFS2_I(inode)->ip_metadata_cache;
>  }
>  
> -void ocfs2_clear_inode(struct inode *inode);
> -void ocfs2_delete_inode(struct inode *inode);
> +void ocfs2_evict_inode(struct inode *inode);
>  void ocfs2_drop_inode(struct inode *inode);
>  
>  /* Flags for ocfs2_iget() */
> diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
> index 0eaa929..ae1a443 100644
> --- a/fs/ocfs2/super.c
> +++ b/fs/ocfs2/super.c
> @@ -145,8 +145,7 @@ static const struct super_operations ocfs2_sops = {
>  	.alloc_inode	= ocfs2_alloc_inode,
>  	.destroy_inode	= ocfs2_destroy_inode,
>  	.drop_inode	= ocfs2_drop_inode,
> -	.clear_inode	= ocfs2_clear_inode,
> -	.delete_inode	= ocfs2_delete_inode,
> +	.evict_inode	= ocfs2_evict_inode,
>  	.sync_fs	= ocfs2_sync_fs,
>  	.put_super	= ocfs2_put_super,
>  	.remount_fs	= ocfs2_remount,
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

-- 

Life's Little Instruction Book #337

	"Reread your favorite book."

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker@oracle.com
Phone: (650) 506-8127

      reply	other threads:[~2010-06-09  1:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-08 22:22 [PATCH 43/58] switch ocfs2 to ->evict_inode() Al Viro
2010-06-09  0:17 ` Joel Becker
2010-06-09  1:19   ` Al Viro
2010-06-09  1:49     ` Al Viro
2010-06-09  1:44 ` [PATCH 43/58][v2] " Al Viro
2010-06-09  1:53   ` Joel Becker [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100609015326.GE6795@mail.oracle.com \
    --to=joel.becker@oracle.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=viro@ZenIV.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).