summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2004-01-18 18:06:44 -0800
committerLinus Torvalds <torvalds@home.osdl.org>2004-01-18 18:06:44 -0800
commitdf6a148fac03627157260808cbdcfc8f7d40b4c2 (patch)
tree0c9243df89a82ab45c6575a6bc49a5f6e6b294b2 /drivers
parent54df76626b6936f5c2d05b4da420e19c032a84ec (diff)
[PATCH] bdev: move i_mapping -> f_mapping conversions
From: viro@parcelfarce.linux.theplanet.co.uk <viro@parcelfarce.linux.theplanet.co.uk> More uses of ->i_mapping switched to uses of ->f_mapping - stuff that was not caught by the earlier f_mapping conversion.
Diffstat (limited to 'drivers')
-rw-r--r--drivers/block/loop.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 2d2491275654..5565110f8561 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -659,6 +659,7 @@ static int loop_set_fd(struct loop_device *lo, struct file *lo_file,
struct file *file;
struct inode *inode;
struct block_device *lo_device = NULL;
+ struct address_space *mapping;
unsigned lo_blocksize;
int lo_flags = 0;
int error;
@@ -675,7 +676,8 @@ static int loop_set_fd(struct loop_device *lo, struct file *lo_file,
if (!file)
goto out;
- inode = file->f_dentry->d_inode;
+ mapping = file->f_mapping;
+ inode = mapping->host;
if (!(file->f_mode & FMODE_WRITE))
lo_flags |= LO_FLAGS_READ_ONLY;
@@ -690,7 +692,7 @@ static int loop_set_fd(struct loop_device *lo, struct file *lo_file,
if (bdev_read_only(lo_device))
lo_flags |= LO_FLAGS_READ_ONLY;
} else if (S_ISREG(inode->i_mode)) {
- struct address_space_operations *aops = inode->i_mapping->a_ops;
+ struct address_space_operations *aops = mapping->a_ops;
/*
* If we can't read - sorry. If we only can't write - well,
* it's going to be read-only.
@@ -724,9 +726,8 @@ static int loop_set_fd(struct loop_device *lo, struct file *lo_file,
error = -EFBIG;
goto out_putf;
}
- lo->old_gfp_mask = mapping_gfp_mask(inode->i_mapping);
- mapping_set_gfp_mask(inode->i_mapping,
- lo->old_gfp_mask & ~(__GFP_IO|__GFP_FS));
+ lo->old_gfp_mask = mapping_gfp_mask(mapping);
+ mapping_set_gfp_mask(mapping, lo->old_gfp_mask & ~(__GFP_IO|__GFP_FS));
lo->lo_bio = lo->lo_biotail = NULL;