Commit 232dd599 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull zonefs updates from Damien Le Moal:

 - Reorganize zonefs code to split file related operations to a new
   fs/zonefs/file.c file (me)

 - Modify zonefs to use dynamically allocated inodes and dentries (using
   the inode and dentry caches) instead of statically allocating
   everything on mount. This saves a significant amount of memory for
   very large zoned block devices with 10s of thousands of zones (me)

 - Make zonefs_sb_ktype a const struct kobj_type (Thomas)

* tag 'zonefs-6.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/zonefs:
  zonefs: make kobj_type structure constant
  zonefs: Cache zone group directory inodes
  zonefs: Dynamically create file inodes when needed
  zonefs: Separate zone information from inode information
  zonefs: Reduce struct zonefs_inode_info size
  zonefs: Simplify IO error handling
  zonefs: Reorganize code
parents b7ee8812 2b188a2c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3,4 +3,4 @@ ccflags-y += -I$(src)

obj-$(CONFIG_ZONEFS_FS) += zonefs.o

zonefs-y	:= super.o sysfs.o
zonefs-y	:= super.o file.o sysfs.o

fs/zonefs/file.c

0 → 100644
+878 −0

File added.

Preview size limit exceeded, changes collapsed.

+696 −1235

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1
Original line number Diff line number Diff line
@@ -79,7 +79,7 @@ static const struct sysfs_ops zonefs_sysfs_attr_ops = {
	.show	= zonefs_sysfs_attr_show,
};

static struct kobj_type zonefs_sb_ktype = {
static const struct kobj_type zonefs_sb_ktype = {
	.default_groups = zonefs_sysfs_groups,
	.sysfs_ops	= &zonefs_sysfs_attr_ops,
	.release	= zonefs_sysfs_sb_release,
+11 −9
Original line number Diff line number Diff line
@@ -20,8 +20,9 @@
#define show_dev(dev) MAJOR(dev), MINOR(dev)

TRACE_EVENT(zonefs_zone_mgmt,
	    TP_PROTO(struct inode *inode, enum req_op op),
	    TP_ARGS(inode, op),
	    TP_PROTO(struct super_block *sb, struct zonefs_zone *z,
		     enum req_op op),
	    TP_ARGS(sb, z, op),
	    TP_STRUCT__entry(
			     __field(dev_t, dev)
			     __field(ino_t, ino)
@@ -30,12 +31,12 @@ TRACE_EVENT(zonefs_zone_mgmt,
			     __field(sector_t, nr_sectors)
	    ),
	    TP_fast_assign(
			   __entry->dev = inode->i_sb->s_dev;
			   __entry->ino = inode->i_ino;
			   __entry->dev = sb->s_dev;
			   __entry->ino =
				z->z_sector >> ZONEFS_SB(sb)->s_zone_sectors_shift;
			   __entry->op = op;
			   __entry->sector = ZONEFS_I(inode)->i_zsector;
			   __entry->nr_sectors =
				   ZONEFS_I(inode)->i_zone_size >> SECTOR_SHIFT;
			   __entry->sector = z->z_sector;
			   __entry->nr_sectors = z->z_size >> SECTOR_SHIFT;
	    ),
	    TP_printk("bdev=(%d,%d), ino=%lu op=%s, sector=%llu, nr_sectors=%llu",
		      show_dev(__entry->dev), (unsigned long)__entry->ino,
@@ -58,9 +59,10 @@ TRACE_EVENT(zonefs_file_dio_append,
	    TP_fast_assign(
			   __entry->dev = inode->i_sb->s_dev;
			   __entry->ino = inode->i_ino;
			   __entry->sector = ZONEFS_I(inode)->i_zsector;
			   __entry->sector = zonefs_inode_zone(inode)->z_sector;
			   __entry->size = size;
			   __entry->wpoffset = ZONEFS_I(inode)->i_wpoffset;
			   __entry->wpoffset =
				zonefs_inode_zone(inode)->z_wpoffset;
			   __entry->ret = ret;
	    ),
	    TP_printk("bdev=(%d, %d), ino=%lu, sector=%llu, size=%zu, wpoffset=%llu, ret=%zu",
Loading