From: Jan Kara Subject: [PATCH 04/17] aio: Use i_private instead of mapping->private_data Date: Fri, 2 May 2014 15:19:55 +0200 Message-ID: <1399036808-24521-5-git-send-email-jack@suse.cz> References: <1399036808-24521-1-git-send-email-jack@suse.cz> Cc: Al Viro , Jan Kara To: linux-fsdevel@vger.kernel.org Return-path: Received: from cantor2.suse.de ([195.135.220.15]:53364 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752465AbaEBNUN (ORCPT ); Fri, 2 May 2014 09:20:13 -0400 In-Reply-To: <1399036808-24521-1-git-send-email-jack@suse.cz> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Use inode->i_private to store pointer to aio context instead of inode->i_mapping->private_data as that's going away. Signed-off-by: Jan Kara --- fs/aio.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/fs/aio.c b/fs/aio.c index 062a5f6a1448..a906e5f4b688 100644 --- a/fs/aio.c +++ b/fs/aio.c @@ -168,7 +168,7 @@ static struct file *aio_private_file(struct kioctx *ctx, loff_t nr_pages) return ERR_CAST(inode); inode->i_mapping->a_ops = &aio_ctx_aops; - inode->i_mapping->private_data = ctx; + inode->i_private = ctx; inode->i_size = PAGE_SIZE * nr_pages; path.dentry = d_alloc_pseudo(aio_mnt->mnt_sb, &this); @@ -231,7 +231,7 @@ static void put_aio_ring_file(struct kioctx *ctx) /* Prevent further access to the kioctx from migratepages */ spin_lock(&aio_ring_file->f_inode->i_mapping->private_lock); - aio_ring_file->f_inode->i_mapping->private_data = NULL; + aio_ring_file->f_inode->i_private = NULL; ctx->aio_ring_file = NULL; spin_unlock(&aio_ring_file->f_inode->i_mapping->private_lock); @@ -289,7 +289,7 @@ static int aio_migratepage(struct address_space *mapping, struct page *new, /* Make sure the old page hasn't already been changed */ spin_lock(&mapping->private_lock); - ctx = mapping->private_data; + ctx = mapping->host->i_private; if (ctx) { pgoff_t idx; spin_lock_irqsave(&ctx->completion_lock, flags); @@ -318,11 +318,10 @@ static int aio_migratepage(struct address_space *mapping, struct page *new, } /* We can potentially race against kioctx teardown here. Use the - * address_space's private data lock to protect the mapping's - * private_data. + * address_space's private data lock to protect inode's i_private. */ spin_lock(&mapping->private_lock); - ctx = mapping->private_data; + ctx = mapping->host->i_private; if (ctx) { pgoff_t idx; spin_lock_irqsave(&ctx->completion_lock, flags); -- 1.8.1.4