diff options
author | Brian Behlendorf <[email protected]> | 2011-01-05 13:16:12 -0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2011-02-10 09:27:20 -0800 |
commit | 7304b6e50f656fbf4b126a4e94deac174133851c (patch) | |
tree | 9e7b6d9c0262c934c3c3e676d10bc7a20e24d9d6 /include/sys/zfs_znode.h | |
parent | 10c6047ea56445a87d8ce1397ac2d2caa97719ca (diff) |
VFS: Integrate zfs_znode_alloc()
Under Linux the convention for filesystem specific data structure is
to embed it along with the generic vfs data structure. This differs
significantly from Solaris.
Since we want to integrates as cleanly with the Linux VFS as possible.
This changes modifies zfs_znode_alloc() to allocate a znode with an
embedded inode for use with the generic VFS. This is done by calling
iget_locked() which will allocate a new inode if needed by calling
sb->alloc_inode(). This function allocates enough memory for a
znode_t by returns a pointer to the inode structure for Linux's VFS.
This function is also responsible for setting the callback
znode->z_set_ops_inodes() which is used to register the correct
handlers for the inode.
Diffstat (limited to 'include/sys/zfs_znode.h')
-rw-r--r-- | include/sys/zfs_znode.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/include/sys/zfs_znode.h b/include/sys/zfs_znode.h index aa1f449ac..356092169 100644 --- a/include/sys/zfs_znode.h +++ b/include/sys/zfs_znode.h @@ -211,6 +211,8 @@ typedef struct znode { list_node_t z_link_node; /* all znodes in fs link */ sa_handle_t *z_sa_hdl; /* handle to sa data */ boolean_t z_is_sa; /* are we native sa? */ + void (*z_set_ops_inode) (struct inode *); /* set inode ops */ + struct inode z_inode; /* generic vfs inode */ } znode_t; @@ -231,13 +233,18 @@ typedef struct znode { */ /* - * Convert between znode pointers and vnode pointers + * Convert between znode pointers and inode pointers */ +#define ZTOI(ZP) (&((ZP)->z_inode)) +#define ITOZ(IP) (container_of((IP), znode_t, z_inode)) + +/* XXX - REMOVE ME ONCE THE OTHER BUILD ISSUES ARE RESOLVED */ #define ZTOV(ZP) ((ZP)->z_vnode) #define VTOZ(VP) ((znode_t *)(VP)->v_data) + /* - * ZFS_ENTER() is called on entry to each ZFS vnode and vfs operation. + * ZFS_ENTER() is called on entry to each ZFS inode and vfs operation. * ZFS_EXIT() must be called before exitting the vop. * ZFS_VERIFY_ZP() verifies the znode is valid. */ |