Make the mpage read functions take a credentials pointer.
Signed-off-by: David Howells <[email protected]>
---
fs/ext3/inode.c | 5 +++--
fs/fat/inode.c | 5 +++--
fs/mpage.c | 12 ++++++------
include/linux/mpage.h | 5 +++--
4 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c
index a7ef05c..70e9e6f 100644
--- a/fs/ext3/inode.c
+++ b/fs/ext3/inode.c
@@ -1582,14 +1582,15 @@ out_unlock:
static int ext3_readpage(struct file *file, struct page *page)
{
- return mpage_readpage(page, ext3_get_block);
+ return mpage_readpage(page, ext3_get_block, file->f_cred);
}
static int
ext3_readpages(struct file *file, struct address_space *mapping,
struct list_head *pages, unsigned nr_pages)
{
- return mpage_readpages(mapping, pages, nr_pages, ext3_get_block);
+ return mpage_readpages(mapping, pages, nr_pages, ext3_get_block,
+ file->f_cred);
}
static void ext3_invalidatepage(struct page *page, unsigned long offset)
diff --git a/fs/fat/inode.c b/fs/fat/inode.c
index 43c6f4a..2745ce2 100644
--- a/fs/fat/inode.c
+++ b/fs/fat/inode.c
@@ -133,13 +133,14 @@ static int fat_writepages(struct address_space *mapping,
static int fat_readpage(struct file *file, struct page *page)
{
- return mpage_readpage(page, fat_get_block);
+ return mpage_readpage(page, fat_get_block, file->f_cred);
}
static int fat_readpages(struct file *file, struct address_space *mapping,
struct list_head *pages, unsigned nr_pages)
{
- return mpage_readpages(mapping, pages, nr_pages, fat_get_block);
+ return mpage_readpages(mapping, pages, nr_pages, fat_get_block,
+ file->f_cred);
}
static int fat_prepare_write(struct file *file, struct page *page,
diff --git a/fs/mpage.c b/fs/mpage.c
index 7fc2dce..af97410 100644
--- a/fs/mpage.c
+++ b/fs/mpage.c
@@ -167,9 +167,9 @@ map_buffer_to_page(struct page *page, struct buffer_head *bh, int page_block)
static struct bio *
do_mpage_readpage(struct bio *bio, struct page *page, unsigned nr_pages,
sector_t *last_block_in_bio, struct buffer_head *map_bh,
- unsigned long *first_logical_block, get_block_t get_block)
+ unsigned long *first_logical_block, get_block_t get_block,
+ struct cred *cred)
{
- struct cred *cred = current->cred;
struct inode *inode = page->mapping->host;
const unsigned blkbits = inode->i_blkbits;
const unsigned blocks_per_page = PAGE_CACHE_SIZE >> blkbits;
@@ -375,7 +375,7 @@ confused:
*/
int
mpage_readpages(struct address_space *mapping, struct list_head *pages,
- unsigned nr_pages, get_block_t get_block)
+ unsigned nr_pages, get_block_t get_block, struct cred *cred)
{
struct bio *bio = NULL;
unsigned page_idx;
@@ -397,7 +397,7 @@ mpage_readpages(struct address_space *mapping, struct list_head *pages,
nr_pages - page_idx,
&last_block_in_bio, &map_bh,
&first_logical_block,
- get_block);
+ get_block, cred);
if (!pagevec_add(&lru_pvec, page))
__pagevec_lru_add(&lru_pvec);
} else {
@@ -415,7 +415,7 @@ EXPORT_SYMBOL(mpage_readpages);
/*
* This isn't called much at all
*/
-int mpage_readpage(struct page *page, get_block_t get_block)
+int mpage_readpage(struct page *page, get_block_t get_block, struct cred *cred)
{
struct bio *bio = NULL;
sector_t last_block_in_bio = 0;
@@ -424,7 +424,7 @@ int mpage_readpage(struct page *page, get_block_t get_block)
clear_buffer_mapped(&map_bh);
bio = do_mpage_readpage(bio, page, 1, &last_block_in_bio,
- &map_bh, &first_logical_block, get_block);
+ &map_bh, &first_logical_block, get_block, cred);
if (bio)
mpage_bio_submit(READ, bio);
return 0;
diff --git a/include/linux/mpage.h b/include/linux/mpage.h
index 068a0c9..5235842 100644
--- a/include/linux/mpage.h
+++ b/include/linux/mpage.h
@@ -14,8 +14,9 @@
struct writeback_control;
int mpage_readpages(struct address_space *mapping, struct list_head *pages,
- unsigned nr_pages, get_block_t get_block);
-int mpage_readpage(struct page *page, get_block_t get_block);
+ unsigned nr_pages, get_block_t get_block,
+ struct cred *cred);
+int mpage_readpage(struct page *page, get_block_t get_block, struct cred *cred);
int mpage_writepages(struct address_space *mapping,
struct writeback_control *wbc, get_block_t get_block);
int mpage_writepage(struct page *page, get_block_t *get_block,
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]