sys/vfs/hammer: Use typedef'd for struct hammer_mount*
authorTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Sun, 28 Aug 2016 11:06:34 +0000 (20:06 +0900)
committerTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Sun, 28 Aug 2016 11:45:41 +0000 (20:45 +0900)
The whole hammer code is mix of using struct and typedef'd.
Use typedef'd because majority of the code use typedef'd.

The last 17 commits including this one don't affect binary.

sys/vfs/hammer/hammer.h
sys/vfs/hammer/hammer_btree.c
sys/vfs/hammer/hammer_dedup.c
sys/vfs/hammer/hammer_flusher.c
sys/vfs/hammer/hammer_inode.c
sys/vfs/hammer/hammer_io.c
sys/vfs/hammer/hammer_ioctl.c
sys/vfs/hammer/hammer_transaction.c
sys/vfs/hammer/hammer_vfsops.c
sys/vfs/hammer/hammer_vnops.c
sys/vfs/hammer/hammer_volume.c

index 9a7514e..35f467b 100644 (file)
@@ -1348,11 +1348,11 @@ int64_t hammer_undo_max(hammer_mount_t hmp);
 int hammer_undo_reclaim(hammer_io_t io);
 
 void hammer_start_transaction(hammer_transaction_t trans,
-                             struct hammer_mount *hmp);
+                             hammer_mount_t hmp);
 void hammer_simple_transaction(hammer_transaction_t trans,
-                             struct hammer_mount *hmp);
+                             hammer_mount_t hmp);
 void hammer_start_transaction_fls(hammer_transaction_t trans,
-                                 struct hammer_mount *hmp);
+                                 hammer_mount_t hmp);
 void hammer_done_transaction(hammer_transaction_t trans);
 hammer_tid_t hammer_alloc_tid(hammer_mount_t hmp, int count);
 
index 8b5d642..773c0b9 100644 (file)
@@ -1943,7 +1943,7 @@ TAILQ_HEAD(hammer_rhb_list, hammer_rhb);
 int
 hammer_btree_correct_rhb(hammer_cursor_t cursor, hammer_tid_t tid)
 {
-       struct hammer_mount *hmp;
+       hammer_mount_t hmp;
        struct hammer_rhb_list rhb_list;
        hammer_base_elm_t elm;
        hammer_node_t orig_node;
@@ -2057,7 +2057,7 @@ hammer_btree_correct_lhb(hammer_cursor_t cursor, hammer_tid_t tid)
        hammer_base_elm_t elm;
        hammer_base_elm_t cmp;
        struct hammer_rhb *rhb;
-       struct hammer_mount *hmp;
+       hammer_mount_t hmp;
        int error;
 
        TAILQ_INIT(&rhb_list);
@@ -2635,7 +2635,7 @@ hammer_btree_lock_children(hammer_cursor_t cursor, int depth,
        hammer_node_ondisk_t ondisk;
        hammer_btree_elm_t elm;
        hammer_node_t child;
-       struct hammer_mount *hmp;
+       hammer_mount_t hmp;
        int error;
        int i;
 
index 9094642..71dbbc8 100644 (file)
@@ -208,7 +208,7 @@ RB_GENERATE2(hammer_dedup_off_rb_tree, hammer_dedup_cache, off_entry,
                hammer_dedup_off_rb_compare, hammer_off_t, data_offset);
 
 struct hammer_dedup_inval {
-       struct hammer_mount *hmp;
+       hammer_mount_t hmp;
        hammer_off_t base_offset;
 };
 
index 0b718d7..f2af31f 100644 (file)
@@ -55,7 +55,7 @@ RB_GENERATE(hammer_fls_rb_tree, hammer_inode, rb_flsnode,
  */
 struct hammer_flusher_info {
        TAILQ_ENTRY(hammer_flusher_info) entry;
-       struct hammer_mount *hmp;
+       hammer_mount_t  hmp;
        thread_t        td;
        int             runstate;
        hammer_flush_group_t flg;
index 7ae1af4..220fbc6 100644 (file)
@@ -941,7 +941,7 @@ hammer_create_inode(hammer_transaction_t trans, struct vattr *vap,
 static void
 hammer_free_inode(hammer_inode_t ip)
 {
-       struct hammer_mount *hmp;
+       hammer_mount_t hmp;
 
        hmp = ip->hmp;
        KKASSERT(hammer_oneref(&ip->lock));
index bd77434..23f59b4 100644 (file)
@@ -1004,7 +1004,7 @@ hammer_io_clear_modlist(hammer_io_t io)
 static void
 hammer_io_set_modlist(hammer_io_t io)
 {
-       struct hammer_mount *hmp = io->hmp;
+       hammer_mount_t hmp = io->hmp;
 
        lwkt_gettoken(&hmp->io_token);
        KKASSERT(io->mod_root == NULL);
@@ -1069,7 +1069,7 @@ static void
 hammer_io_complete(struct buf *bp)
 {
        hammer_io_t io = hammer_buf_peek_io(bp);
-       struct hammer_mount *hmp = io->hmp;
+       hammer_mount_t hmp = io->hmp;
        hammer_io_t ionext;
 
        lwkt_gettoken(&hmp->io_token);
index df35633..e570c34 100644 (file)
@@ -641,7 +641,7 @@ int
 hammer_ioc_get_info(hammer_transaction_t trans, struct hammer_ioc_info *info)
 {
        hammer_volume_ondisk_t ondisk = trans->hmp->rootvol->ondisk;
-       struct hammer_mount *hmp = trans->hmp;
+       hammer_mount_t hmp = trans->hmp;
 
        /* Fill the structure with the necessary information */
        _hammer_checkspace(hmp, HAMMER_CHKSPC_WRITE, &info->rsvbigblocks);
index 873a087..ab7af1d 100644 (file)
@@ -43,7 +43,7 @@ static uint32_t ocp_allocbit(hammer_objid_cache_t ocp, uint32_t n);
  * May be called without fs_token
  */
 void
-hammer_start_transaction(hammer_transaction_t trans, struct hammer_mount *hmp)
+hammer_start_transaction(hammer_transaction_t trans, hammer_mount_t hmp)
 {
        struct timeval tv;
        int error;
@@ -67,7 +67,7 @@ hammer_start_transaction(hammer_transaction_t trans, struct hammer_mount *hmp)
  * May be called without fs_token
  */
 void
-hammer_simple_transaction(hammer_transaction_t trans, struct hammer_mount *hmp)
+hammer_simple_transaction(hammer_transaction_t trans, hammer_mount_t hmp)
 {
        struct timeval tv;
        int error;
@@ -94,7 +94,7 @@ hammer_simple_transaction(hammer_transaction_t trans, struct hammer_mount *hmp)
  * (which the flusher is responsible for).
  */
 void
-hammer_start_transaction_fls(hammer_transaction_t trans, struct hammer_mount *hmp)
+hammer_start_transaction_fls(hammer_transaction_t trans, hammer_mount_t hmp)
 {
        struct timeval tv;
        int error;
index 9b5d701..90e081a 100644 (file)
@@ -966,7 +966,7 @@ hammer_vfs_vget(struct mount *mp, struct vnode *dvp,
                ino_t ino, struct vnode **vpp)
 {
        struct hammer_transaction trans;
-       struct hammer_mount *hmp = (void *)mp->mnt_data;
+       hammer_mount_t hmp = (void *)mp->mnt_data;
        hammer_inode_t ip;
        int error;
        uint32_t localization;
@@ -1023,7 +1023,7 @@ hammer_vfs_root(struct mount *mp, struct vnode **vpp)
 static int
 hammer_vfs_statfs(struct mount *mp, struct statfs *sbp, struct ucred *cred)
 {
-       struct hammer_mount *hmp = (void *)mp->mnt_data;
+       hammer_mount_t hmp = (void *)mp->mnt_data;
        hammer_volume_t volume;
        hammer_volume_ondisk_t ondisk;
        int error;
@@ -1061,7 +1061,7 @@ hammer_vfs_statfs(struct mount *mp, struct statfs *sbp, struct ucred *cred)
 static int
 hammer_vfs_statvfs(struct mount *mp, struct statvfs *sbp, struct ucred *cred)
 {
-       struct hammer_mount *hmp = (void *)mp->mnt_data;
+       hammer_mount_t hmp = (void *)mp->mnt_data;
        hammer_volume_t volume;
        hammer_volume_ondisk_t ondisk;
        int error;
@@ -1106,7 +1106,7 @@ hammer_vfs_statvfs(struct mount *mp, struct statvfs *sbp, struct ucred *cred)
 static int
 hammer_vfs_sync(struct mount *mp, int waitfor)
 {
-       struct hammer_mount *hmp = (void *)mp->mnt_data;
+       hammer_mount_t hmp = (void *)mp->mnt_data;
        int error;
 
        lwkt_gettoken(&hmp->fs_token);
index 75ce8ad..4e6d03b 100644 (file)
@@ -2536,7 +2536,7 @@ hammer_vop_mountctl(struct vop_mountctl_args *ap)
                { 0, NULL}
 
        };
-       struct hammer_mount *hmp;
+       hammer_mount_t hmp;
        struct mount *mp;
        int usedbytes;
        int error;
@@ -2545,7 +2545,7 @@ hammer_vop_mountctl(struct vop_mountctl_args *ap)
        usedbytes = 0;
        mp = ap->a_head.a_ops->head.vv_mount;
        KKASSERT(mp->mnt_data != NULL);
-       hmp = (struct hammer_mount *)mp->mnt_data;
+       hmp = (hammer_mount_t)mp->mnt_data;
 
        lwkt_gettoken(&hmp->fs_token);
 
index 8776eff..c631fe3 100644 (file)
@@ -63,7 +63,7 @@ int
 hammer_ioc_volume_add(hammer_transaction_t trans, hammer_inode_t ip,
                struct hammer_ioc_volume *ioc)
 {
-       struct hammer_mount *hmp = trans->hmp;
+       hammer_mount_t hmp = trans->hmp;
        struct mount *mp = hmp->mp;
        struct hammer_volume_ondisk ondisk;
        hammer_volume_t volume;
@@ -148,7 +148,7 @@ int
 hammer_ioc_volume_del(hammer_transaction_t trans, hammer_inode_t ip,
                struct hammer_ioc_volume *ioc)
 {
-       struct hammer_mount *hmp = trans->hmp;
+       hammer_mount_t hmp = trans->hmp;
        struct mount *mp = hmp->mp;
        struct hammer_volume_ondisk ondisk;
        hammer_volume_t volume;
@@ -291,7 +291,7 @@ int
 hammer_ioc_volume_list(hammer_transaction_t trans, hammer_inode_t ip,
     struct hammer_ioc_volume_list *ioc)
 {
-       struct hammer_mount *hmp = trans->hmp;
+       hammer_mount_t hmp = trans->hmp;
        hammer_volume_t volume;
        int error = 0;
        int i, len, cnt = 0;
@@ -329,7 +329,7 @@ static
 int
 hammer_do_reblock(hammer_transaction_t trans, hammer_inode_t ip)
 {
-       struct hammer_mount *hmp = trans->hmp;
+       hammer_mount_t hmp = trans->hmp;
        int error;
        int vol_no;
 
@@ -378,7 +378,7 @@ hammer_do_reblock(hammer_transaction_t trans, hammer_inode_t ip)
 static int
 hammer_format_freemap(hammer_transaction_t trans, hammer_volume_t volume)
 {
-       struct hammer_mount *hmp = trans->hmp;
+       hammer_mount_t hmp = trans->hmp;
        hammer_volume_ondisk_t ondisk;
        hammer_blockmap_t freemap;
        hammer_off_t alloc_offset;
@@ -498,7 +498,7 @@ end:
 static int
 hammer_free_freemap(hammer_transaction_t trans, hammer_volume_t volume)
 {
-       struct hammer_mount *hmp = trans->hmp;
+       hammer_mount_t hmp = trans->hmp;
        hammer_volume_ondisk_t ondisk;
        hammer_blockmap_t freemap;
        hammer_off_t phys_offset;
@@ -673,7 +673,7 @@ static int
 hammer_update_volumes_header(hammer_transaction_t trans,
        int64_t total_bigblocks, int64_t empty_bigblocks)
 {
-       struct hammer_mount *hmp = trans->hmp;
+       hammer_mount_t hmp = trans->hmp;
        struct mount *mp = hmp->mp;
        hammer_volume_t volume;
        int vol_no;