[PATCH 04/17] aio: Use i_private instead of mapping->private_data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <jack@xxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux