aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRasmus Villemoes <linux@rasmusvillemoes.dk>2016-09-14 18:25:03 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2016-09-27 21:45:46 -0400
commitde04e76935ad5985d318fbce298a17e9dd2092b7 (patch)
tree6f334950fb361d3e1fe57dd264e66876887d3ac8
parentbe218aa2e3f7aa698cdce5a4efb1e178677db8fd (diff)
fs/aio.c: eliminate redundant loads in put_aio_ring_file
Using a local variable we can prevent gcc from reloading aio_ring_file->f_inode->i_mapping twice, eliminating 2x2 dependent loads. Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--fs/aio.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/aio.c b/fs/aio.c
index 4fe81d1c60f9..1157e13a36d6 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -274,14 +274,17 @@ __initcall(aio_setup);
274static void put_aio_ring_file(struct kioctx *ctx) 274static void put_aio_ring_file(struct kioctx *ctx)
275{ 275{
276 struct file *aio_ring_file = ctx->aio_ring_file; 276 struct file *aio_ring_file = ctx->aio_ring_file;
277 struct address_space *i_mapping;
278
277 if (aio_ring_file) { 279 if (aio_ring_file) {
278 truncate_setsize(aio_ring_file->f_inode, 0); 280 truncate_setsize(aio_ring_file->f_inode, 0);
279 281
280 /* Prevent further access to the kioctx from migratepages */ 282 /* Prevent further access to the kioctx from migratepages */
281 spin_lock(&aio_ring_file->f_inode->i_mapping->private_lock); 283 i_mapping = aio_ring_file->f_inode->i_mapping;
282 aio_ring_file->f_inode->i_mapping->private_data = NULL; 284 spin_lock(&i_mapping->private_lock);
285 i_mapping->private_data = NULL;
283 ctx->aio_ring_file = NULL; 286 ctx->aio_ring_file = NULL;
284 spin_unlock(&aio_ring_file->f_inode->i_mapping->private_lock); 287 spin_unlock(&i_mapping->private_lock);
285 288
286 fput(aio_ring_file); 289 fput(aio_ring_file);
287 } 290 }