mirror of
https://github.com/torvalds/linux.git
synced 2024-11-24 21:21:41 +00:00
fs: add CONFIG_BUFFER_HEAD
Add a new config option that controls building the buffer_head code, and select it from all file systems and stacking drivers that need it. For the block device nodes and alternative iomap based buffered I/O path is provided when buffer_head support is not enabled, and iomap needs a a small tweak to define the IOMAP_F_BUFFER_HEAD flag to 0 to not call into the buffer_head code when it doesn't exist. Otherwise this is just Kconfig and ifdef changes. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Luis Chamberlain <mcgrof@kernel.org> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Link: https://lore.kernel.org/r/20230801172201.1923299-7-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
487c607df7
commit
925c86a19b
70
block/fops.c
70
block/fops.c
@ -24,15 +24,6 @@ static inline struct inode *bdev_file_inode(struct file *file)
|
|||||||
return file->f_mapping->host;
|
return file->f_mapping->host;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int blkdev_get_block(struct inode *inode, sector_t iblock,
|
|
||||||
struct buffer_head *bh, int create)
|
|
||||||
{
|
|
||||||
bh->b_bdev = I_BDEV(inode);
|
|
||||||
bh->b_blocknr = iblock;
|
|
||||||
set_buffer_mapped(bh);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static blk_opf_t dio_bio_write_op(struct kiocb *iocb)
|
static blk_opf_t dio_bio_write_op(struct kiocb *iocb)
|
||||||
{
|
{
|
||||||
blk_opf_t opf = REQ_OP_WRITE | REQ_SYNC | REQ_IDLE;
|
blk_opf_t opf = REQ_OP_WRITE | REQ_SYNC | REQ_IDLE;
|
||||||
@ -400,7 +391,7 @@ static int blkdev_iomap_begin(struct inode *inode, loff_t offset, loff_t length,
|
|||||||
iomap->type = IOMAP_MAPPED;
|
iomap->type = IOMAP_MAPPED;
|
||||||
iomap->addr = iomap->offset;
|
iomap->addr = iomap->offset;
|
||||||
iomap->length = isize - iomap->offset;
|
iomap->length = isize - iomap->offset;
|
||||||
iomap->flags |= IOMAP_F_BUFFER_HEAD;
|
iomap->flags |= IOMAP_F_BUFFER_HEAD; /* noop for !CONFIG_BUFFER_HEAD */
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -408,6 +399,16 @@ static const struct iomap_ops blkdev_iomap_ops = {
|
|||||||
.iomap_begin = blkdev_iomap_begin,
|
.iomap_begin = blkdev_iomap_begin,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef CONFIG_BUFFER_HEAD
|
||||||
|
static int blkdev_get_block(struct inode *inode, sector_t iblock,
|
||||||
|
struct buffer_head *bh, int create)
|
||||||
|
{
|
||||||
|
bh->b_bdev = I_BDEV(inode);
|
||||||
|
bh->b_blocknr = iblock;
|
||||||
|
set_buffer_mapped(bh);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int blkdev_writepage(struct page *page, struct writeback_control *wbc)
|
static int blkdev_writepage(struct page *page, struct writeback_control *wbc)
|
||||||
{
|
{
|
||||||
return block_write_full_page(page, blkdev_get_block, wbc);
|
return block_write_full_page(page, blkdev_get_block, wbc);
|
||||||
@ -453,6 +454,55 @@ const struct address_space_operations def_blk_aops = {
|
|||||||
.migrate_folio = buffer_migrate_folio_norefs,
|
.migrate_folio = buffer_migrate_folio_norefs,
|
||||||
.is_dirty_writeback = buffer_check_dirty_writeback,
|
.is_dirty_writeback = buffer_check_dirty_writeback,
|
||||||
};
|
};
|
||||||
|
#else /* CONFIG_BUFFER_HEAD */
|
||||||
|
static int blkdev_read_folio(struct file *file, struct folio *folio)
|
||||||
|
{
|
||||||
|
return iomap_read_folio(folio, &blkdev_iomap_ops);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void blkdev_readahead(struct readahead_control *rac)
|
||||||
|
{
|
||||||
|
iomap_readahead(rac, &blkdev_iomap_ops);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int blkdev_map_blocks(struct iomap_writepage_ctx *wpc,
|
||||||
|
struct inode *inode, loff_t offset)
|
||||||
|
{
|
||||||
|
loff_t isize = i_size_read(inode);
|
||||||
|
|
||||||
|
if (WARN_ON_ONCE(offset >= isize))
|
||||||
|
return -EIO;
|
||||||
|
if (offset >= wpc->iomap.offset &&
|
||||||
|
offset < wpc->iomap.offset + wpc->iomap.length)
|
||||||
|
return 0;
|
||||||
|
return blkdev_iomap_begin(inode, offset, isize - offset,
|
||||||
|
IOMAP_WRITE, &wpc->iomap, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
static const struct iomap_writeback_ops blkdev_writeback_ops = {
|
||||||
|
.map_blocks = blkdev_map_blocks,
|
||||||
|
};
|
||||||
|
|
||||||
|
static int blkdev_writepages(struct address_space *mapping,
|
||||||
|
struct writeback_control *wbc)
|
||||||
|
{
|
||||||
|
struct iomap_writepage_ctx wpc = { };
|
||||||
|
|
||||||
|
return iomap_writepages(mapping, wbc, &wpc, &blkdev_writeback_ops);
|
||||||
|
}
|
||||||
|
|
||||||
|
const struct address_space_operations def_blk_aops = {
|
||||||
|
.dirty_folio = filemap_dirty_folio,
|
||||||
|
.release_folio = iomap_release_folio,
|
||||||
|
.invalidate_folio = iomap_invalidate_folio,
|
||||||
|
.read_folio = blkdev_read_folio,
|
||||||
|
.readahead = blkdev_readahead,
|
||||||
|
.writepages = blkdev_writepages,
|
||||||
|
.is_partially_uptodate = iomap_is_partially_uptodate,
|
||||||
|
.error_remove_page = generic_error_remove_page,
|
||||||
|
.migrate_folio = filemap_migrate_folio,
|
||||||
|
};
|
||||||
|
#endif /* CONFIG_BUFFER_HEAD */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* for a block special file file_inode(file)->i_size is zero
|
* for a block special file file_inode(file)->i_size is zero
|
||||||
|
@ -15,6 +15,7 @@ if MD
|
|||||||
config BLK_DEV_MD
|
config BLK_DEV_MD
|
||||||
tristate "RAID support"
|
tristate "RAID support"
|
||||||
select BLOCK_HOLDER_DEPRECATED if SYSFS
|
select BLOCK_HOLDER_DEPRECATED if SYSFS
|
||||||
|
select BUFFER_HEAD
|
||||||
# BLOCK_LEGACY_AUTOLOAD requirement should be removed
|
# BLOCK_LEGACY_AUTOLOAD requirement should be removed
|
||||||
# after relevant mdadm enhancements - to make "names=yes"
|
# after relevant mdadm enhancements - to make "names=yes"
|
||||||
# the default - are widely available.
|
# the default - are widely available.
|
||||||
|
@ -18,8 +18,12 @@ config VALIDATE_FS_PARSER
|
|||||||
config FS_IOMAP
|
config FS_IOMAP
|
||||||
bool
|
bool
|
||||||
|
|
||||||
|
config BUFFER_HEAD
|
||||||
|
bool
|
||||||
|
|
||||||
# old blockdev_direct_IO implementation. Use iomap for new code instead
|
# old blockdev_direct_IO implementation. Use iomap for new code instead
|
||||||
config LEGACY_DIRECT_IO
|
config LEGACY_DIRECT_IO
|
||||||
|
depends on BUFFER_HEAD
|
||||||
bool
|
bool
|
||||||
|
|
||||||
if BLOCK
|
if BLOCK
|
||||||
|
@ -17,7 +17,7 @@ obj-y := open.o read_write.o file_table.o super.o \
|
|||||||
fs_types.o fs_context.o fs_parser.o fsopen.o init.o \
|
fs_types.o fs_context.o fs_parser.o fsopen.o init.o \
|
||||||
kernel_read_file.o mnt_idmapping.o remap_range.o
|
kernel_read_file.o mnt_idmapping.o remap_range.o
|
||||||
|
|
||||||
obj-$(CONFIG_BLOCK) += buffer.o mpage.o
|
obj-$(CONFIG_BUFFER_HEAD) += buffer.o mpage.o
|
||||||
obj-$(CONFIG_PROC_FS) += proc_namespace.o
|
obj-$(CONFIG_PROC_FS) += proc_namespace.o
|
||||||
obj-$(CONFIG_LEGACY_DIRECT_IO) += direct-io.o
|
obj-$(CONFIG_LEGACY_DIRECT_IO) += direct-io.o
|
||||||
obj-y += notify/
|
obj-y += notify/
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
config ADFS_FS
|
config ADFS_FS
|
||||||
tristate "ADFS file system support"
|
tristate "ADFS file system support"
|
||||||
depends on BLOCK
|
depends on BLOCK
|
||||||
|
select BUFFER_HEAD
|
||||||
help
|
help
|
||||||
The Acorn Disc Filing System is the standard file system of the
|
The Acorn Disc Filing System is the standard file system of the
|
||||||
RiscOS operating system which runs on Acorn's ARM-based Risc PC
|
RiscOS operating system which runs on Acorn's ARM-based Risc PC
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
config AFFS_FS
|
config AFFS_FS
|
||||||
tristate "Amiga FFS file system support"
|
tristate "Amiga FFS file system support"
|
||||||
depends on BLOCK
|
depends on BLOCK
|
||||||
|
select BUFFER_HEAD
|
||||||
select LEGACY_DIRECT_IO
|
select LEGACY_DIRECT_IO
|
||||||
help
|
help
|
||||||
The Fast File System (FFS) is the common file system used on hard
|
The Fast File System (FFS) is the common file system used on hard
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
config BEFS_FS
|
config BEFS_FS
|
||||||
tristate "BeOS file system (BeFS) support (read only)"
|
tristate "BeOS file system (BeFS) support (read only)"
|
||||||
depends on BLOCK
|
depends on BLOCK
|
||||||
|
select BUFFER_HEAD
|
||||||
select NLS
|
select NLS
|
||||||
help
|
help
|
||||||
The BeOS File System (BeFS) is the native file system of Be, Inc's
|
The BeOS File System (BeFS) is the native file system of Be, Inc's
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
config BFS_FS
|
config BFS_FS
|
||||||
tristate "BFS file system support"
|
tristate "BFS file system support"
|
||||||
depends on BLOCK
|
depends on BLOCK
|
||||||
|
select BUFFER_HEAD
|
||||||
help
|
help
|
||||||
Boot File System (BFS) is a file system used under SCO UnixWare to
|
Boot File System (BFS) is a file system used under SCO UnixWare to
|
||||||
allow the bootloader access to the kernel image and other important
|
allow the bootloader access to the kernel image and other important
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
config EFS_FS
|
config EFS_FS
|
||||||
tristate "EFS file system support (read only)"
|
tristate "EFS file system support (read only)"
|
||||||
depends on BLOCK
|
depends on BLOCK
|
||||||
|
select BUFFER_HEAD
|
||||||
help
|
help
|
||||||
EFS is an older file system used for non-ISO9660 CD-ROMs and hard
|
EFS is an older file system used for non-ISO9660 CD-ROMs and hard
|
||||||
disk partitions by SGI's IRIX operating system (IRIX 6.0 and newer
|
disk partitions by SGI's IRIX operating system (IRIX 6.0 and newer
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
config EXFAT_FS
|
config EXFAT_FS
|
||||||
tristate "exFAT filesystem support"
|
tristate "exFAT filesystem support"
|
||||||
|
select BUFFER_HEAD
|
||||||
select NLS
|
select NLS
|
||||||
select LEGACY_DIRECT_IO
|
select LEGACY_DIRECT_IO
|
||||||
help
|
help
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# SPDX-License-Identifier: GPL-2.0-only
|
# SPDX-License-Identifier: GPL-2.0-only
|
||||||
config EXT2_FS
|
config EXT2_FS
|
||||||
tristate "Second extended fs support"
|
tristate "Second extended fs support"
|
||||||
|
select BUFFER_HEAD
|
||||||
select FS_IOMAP
|
select FS_IOMAP
|
||||||
select LEGACY_DIRECT_IO
|
select LEGACY_DIRECT_IO
|
||||||
help
|
help
|
||||||
|
@ -28,6 +28,7 @@ config EXT3_FS_SECURITY
|
|||||||
|
|
||||||
config EXT4_FS
|
config EXT4_FS
|
||||||
tristate "The Extended 4 (ext4) filesystem"
|
tristate "The Extended 4 (ext4) filesystem"
|
||||||
|
select BUFFER_HEAD
|
||||||
select JBD2
|
select JBD2
|
||||||
select CRC16
|
select CRC16
|
||||||
select CRYPTO
|
select CRYPTO
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
config F2FS_FS
|
config F2FS_FS
|
||||||
tristate "F2FS filesystem support"
|
tristate "F2FS filesystem support"
|
||||||
depends on BLOCK
|
depends on BLOCK
|
||||||
|
select BUFFER_HEAD
|
||||||
select NLS
|
select NLS
|
||||||
select CRYPTO
|
select CRYPTO
|
||||||
select CRYPTO_CRC32
|
select CRYPTO_CRC32
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# SPDX-License-Identifier: GPL-2.0-only
|
# SPDX-License-Identifier: GPL-2.0-only
|
||||||
config FAT_FS
|
config FAT_FS
|
||||||
tristate
|
tristate
|
||||||
|
select BUFFER_HEAD
|
||||||
select NLS
|
select NLS
|
||||||
select LEGACY_DIRECT_IO
|
select LEGACY_DIRECT_IO
|
||||||
help
|
help
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
config VXFS_FS
|
config VXFS_FS
|
||||||
tristate "FreeVxFS file system support (VERITAS VxFS(TM) compatible)"
|
tristate "FreeVxFS file system support (VERITAS VxFS(TM) compatible)"
|
||||||
depends on BLOCK
|
depends on BLOCK
|
||||||
|
select BUFFER_HEAD
|
||||||
help
|
help
|
||||||
FreeVxFS is a file system driver that support the VERITAS VxFS(TM)
|
FreeVxFS is a file system driver that support the VERITAS VxFS(TM)
|
||||||
file system format. VERITAS VxFS(TM) is the standard file system
|
file system format. VERITAS VxFS(TM) is the standard file system
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# SPDX-License-Identifier: GPL-2.0-only
|
# SPDX-License-Identifier: GPL-2.0-only
|
||||||
config GFS2_FS
|
config GFS2_FS
|
||||||
tristate "GFS2 file system support"
|
tristate "GFS2 file system support"
|
||||||
|
select BUFFER_HEAD
|
||||||
select FS_POSIX_ACL
|
select FS_POSIX_ACL
|
||||||
select CRC32
|
select CRC32
|
||||||
select LIBCRC32C
|
select LIBCRC32C
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
config HFS_FS
|
config HFS_FS
|
||||||
tristate "Apple Macintosh file system support"
|
tristate "Apple Macintosh file system support"
|
||||||
depends on BLOCK
|
depends on BLOCK
|
||||||
|
select BUFFER_HEAD
|
||||||
select NLS
|
select NLS
|
||||||
select LEGACY_DIRECT_IO
|
select LEGACY_DIRECT_IO
|
||||||
help
|
help
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
config HFSPLUS_FS
|
config HFSPLUS_FS
|
||||||
tristate "Apple Extended HFS file system support"
|
tristate "Apple Extended HFS file system support"
|
||||||
depends on BLOCK
|
depends on BLOCK
|
||||||
|
select BUFFER_HEAD
|
||||||
select NLS
|
select NLS
|
||||||
select NLS_UTF8
|
select NLS_UTF8
|
||||||
select LEGACY_DIRECT_IO
|
select LEGACY_DIRECT_IO
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
config HPFS_FS
|
config HPFS_FS
|
||||||
tristate "OS/2 HPFS file system support"
|
tristate "OS/2 HPFS file system support"
|
||||||
depends on BLOCK
|
depends on BLOCK
|
||||||
|
select BUFFER_HEAD
|
||||||
select FS_IOMAP
|
select FS_IOMAP
|
||||||
help
|
help
|
||||||
OS/2 is IBM's operating system for PC's, the same as Warp, and HPFS
|
OS/2 is IBM's operating system for PC's, the same as Warp, and HPFS
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# SPDX-License-Identifier: GPL-2.0-only
|
# SPDX-License-Identifier: GPL-2.0-only
|
||||||
config ISO9660_FS
|
config ISO9660_FS
|
||||||
tristate "ISO 9660 CDROM file system support"
|
tristate "ISO 9660 CDROM file system support"
|
||||||
|
select BUFFER_HEAD
|
||||||
help
|
help
|
||||||
This is the standard file system used on CD-ROMs. It was previously
|
This is the standard file system used on CD-ROMs. It was previously
|
||||||
known as "High Sierra File System" and is called "hsfs" on other
|
known as "High Sierra File System" and is called "hsfs" on other
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# SPDX-License-Identifier: GPL-2.0-only
|
# SPDX-License-Identifier: GPL-2.0-only
|
||||||
config JFS_FS
|
config JFS_FS
|
||||||
tristate "JFS filesystem support"
|
tristate "JFS filesystem support"
|
||||||
|
select BUFFER_HEAD
|
||||||
select NLS
|
select NLS
|
||||||
select CRC32
|
select CRC32
|
||||||
select LEGACY_DIRECT_IO
|
select LEGACY_DIRECT_IO
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
config MINIX_FS
|
config MINIX_FS
|
||||||
tristate "Minix file system support"
|
tristate "Minix file system support"
|
||||||
depends on BLOCK
|
depends on BLOCK
|
||||||
|
select BUFFER_HEAD
|
||||||
help
|
help
|
||||||
Minix is a simple operating system used in many classes about OS's.
|
Minix is a simple operating system used in many classes about OS's.
|
||||||
The minix file system (method to organize files on a hard disk
|
The minix file system (method to organize files on a hard disk
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# SPDX-License-Identifier: GPL-2.0-only
|
# SPDX-License-Identifier: GPL-2.0-only
|
||||||
config NILFS2_FS
|
config NILFS2_FS
|
||||||
tristate "NILFS2 file system support"
|
tristate "NILFS2 file system support"
|
||||||
|
select BUFFER_HEAD
|
||||||
select CRC32
|
select CRC32
|
||||||
select LEGACY_DIRECT_IO
|
select LEGACY_DIRECT_IO
|
||||||
help
|
help
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# SPDX-License-Identifier: GPL-2.0-only
|
# SPDX-License-Identifier: GPL-2.0-only
|
||||||
config NTFS_FS
|
config NTFS_FS
|
||||||
tristate "NTFS file system support"
|
tristate "NTFS file system support"
|
||||||
|
select BUFFER_HEAD
|
||||||
select NLS
|
select NLS
|
||||||
help
|
help
|
||||||
NTFS is the file system of Microsoft Windows NT, 2000, XP and 2003.
|
NTFS is the file system of Microsoft Windows NT, 2000, XP and 2003.
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# SPDX-License-Identifier: GPL-2.0-only
|
# SPDX-License-Identifier: GPL-2.0-only
|
||||||
config NTFS3_FS
|
config NTFS3_FS
|
||||||
tristate "NTFS Read-Write file system support"
|
tristate "NTFS Read-Write file system support"
|
||||||
|
select BUFFER_HEAD
|
||||||
select NLS
|
select NLS
|
||||||
select LEGACY_DIRECT_IO
|
select LEGACY_DIRECT_IO
|
||||||
help
|
help
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
config OCFS2_FS
|
config OCFS2_FS
|
||||||
tristate "OCFS2 file system support"
|
tristate "OCFS2 file system support"
|
||||||
depends on INET && SYSFS && CONFIGFS_FS
|
depends on INET && SYSFS && CONFIGFS_FS
|
||||||
|
select BUFFER_HEAD
|
||||||
select JBD2
|
select JBD2
|
||||||
select CRC32
|
select CRC32
|
||||||
select QUOTA
|
select QUOTA
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
config OMFS_FS
|
config OMFS_FS
|
||||||
tristate "SonicBlue Optimized MPEG File System support"
|
tristate "SonicBlue Optimized MPEG File System support"
|
||||||
depends on BLOCK
|
depends on BLOCK
|
||||||
|
select BUFFER_HEAD
|
||||||
select CRC_ITU_T
|
select CRC_ITU_T
|
||||||
help
|
help
|
||||||
This is the proprietary file system used by the Rio Karma music
|
This is the proprietary file system used by the Rio Karma music
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
config QNX4FS_FS
|
config QNX4FS_FS
|
||||||
tristate "QNX4 file system support (read only)"
|
tristate "QNX4 file system support (read only)"
|
||||||
depends on BLOCK
|
depends on BLOCK
|
||||||
|
select BUFFER_HEAD
|
||||||
help
|
help
|
||||||
This is the file system used by the real-time operating systems
|
This is the file system used by the real-time operating systems
|
||||||
QNX 4 and QNX 6 (the latter is also called QNX RTP).
|
QNX 4 and QNX 6 (the latter is also called QNX RTP).
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
config QNX6FS_FS
|
config QNX6FS_FS
|
||||||
tristate "QNX6 file system support (read only)"
|
tristate "QNX6 file system support (read only)"
|
||||||
depends on BLOCK && CRC32
|
depends on BLOCK && CRC32
|
||||||
|
select BUFFER_HEAD
|
||||||
help
|
help
|
||||||
This is the file system used by the real-time operating systems
|
This is the file system used by the real-time operating systems
|
||||||
QNX 6 (also called QNX RTP).
|
QNX 6 (also called QNX RTP).
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# SPDX-License-Identifier: GPL-2.0-only
|
# SPDX-License-Identifier: GPL-2.0-only
|
||||||
config REISERFS_FS
|
config REISERFS_FS
|
||||||
tristate "Reiserfs support (deprecated)"
|
tristate "Reiserfs support (deprecated)"
|
||||||
|
select BUFFER_HEAD
|
||||||
select CRC32
|
select CRC32
|
||||||
select LEGACY_DIRECT_IO
|
select LEGACY_DIRECT_IO
|
||||||
help
|
help
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
config SYSV_FS
|
config SYSV_FS
|
||||||
tristate "System V/Xenix/V7/Coherent file system support"
|
tristate "System V/Xenix/V7/Coherent file system support"
|
||||||
depends on BLOCK
|
depends on BLOCK
|
||||||
|
select BUFFER_HEAD
|
||||||
help
|
help
|
||||||
SCO, Xenix and Coherent are commercial Unix systems for Intel
|
SCO, Xenix and Coherent are commercial Unix systems for Intel
|
||||||
machines, and Version 7 was used on the DEC PDP-11. Saying Y
|
machines, and Version 7 was used on the DEC PDP-11. Saying Y
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# SPDX-License-Identifier: GPL-2.0-only
|
# SPDX-License-Identifier: GPL-2.0-only
|
||||||
config UDF_FS
|
config UDF_FS
|
||||||
tristate "UDF file system support"
|
tristate "UDF file system support"
|
||||||
|
select BUFFER_HEAD
|
||||||
select CRC_ITU_T
|
select CRC_ITU_T
|
||||||
select NLS
|
select NLS
|
||||||
select LEGACY_DIRECT_IO
|
select LEGACY_DIRECT_IO
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
config UFS_FS
|
config UFS_FS
|
||||||
tristate "UFS file system support (read only)"
|
tristate "UFS file system support (read only)"
|
||||||
depends on BLOCK
|
depends on BLOCK
|
||||||
|
select BUFFER_HEAD
|
||||||
help
|
help
|
||||||
BSD and derivate versions of Unix (such as SunOS, FreeBSD, NetBSD,
|
BSD and derivate versions of Unix (such as SunOS, FreeBSD, NetBSD,
|
||||||
OpenBSD and NeXTstep) use a file system called UFS. Some System V
|
OpenBSD and NeXTstep) use a file system called UFS. Some System V
|
||||||
|
@ -16,8 +16,6 @@
|
|||||||
#include <linux/wait.h>
|
#include <linux/wait.h>
|
||||||
#include <linux/atomic.h>
|
#include <linux/atomic.h>
|
||||||
|
|
||||||
#ifdef CONFIG_BLOCK
|
|
||||||
|
|
||||||
enum bh_state_bits {
|
enum bh_state_bits {
|
||||||
BH_Uptodate, /* Contains valid data */
|
BH_Uptodate, /* Contains valid data */
|
||||||
BH_Dirty, /* Is dirty */
|
BH_Dirty, /* Is dirty */
|
||||||
@ -198,7 +196,6 @@ void set_bh_page(struct buffer_head *bh,
|
|||||||
struct page *page, unsigned long offset);
|
struct page *page, unsigned long offset);
|
||||||
void folio_set_bh(struct buffer_head *bh, struct folio *folio,
|
void folio_set_bh(struct buffer_head *bh, struct folio *folio,
|
||||||
unsigned long offset);
|
unsigned long offset);
|
||||||
bool try_to_free_buffers(struct folio *);
|
|
||||||
struct buffer_head *folio_alloc_buffers(struct folio *folio, unsigned long size,
|
struct buffer_head *folio_alloc_buffers(struct folio *folio, unsigned long size,
|
||||||
bool retry);
|
bool retry);
|
||||||
struct buffer_head *alloc_page_buffers(struct page *page, unsigned long size,
|
struct buffer_head *alloc_page_buffers(struct page *page, unsigned long size,
|
||||||
@ -213,10 +210,6 @@ void end_buffer_async_write(struct buffer_head *bh, int uptodate);
|
|||||||
|
|
||||||
/* Things to do with buffers at mapping->private_list */
|
/* Things to do with buffers at mapping->private_list */
|
||||||
void mark_buffer_dirty_inode(struct buffer_head *bh, struct inode *inode);
|
void mark_buffer_dirty_inode(struct buffer_head *bh, struct inode *inode);
|
||||||
int inode_has_buffers(struct inode *);
|
|
||||||
void invalidate_inode_buffers(struct inode *);
|
|
||||||
int remove_inode_buffers(struct inode *inode);
|
|
||||||
int sync_mapping_buffers(struct address_space *mapping);
|
|
||||||
int generic_buffers_fsync_noflush(struct file *file, loff_t start, loff_t end,
|
int generic_buffers_fsync_noflush(struct file *file, loff_t start, loff_t end,
|
||||||
bool datasync);
|
bool datasync);
|
||||||
int generic_buffers_fsync(struct file *file, loff_t start, loff_t end,
|
int generic_buffers_fsync(struct file *file, loff_t start, loff_t end,
|
||||||
@ -240,9 +233,6 @@ void __bforget(struct buffer_head *);
|
|||||||
void __breadahead(struct block_device *, sector_t block, unsigned int size);
|
void __breadahead(struct block_device *, sector_t block, unsigned int size);
|
||||||
struct buffer_head *__bread_gfp(struct block_device *,
|
struct buffer_head *__bread_gfp(struct block_device *,
|
||||||
sector_t block, unsigned size, gfp_t gfp);
|
sector_t block, unsigned size, gfp_t gfp);
|
||||||
void invalidate_bh_lrus(void);
|
|
||||||
void invalidate_bh_lrus_cpu(void);
|
|
||||||
bool has_bh_in_lru(int cpu, void *dummy);
|
|
||||||
struct buffer_head *alloc_buffer_head(gfp_t gfp_flags);
|
struct buffer_head *alloc_buffer_head(gfp_t gfp_flags);
|
||||||
void free_buffer_head(struct buffer_head * bh);
|
void free_buffer_head(struct buffer_head * bh);
|
||||||
void unlock_buffer(struct buffer_head *bh);
|
void unlock_buffer(struct buffer_head *bh);
|
||||||
@ -258,8 +248,6 @@ int __bh_read(struct buffer_head *bh, blk_opf_t op_flags, bool wait);
|
|||||||
void __bh_read_batch(int nr, struct buffer_head *bhs[],
|
void __bh_read_batch(int nr, struct buffer_head *bhs[],
|
||||||
blk_opf_t op_flags, bool force_lock);
|
blk_opf_t op_flags, bool force_lock);
|
||||||
|
|
||||||
extern int buffer_heads_over_limit;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Generic address_space_operations implementations for buffer_head-backed
|
* Generic address_space_operations implementations for buffer_head-backed
|
||||||
* address_spaces.
|
* address_spaces.
|
||||||
@ -304,8 +292,6 @@ extern int buffer_migrate_folio_norefs(struct address_space *,
|
|||||||
#define buffer_migrate_folio_norefs NULL
|
#define buffer_migrate_folio_norefs NULL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void buffer_init(void);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* inline definitions
|
* inline definitions
|
||||||
*/
|
*/
|
||||||
@ -465,7 +451,20 @@ __bread(struct block_device *bdev, sector_t block, unsigned size)
|
|||||||
|
|
||||||
bool block_dirty_folio(struct address_space *mapping, struct folio *folio);
|
bool block_dirty_folio(struct address_space *mapping, struct folio *folio);
|
||||||
|
|
||||||
#else /* CONFIG_BLOCK */
|
#ifdef CONFIG_BUFFER_HEAD
|
||||||
|
|
||||||
|
void buffer_init(void);
|
||||||
|
bool try_to_free_buffers(struct folio *folio);
|
||||||
|
int inode_has_buffers(struct inode *inode);
|
||||||
|
void invalidate_inode_buffers(struct inode *inode);
|
||||||
|
int remove_inode_buffers(struct inode *inode);
|
||||||
|
int sync_mapping_buffers(struct address_space *mapping);
|
||||||
|
void invalidate_bh_lrus(void);
|
||||||
|
void invalidate_bh_lrus_cpu(void);
|
||||||
|
bool has_bh_in_lru(int cpu, void *dummy);
|
||||||
|
extern int buffer_heads_over_limit;
|
||||||
|
|
||||||
|
#else /* CONFIG_BUFFER_HEAD */
|
||||||
|
|
||||||
static inline void buffer_init(void) {}
|
static inline void buffer_init(void) {}
|
||||||
static inline bool try_to_free_buffers(struct folio *folio) { return true; }
|
static inline bool try_to_free_buffers(struct folio *folio) { return true; }
|
||||||
@ -473,9 +472,10 @@ static inline int inode_has_buffers(struct inode *inode) { return 0; }
|
|||||||
static inline void invalidate_inode_buffers(struct inode *inode) {}
|
static inline void invalidate_inode_buffers(struct inode *inode) {}
|
||||||
static inline int remove_inode_buffers(struct inode *inode) { return 1; }
|
static inline int remove_inode_buffers(struct inode *inode) { return 1; }
|
||||||
static inline int sync_mapping_buffers(struct address_space *mapping) { return 0; }
|
static inline int sync_mapping_buffers(struct address_space *mapping) { return 0; }
|
||||||
|
static inline void invalidate_bh_lrus(void) {}
|
||||||
static inline void invalidate_bh_lrus_cpu(void) {}
|
static inline void invalidate_bh_lrus_cpu(void) {}
|
||||||
static inline bool has_bh_in_lru(int cpu, void *dummy) { return false; }
|
static inline bool has_bh_in_lru(int cpu, void *dummy) { return false; }
|
||||||
#define buffer_heads_over_limit 0
|
#define buffer_heads_over_limit 0
|
||||||
|
|
||||||
#endif /* CONFIG_BLOCK */
|
#endif /* CONFIG_BUFFER_HEAD */
|
||||||
#endif /* _LINUX_BUFFER_HEAD_H */
|
#endif /* _LINUX_BUFFER_HEAD_H */
|
||||||
|
@ -58,7 +58,11 @@ struct vm_fault;
|
|||||||
#define IOMAP_F_DIRTY (1U << 1)
|
#define IOMAP_F_DIRTY (1U << 1)
|
||||||
#define IOMAP_F_SHARED (1U << 2)
|
#define IOMAP_F_SHARED (1U << 2)
|
||||||
#define IOMAP_F_MERGED (1U << 3)
|
#define IOMAP_F_MERGED (1U << 3)
|
||||||
|
#ifdef CONFIG_BUFFER_HEAD
|
||||||
#define IOMAP_F_BUFFER_HEAD (1U << 4)
|
#define IOMAP_F_BUFFER_HEAD (1U << 4)
|
||||||
|
#else
|
||||||
|
#define IOMAP_F_BUFFER_HEAD 0
|
||||||
|
#endif /* CONFIG_BUFFER_HEAD */
|
||||||
#define IOMAP_F_XATTR (1U << 5)
|
#define IOMAP_F_XATTR (1U << 5)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
|
|
||||||
#define RWBS_LEN 8
|
#define RWBS_LEN 8
|
||||||
|
|
||||||
|
#ifdef CONFIG_BUFFER_HEAD
|
||||||
DECLARE_EVENT_CLASS(block_buffer,
|
DECLARE_EVENT_CLASS(block_buffer,
|
||||||
|
|
||||||
TP_PROTO(struct buffer_head *bh),
|
TP_PROTO(struct buffer_head *bh),
|
||||||
@ -61,6 +62,7 @@ DEFINE_EVENT(block_buffer, block_dirty_buffer,
|
|||||||
|
|
||||||
TP_ARGS(bh)
|
TP_ARGS(bh)
|
||||||
);
|
);
|
||||||
|
#endif /* CONFIG_BUFFER_HEAD */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* block_rq_requeue - place block IO request back on a queue
|
* block_rq_requeue - place block IO request back on a queue
|
||||||
|
@ -684,7 +684,7 @@ int migrate_folio(struct address_space *mapping, struct folio *dst,
|
|||||||
}
|
}
|
||||||
EXPORT_SYMBOL(migrate_folio);
|
EXPORT_SYMBOL(migrate_folio);
|
||||||
|
|
||||||
#ifdef CONFIG_BLOCK
|
#ifdef CONFIG_BUFFER_HEAD
|
||||||
/* Returns true if all buffers are successfully locked */
|
/* Returns true if all buffers are successfully locked */
|
||||||
static bool buffer_migrate_lock_buffers(struct buffer_head *head,
|
static bool buffer_migrate_lock_buffers(struct buffer_head *head,
|
||||||
enum migrate_mode mode)
|
enum migrate_mode mode)
|
||||||
@ -837,7 +837,7 @@ int buffer_migrate_folio_norefs(struct address_space *mapping,
|
|||||||
return __buffer_migrate_folio(mapping, dst, src, mode, true);
|
return __buffer_migrate_folio(mapping, dst, src, mode, true);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(buffer_migrate_folio_norefs);
|
EXPORT_SYMBOL_GPL(buffer_migrate_folio_norefs);
|
||||||
#endif
|
#endif /* CONFIG_BUFFER_HEAD */
|
||||||
|
|
||||||
int filemap_migrate_folio(struct address_space *mapping,
|
int filemap_migrate_folio(struct address_space *mapping,
|
||||||
struct folio *dst, struct folio *src, enum migrate_mode mode)
|
struct folio *dst, struct folio *src, enum migrate_mode mode)
|
||||||
|
Loading…
Reference in New Issue
Block a user