Skip to content

Commit 27496a8

Browse files
Al ViroLinus Torvalds
authored andcommitted
[PATCH] gfp_t: fs/*
- ->releasepage() annotated (s/int/gfp_t), instances updated - missing gfp_t in fs/* added - fixed misannotation from the original sweep caught by bitwise checks: XFS used __nocast both for gfp_t and for flags used by XFS allocator. The latter left with unsigned int __nocast; we might want to add a different type for those but for now let's leave them alone. That, BTW, is a case when __nocast use had been actively confusing - it had been used in the same code for two different and similar types, with no way to catch misuses. Switch of gfp_t to bitwise had caught that immediately... One tricky bit is left alone to be dealt with later - mapping->flags is a mix of gfp_t and error indications. Left alone for now. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
1 parent 7d877f3 commit 27496a8

25 files changed

Lines changed: 52 additions & 52 deletions

File tree

‎fs/afs/file.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ static int afs_file_release(struct inode *inode, struct file *file);
2929

3030
static int afs_file_readpage(struct file *file, struct page *page);
3131
static int afs_file_invalidatepage(struct page *page, unsigned long offset);
32-
static int afs_file_releasepage(struct page *page, int gfp_flags);
32+
static int afs_file_releasepage(struct page *page, gfp_t gfp_flags);
3333

3434
static ssize_t afs_file_write(struct file *file, const char __user *buf,
3535
size_t size, loff_t *off);
@@ -279,7 +279,7 @@ static int afs_file_invalidatepage(struct page *page, unsigned long offset)
279279
/*
280280
* release a page and cleanup its private data
281281
*/
282-
static int afs_file_releasepage(struct page *page, int gfp_flags)
282+
static int afs_file_releasepage(struct page *page, gfp_t gfp_flags)
283283
{
284284
struct cachefs_page *pageio;
285285

‎fs/bio.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,7 @@ static int bio_map_kern_endio(struct bio *bio, unsigned int bytes_done, int err)
778778

779779

780780
static struct bio *__bio_map_kern(request_queue_t *q, void *data,
781-
unsigned int len, unsigned int gfp_mask)
781+
unsigned int len, gfp_t gfp_mask)
782782
{
783783
unsigned long kaddr = (unsigned long)data;
784784
unsigned long end = (kaddr + len + PAGE_SIZE - 1) >> PAGE_SHIFT;
@@ -825,7 +825,7 @@ static struct bio *__bio_map_kern(request_queue_t *q, void *data,
825825
* device. Returns an error pointer in case of error.
826826
*/
827827
struct bio *bio_map_kern(request_queue_t *q, void *data, unsigned int len,
828-
unsigned int gfp_mask)
828+
gfp_t gfp_mask)
829829
{
830830
struct bio *bio;
831831

‎fs/buffer.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1571,7 +1571,7 @@ static inline void discard_buffer(struct buffer_head * bh)
15711571
*
15721572
* NOTE: @gfp_mask may go away, and this function may become non-blocking.
15731573
*/
1574-
int try_to_release_page(struct page *page, int gfp_mask)
1574+
int try_to_release_page(struct page *page, gfp_t gfp_mask)
15751575
{
15761576
struct address_space * const mapping = page->mapping;
15771577

‎fs/dcache.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@ void shrink_dcache_anon(struct hlist_head *head)
689689
*
690690
* In this case we return -1 to tell the caller that we baled.
691691
*/
692-
static int shrink_dcache_memory(int nr, unsigned int gfp_mask)
692+
static int shrink_dcache_memory(int nr, gfp_t gfp_mask)
693693
{
694694
if (nr) {
695695
if (!(gfp_mask & __GFP_FS))

‎fs/dquot.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ static void prune_dqcache(int count)
500500
* more memory
501501
*/
502502

503-
static int shrink_dqcache_memory(int nr, unsigned int gfp_mask)
503+
static int shrink_dqcache_memory(int nr, gfp_t gfp_mask)
504504
{
505505
if (nr) {
506506
spin_lock(&dq_list_lock);

‎fs/ext3/inode.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1434,7 +1434,7 @@ static int ext3_invalidatepage(struct page *page, unsigned long offset)
14341434
return journal_invalidatepage(journal, page, offset);
14351435
}
14361436

1437-
static int ext3_releasepage(struct page *page, int wait)
1437+
static int ext3_releasepage(struct page *page, gfp_t wait)
14381438
{
14391439
journal_t *journal = EXT3_JOURNAL(page->mapping->host);
14401440

‎fs/hfs/inode.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ static sector_t hfs_bmap(struct address_space *mapping, sector_t block)
4646
return generic_block_bmap(mapping, block, hfs_get_block);
4747
}
4848

49-
static int hfs_releasepage(struct page *page, int mask)
49+
static int hfs_releasepage(struct page *page, gfp_t mask)
5050
{
5151
struct inode *inode = page->mapping->host;
5252
struct super_block *sb = inode->i_sb;

‎fs/hfsplus/inode.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ static sector_t hfsplus_bmap(struct address_space *mapping, sector_t block)
4040
return generic_block_bmap(mapping, block, hfsplus_get_block);
4141
}
4242

43-
static int hfsplus_releasepage(struct page *page, int mask)
43+
static int hfsplus_releasepage(struct page *page, gfp_t mask)
4444
{
4545
struct inode *inode = page->mapping->host;
4646
struct super_block *sb = inode->i_sb;

‎fs/inode.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ static void prune_icache(int nr_to_scan)
475475
* This function is passed the number of inodes to scan, and it returns the
476476
* total number of remaining possibly-reclaimable inodes.
477477
*/
478-
static int shrink_icache_memory(int nr, unsigned int gfp_mask)
478+
static int shrink_icache_memory(int nr, gfp_t gfp_mask)
479479
{
480480
if (nr) {
481481
/*

‎fs/jbd/journal.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1606,7 +1606,7 @@ int journal_blocks_per_page(struct inode *inode)
16061606
* Simple support for retrying memory allocations. Introduced to help to
16071607
* debug different VM deadlock avoidance strategies.
16081608
*/
1609-
void * __jbd_kmalloc (const char *where, size_t size, int flags, int retry)
1609+
void * __jbd_kmalloc (const char *where, size_t size, gfp_t flags, int retry)
16101610
{
16111611
return kmalloc(size, flags | (retry ? __GFP_NOFAIL : 0));
16121612
}

0 commit comments

Comments
 (0)