Skip to content

fs: cleanup single page synchronous read interface

Nate Diller linux-fsdevel lkml 1 version In review

Get series with b4
b4 am 20070412024938.27380.54538.patchbomb.py@localhost

Versions newest first

  1. v1 Latest17 patches 15 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/17cramfs: use read_mapping_pagefs/cramfs/inode.c+1 -23 replies
2/17fs: introduce new read_cache_page interfaceinclude/linux/pagemap.h mm/filemap.c+74 -970 replies
3/17afs: convert afs_dir_get_page to read_kmap_pagefs/afs/dir.c fs/afs/mntpt.c+14 -528 replies
4/17ext2: convert ext2_get_page to read_kmap_pagefs/ext2/dir.c+34 -480 replies
5/17hfsplus: remove redundant read_mapping_page error checkfs/hfsplus/bnode.c+0 -40 replies
6/17hfs: remove redundant read_mapping_page error checkfs/hfs/bnode.c+0 -40 replies
7/17jffs2: convert jffs2_gc_fetch_page to read_cache_pagefs/jffs2/fs.c fs/jffs2/gc.c+10 -324 replies
8/17jfs: use locking read_mapping_pagefs/jfs/jfs_metapage.c+2 -30 replies
9/17minix: convert dir_get_page to read_kmap_pagefs/minix/dir.c+17 -420 replies
10/17mtd: convert page_read to read_kmap_pagedrivers/mtd/devices/block2mtd.c+6 -220 replies
11/17ntfs: convert ntfs_map_page to read_kmap_pagefs/ntfs/aops.h fs/ntfs/bitmap.c fs/ntfs/dir.c +6 more+84 -1810 replies
12/17partition: remove redundant read_mapping_page error checksfs/partitions/check.c+5 -90 replies
13/17reiser4: remove redundant read_mapping_page error checksfs/reiser4/plugin/file/tail_conversion.c fs/reiser4/plugin/item/extent_file_ops.c+1 -160 replies
14/17reiserfs: convert reiserfs_get_page to read_kmap_pagefs/reiserfs/xattr.c+11 -370 replies
15/17sysv: convert dir_get_page to read_kmap_pagefs/sysv/dir.c+5 -140 replies
16/17ufs: convert ufs_get_page to read_kmap_pagefs/ufs/balloc.c fs/ufs/dir.c fs/ufs/truncate.c +2 more+48 -1200 replies
17/17vxfs: convert vxfs_get_page to read_kmap_pagefs/freevxfs/vxfs_extern.h fs/freevxfs/vxfs_inode.c fs/freevxfs/vxfs_lookup.c +1 more+3 -370 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/17] fs: cleanup single page synchronous read interface

Nick Piggin recently changed the read_cache_page interface to be synchronous, which is pretty much what the file systems want anyway. Turns out that they have more in common than that, though, and some of them want to be able to get an uptodate *locked* page. Many of them want a kmapped page, which is uptodate and unlocked, and they all have their own individual helper functions to achieve this.

Since the helper functions are so similar, this patch just combines them into a small number of simple library functions, which call read_cache_page (renamed to __read_cache_page because it now returns a locked page). The immediate result is a vast reduction in the number of fs-specific helper functions. The secondary goal is to reduce the number of places the page lock is taken, and eliminate a lot of PageUptodate and PageError checks.

The file systems that still use PageChecked now have checker functions that return an error if the page is corrupted or has some other error. This simplifies the logic since the checker function is not part of any helper function anymore.

Compile tested on x86_64.

---

 drivers/mtd/devices/block2mtd.c          |   28 +------
 fs/afs/dir.c                             |   56 +++-----------
 fs/afs/mntpt.c                           |   10 --
 fs/cramfs/inode.c                        |    3 
 fs/ext2/dir.c                            |   82 ++++++++-------------
 fs/freevxfs/vxfs_extern.h                |    1 
 fs/freevxfs/vxfs_inode.c                 |    2 
 fs/freevxfs/vxfs_lookup.c                |    4 -
 fs/freevxfs/vxfs_subr.c                  |   33 --------
 fs/hfs/bnode.c                           |    4 -
 fs/hfsplus/bnode.c                       |    4 -
 fs/jffs2/fs.c                            |   27 -------
 fs/jffs2/gc.c                            |   15 ++-
 fs/jfs/jfs_metapage.c                    |    5 -
 fs/minix/dir.c                           |   59 ++++-----------
 fs/ntfs/aops.h                           |   67 -----------------
 fs/ntfs/bitmap.c                         |    8 +-
 fs/ntfs/dir.c                            |   65 ++++++-----------
 fs/ntfs/index.c                          |   12 +--
 fs/ntfs/lcnalloc.c                       |    6 -
 fs/ntfs/logfile.c                        |   12 +--
 fs/ntfs/mft.c                            |   53 +++++--------
 fs/ntfs/super.c                          |   38 ++++-----
 fs/ntfs/usnjrnl.c                        |    4 -
 fs/partitions/check.c                    |   14 +--
 fs/reiser4/plugin/file/tail_conversion.c |    8 --
 fs/reiser4/plugin/item/extent_file_ops.c |    9 --
 fs/reiserfs/xattr.c                      |   48 ++----------
 fs/sysv/dir.c                            |   19 +---
 fs/ufs/balloc.c                          |    8 +-
 fs/ufs/dir.c                             |   90 +++++++++--------------
 fs/ufs/truncate.c                        |    8 +-
 fs/ufs/util.c                            |   52 -------------
 fs/ufs/util.h                            |   10 --
 include/linux/pagemap.h                  |   53 ++++++++++++-
 mm/filemap.c                             |  118 +++++++------------------------
 36 files changed, 315 insertions(+), 720 deletions(-)