]> granicus.if.org Git - zfs/commit
Remove dummy znode from zvol_state
authorChunwei Chen <david.chen@osnexus.com>
Mon, 11 Apr 2016 21:53:48 +0000 (14:53 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 17 May 2016 17:29:02 +0000 (10:29 -0700)
commitd88895a069765bc3c6119ac1a3c8ea9edec7a370
tree4124ee3bfcf5d5ecb3f7c5e84cc95824a063faf7
parent61a3d06f8414ae1eb8b278be8776a6b30b351549
Remove dummy znode from zvol_state

struct zvol_state contains a dummy znode, which is around 1KB on x64,
only for zfs_range_lock. But in reality, other than z_range_lock and
z_range_avl, zfs_range_lock only need znode on regular file, which
means we add 1KB on a structure and gain nothing.

In this patch, we remove the dummy znode for zvol_state. In order to
do that, we also need to refactor zfs_range_lock a bit. We move
z_range_lock and z_range_avl pair out of znode_t to form zfs_rlock_t.
This new struct replaces znode_t as the main handle inside the range
lock functions.

We also add pointers to z_size, z_blksz, and z_max_blksz so range lock
code doesn't depend on znode_t.  This allows non-ZPL consumers like
Lustre to use the range locks with their equivalent znode_t structure.

Signed-off-by: Chunwei Chen <david.chen@osnexus.com>
Signed-off-by: Boris Protopopov <boris.protopopov@actifio.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #4510
include/sys/trace_acl.h
include/sys/zfs_rlock.h
include/sys/zfs_znode.h
module/zfs/zfs_ctldir.c
module/zfs/zfs_rlock.c
module/zfs/zfs_vnops.c
module/zfs/zfs_znode.c
module/zfs/zvol.c