usr/src/uts/common/fs/zfs/sys/zfs_znode.h
changeset 4577 ed36b0e652bc
parent 3912 f6891a60bd72
child 4787 602d3f97842c
equal deleted inserted replaced
4576:b7409bfaaf38 4577:ed36b0e652bc
    52 #define	MASTER_NODE_OBJ	1
    52 #define	MASTER_NODE_OBJ	1
    53 
    53 
    54 /*
    54 /*
    55  * special attributes for master node.
    55  * special attributes for master node.
    56  */
    56  */
    57 
       
    58 #define	ZFS_FSID		"FSID"
    57 #define	ZFS_FSID		"FSID"
    59 #define	ZFS_UNLINKED_SET	"DELETE_QUEUE"
    58 #define	ZFS_UNLINKED_SET	"DELETE_QUEUE"
    60 #define	ZFS_ROOT_OBJ		"ROOT"
    59 #define	ZFS_ROOT_OBJ		"ROOT"
    61 #define	ZPL_VERSION_OBJ		"VERSION"
    60 #define	ZPL_VERSION_STR		"VERSION"
    62 #define	ZFS_PROP_BLOCKPERPAGE	"BLOCKPERPAGE"
    61 
    63 #define	ZFS_PROP_NOGROWBLOCKS	"NOGROWBLOCKS"
       
    64 
       
    65 #define	ZFS_FLAG_BLOCKPERPAGE	0x1
       
    66 #define	ZFS_FLAG_NOGROWBLOCKS	0x2
       
    67 
       
    68 /*
       
    69  * ZPL version - rev'd whenever an incompatible on-disk format change
       
    70  * occurs.  Independent of SPA/DMU/ZAP versioning.
       
    71  */
       
    72 
       
    73 #define	ZPL_VERSION		1ULL
       
    74 
    62 
    75 #define	ZFS_MAX_BLOCKSIZE	(SPA_MAXBLOCKSIZE)
    63 #define	ZFS_MAX_BLOCKSIZE	(SPA_MAXBLOCKSIZE)
    76 
    64 
    77 /* Path component length */
    65 /* Path component length */
    78 /*
    66 /*
    83  * true maximum length of a component is, excluding the NULL.
    71  * true maximum length of a component is, excluding the NULL.
    84  */
    72  */
    85 #define	ZFS_MAXNAMELEN	(MAXNAMELEN - 1)
    73 #define	ZFS_MAXNAMELEN	(MAXNAMELEN - 1)
    86 
    74 
    87 /*
    75 /*
       
    76  * Convert mode bits (zp_mode) to BSD-style DT_* values for storing in
       
    77  * the directory entries.
       
    78  */
       
    79 #define	IFTODT(mode) (((mode) & S_IFMT) >> 12)
       
    80 
       
    81 /*
    88  * The directory entry has the type (currently unused on Solaris) in the
    82  * The directory entry has the type (currently unused on Solaris) in the
    89  * top 4 bits, and the object number in the low 48 bits.  The "middle"
    83  * top 4 bits, and the object number in the low 48 bits.  The "middle"
    90  * 12 bits are unused.
    84  * 12 bits are unused.
    91  */
    85  */
    92 #define	ZFS_DIRENT_TYPE(de) BF64_GET(de, 60, 4)
    86 #define	ZFS_DIRENT_TYPE(de) BF64_GET(de, 60, 4)
    93 #define	ZFS_DIRENT_OBJ(de) BF64_GET(de, 0, 48)
    87 #define	ZFS_DIRENT_OBJ(de) BF64_GET(de, 0, 48)
    94 #define	ZFS_DIRENT_MAKE(type, obj) (((uint64_t)type << 60) | obj)
       
    95 
       
    96 
    88 
    97 /*
    89 /*
    98  * This is the persistent portion of the znode.  It is stored
    90  * This is the persistent portion of the znode.  It is stored
    99  * in the "bonus buffer" of the file.  Short symbolic links
    91  * in the "bonus buffer" of the file.  Short symbolic links
   100  * are also stored in the bonus buffer.
    92  * are also stored in the bonus buffer.
   246 	if ((zfsvfs)->z_atime && !((zfsvfs)->z_vfs->vfs_flag & VFS_RDONLY)) \
   238 	if ((zfsvfs)->z_atime && !((zfsvfs)->z_vfs->vfs_flag & VFS_RDONLY)) \
   247 		zfs_time_stamper(zp, ACCESSED, NULL)
   239 		zfs_time_stamper(zp, ACCESSED, NULL)
   248 
   240 
   249 extern int	zfs_init_fs(zfsvfs_t *, znode_t **, cred_t *);
   241 extern int	zfs_init_fs(zfsvfs_t *, znode_t **, cred_t *);
   250 extern void	zfs_set_dataprop(objset_t *);
   242 extern void	zfs_set_dataprop(objset_t *);
   251 extern void	zfs_create_fs(objset_t *os, cred_t *cr, dmu_tx_t *tx);
   243 extern void	zfs_create_fs(objset_t *os, cred_t *cr, uint64_t, dmu_tx_t *tx);
   252 extern void	zfs_time_stamper(znode_t *, uint_t, dmu_tx_t *);
   244 extern void	zfs_time_stamper(znode_t *, uint_t, dmu_tx_t *);
   253 extern void	zfs_time_stamper_locked(znode_t *, uint_t, dmu_tx_t *);
   245 extern void	zfs_time_stamper_locked(znode_t *, uint_t, dmu_tx_t *);
   254 extern void	zfs_grow_blocksize(znode_t *, uint64_t, dmu_tx_t *);
   246 extern void	zfs_grow_blocksize(znode_t *, uint64_t, dmu_tx_t *);
   255 extern int	zfs_freesp(znode_t *, uint64_t, uint64_t, int, boolean_t);
   247 extern int	zfs_freesp(znode_t *, uint64_t, uint64_t, int, boolean_t);
   256 extern void	zfs_znode_init(void);
   248 extern void	zfs_znode_init(void);
   261 extern void	zfs_znode_free(znode_t *);
   253 extern void	zfs_znode_free(znode_t *);
   262 extern void	zfs_remove_op_tables();
   254 extern void	zfs_remove_op_tables();
   263 extern int	zfs_create_op_tables();
   255 extern int	zfs_create_op_tables();
   264 extern int	zfs_sync(vfs_t *vfsp, short flag, cred_t *cr);
   256 extern int	zfs_sync(vfs_t *vfsp, short flag, cred_t *cr);
   265 extern dev_t	zfs_cmpldev(uint64_t);
   257 extern dev_t	zfs_cmpldev(uint64_t);
       
   258 extern int	zfs_get_stats(objset_t *os, nvlist_t *nv);
       
   259 extern int	zfs_set_version(const char *name, uint64_t newvers);
   266 
   260 
   267 extern void zfs_log_create(zilog_t *zilog, dmu_tx_t *tx, int txtype,
   261 extern void zfs_log_create(zilog_t *zilog, dmu_tx_t *tx, int txtype,
   268     znode_t *dzp, znode_t *zp, char *name);
   262     znode_t *dzp, znode_t *zp, char *name);
   269 extern void zfs_log_remove(zilog_t *zilog, dmu_tx_t *tx, int txtype,
   263 extern void zfs_log_remove(zilog_t *zilog, dmu_tx_t *tx, int txtype,
   270     znode_t *dzp, char *name);
   264     znode_t *dzp, char *name);