diff options
author | Konstantin Belousov <kib@FreeBSD.org> | 2021-02-15 04:35:59 +0000 |
---|---|---|
committer | Konstantin Belousov <kib@FreeBSD.org> | 2021-02-21 09:38:21 +0000 |
commit | 2bfd8992c7c7301166c74931ad63d4755bb4a6c7 (patch) | |
tree | 8e4f3af63c611303bed064826ba2daf7751ba0e6 /sys/fs/ext2fs | |
parent | d485c77f203fb0f4cdc08dea5ff81631b51d8809 (diff) | |
download | src-2bfd8992c7c7301166c74931ad63d4755bb4a6c7.tar.gz src-2bfd8992c7c7301166c74931ad63d4755bb4a6c7.zip |
vnode: move write cluster support data to inodes.
The data is only needed by filesystems that
1. use buffer cache
2. utilize clustering write support.
Requested by: mjg
Reviewed by: asomers (previous version), fsu (ext2 parts), mckusick
Tested by: pho
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D28679
Diffstat (limited to 'sys/fs/ext2fs')
-rw-r--r-- | sys/fs/ext2fs/ext2_vfsops.c | 1 | ||||
-rw-r--r-- | sys/fs/ext2fs/ext2_vnops.c | 3 | ||||
-rw-r--r-- | sys/fs/ext2fs/inode.h | 3 |
3 files changed, 6 insertions, 1 deletions
diff --git a/sys/fs/ext2fs/ext2_vfsops.c b/sys/fs/ext2fs/ext2_vfsops.c index a64e28186769..099d6bfec981 100644 --- a/sys/fs/ext2fs/ext2_vfsops.c +++ b/sys/fs/ext2fs/ext2_vfsops.c @@ -1229,6 +1229,7 @@ ext2_vget(struct mount *mp, ino_t ino, int flags, struct vnode **vpp) ip->i_e2fs = fs = ump->um_e2fs; ip->i_ump = ump; ip->i_number = ino; + cluster_init_vn(&ip->i_clusterw); lockmgr(vp->v_vnlock, LK_EXCLUSIVE, NULL); error = insmntque(vp, mp); diff --git a/sys/fs/ext2fs/ext2_vnops.c b/sys/fs/ext2fs/ext2_vnops.c index e52db1416890..e00dbc3e0adc 100644 --- a/sys/fs/ext2fs/ext2_vnops.c +++ b/sys/fs/ext2fs/ext2_vnops.c @@ -2313,7 +2313,8 @@ ext2_write(struct vop_write_args *ap) } else if (xfersize + blkoffset == fs->e2fs_fsize) { if ((vp->v_mount->mnt_flag & MNT_NOCLUSTERW) == 0) { bp->b_flags |= B_CLUSTEROK; - cluster_write(vp, bp, ip->i_size, seqcount, 0); + cluster_write(vp, &ip->i_clusterw, bp, + ip->i_size, seqcount, 0); } else { bawrite(bp); } diff --git a/sys/fs/ext2fs/inode.h b/sys/fs/ext2fs/inode.h index 2077b6b276ea..2b9ec687a75c 100644 --- a/sys/fs/ext2fs/inode.h +++ b/sys/fs/ext2fs/inode.h @@ -44,6 +44,7 @@ #include <sys/lock.h> #include <sys/mutex.h> #include <sys/queue.h> +#include <sys/buf.h> #include <fs/ext2fs/ext2_extents.h> @@ -118,6 +119,8 @@ struct inode { }; struct ext4_extent_cache i_ext_cache; /* cache for ext4 extent */ + + struct vn_clusterw i_clusterw; /* Buffer clustering information */ }; /* |