diff options
31 files changed, 122 insertions, 138 deletions
diff --git a/fs/xfs/linux-2.6/kmem.c b/fs/xfs/linux-2.6/kmem.c index 9b1bb17a0501..69233a52f0a6 100644 --- a/fs/xfs/linux-2.6/kmem.c +++ b/fs/xfs/linux-2.6/kmem.c | |||
@@ -90,7 +90,7 @@ kmem_zalloc_greedy(size_t *size, size_t minsize, size_t maxsize, | |||
90 | } | 90 | } |
91 | 91 | ||
92 | void | 92 | void |
93 | kmem_free(void *ptr, size_t size) | 93 | kmem_free(void *ptr) |
94 | { | 94 | { |
95 | if (!is_vmalloc_addr(ptr)) { | 95 | if (!is_vmalloc_addr(ptr)) { |
96 | kfree(ptr); | 96 | kfree(ptr); |
@@ -110,7 +110,7 @@ kmem_realloc(void *ptr, size_t newsize, size_t oldsize, | |||
110 | if (new) | 110 | if (new) |
111 | memcpy(new, ptr, | 111 | memcpy(new, ptr, |
112 | ((oldsize < newsize) ? oldsize : newsize)); | 112 | ((oldsize < newsize) ? oldsize : newsize)); |
113 | kmem_free(ptr, oldsize); | 113 | kmem_free(ptr); |
114 | } | 114 | } |
115 | return new; | 115 | return new; |
116 | } | 116 | } |
diff --git a/fs/xfs/linux-2.6/kmem.h b/fs/xfs/linux-2.6/kmem.h index a20683cf74dd..a3c96207e60e 100644 --- a/fs/xfs/linux-2.6/kmem.h +++ b/fs/xfs/linux-2.6/kmem.h | |||
@@ -58,7 +58,7 @@ extern void *kmem_alloc(size_t, unsigned int __nocast); | |||
58 | extern void *kmem_zalloc(size_t, unsigned int __nocast); | 58 | extern void *kmem_zalloc(size_t, unsigned int __nocast); |
59 | extern void *kmem_zalloc_greedy(size_t *, size_t, size_t, unsigned int __nocast); | 59 | extern void *kmem_zalloc_greedy(size_t *, size_t, size_t, unsigned int __nocast); |
60 | extern void *kmem_realloc(void *, size_t, size_t, unsigned int __nocast); | 60 | extern void *kmem_realloc(void *, size_t, size_t, unsigned int __nocast); |
61 | extern void kmem_free(void *, size_t); | 61 | extern void kmem_free(void *); |
62 | 62 | ||
63 | /* | 63 | /* |
64 | * Zone interfaces | 64 | * Zone interfaces |
diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c index 98e0e86093b4..ed03c6d3c9c1 100644 --- a/fs/xfs/linux-2.6/xfs_buf.c +++ b/fs/xfs/linux-2.6/xfs_buf.c | |||
@@ -310,8 +310,7 @@ _xfs_buf_free_pages( | |||
310 | xfs_buf_t *bp) | 310 | xfs_buf_t *bp) |
311 | { | 311 | { |
312 | if (bp->b_pages != bp->b_page_array) { | 312 | if (bp->b_pages != bp->b_page_array) { |
313 | kmem_free(bp->b_pages, | 313 | kmem_free(bp->b_pages); |
314 | bp->b_page_count * sizeof(struct page *)); | ||
315 | } | 314 | } |
316 | } | 315 | } |
317 | 316 | ||
@@ -1398,7 +1397,7 @@ STATIC void | |||
1398 | xfs_free_bufhash( | 1397 | xfs_free_bufhash( |
1399 | xfs_buftarg_t *btp) | 1398 | xfs_buftarg_t *btp) |
1400 | { | 1399 | { |
1401 | kmem_free(btp->bt_hash, (1<<btp->bt_hashshift) * sizeof(xfs_bufhash_t)); | 1400 | kmem_free(btp->bt_hash); |
1402 | btp->bt_hash = NULL; | 1401 | btp->bt_hash = NULL; |
1403 | } | 1402 | } |
1404 | 1403 | ||
@@ -1444,7 +1443,7 @@ xfs_free_buftarg( | |||
1444 | xfs_unregister_buftarg(btp); | 1443 | xfs_unregister_buftarg(btp); |
1445 | kthread_stop(btp->bt_task); | 1444 | kthread_stop(btp->bt_task); |
1446 | 1445 | ||
1447 | kmem_free(btp, sizeof(*btp)); | 1446 | kmem_free(btp); |
1448 | } | 1447 | } |
1449 | 1448 | ||
1450 | STATIC int | 1449 | STATIC int |
@@ -1575,7 +1574,7 @@ xfs_alloc_buftarg( | |||
1575 | return btp; | 1574 | return btp; |
1576 | 1575 | ||
1577 | error: | 1576 | error: |
1578 | kmem_free(btp, sizeof(*btp)); | 1577 | kmem_free(btp); |
1579 | return NULL; | 1578 | return NULL; |
1580 | } | 1579 | } |
1581 | 1580 | ||
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c index 1b60e46f527f..5c7144bc3106 100644 --- a/fs/xfs/linux-2.6/xfs_super.c +++ b/fs/xfs/linux-2.6/xfs_super.c | |||
@@ -1074,7 +1074,7 @@ xfssyncd( | |||
1074 | list_del(&work->w_list); | 1074 | list_del(&work->w_list); |
1075 | if (work == &mp->m_sync_work) | 1075 | if (work == &mp->m_sync_work) |
1076 | continue; | 1076 | continue; |
1077 | kmem_free(work, sizeof(struct bhv_vfs_sync_work)); | 1077 | kmem_free(work); |
1078 | } | 1078 | } |
1079 | } | 1079 | } |
1080 | 1080 | ||
@@ -1222,7 +1222,7 @@ xfs_fs_remount( | |||
1222 | error = xfs_parseargs(mp, options, args, 1); | 1222 | error = xfs_parseargs(mp, options, args, 1); |
1223 | if (!error) | 1223 | if (!error) |
1224 | error = xfs_mntupdate(mp, flags, args); | 1224 | error = xfs_mntupdate(mp, flags, args); |
1225 | kmem_free(args, sizeof(*args)); | 1225 | kmem_free(args); |
1226 | return -error; | 1226 | return -error; |
1227 | } | 1227 | } |
1228 | 1228 | ||
@@ -1369,7 +1369,7 @@ xfs_fs_fill_super( | |||
1369 | 1369 | ||
1370 | xfs_itrace_exit(XFS_I(sb->s_root->d_inode)); | 1370 | xfs_itrace_exit(XFS_I(sb->s_root->d_inode)); |
1371 | 1371 | ||
1372 | kmem_free(args, sizeof(*args)); | 1372 | kmem_free(args); |
1373 | return 0; | 1373 | return 0; |
1374 | 1374 | ||
1375 | fail_vnrele: | 1375 | fail_vnrele: |
@@ -1384,7 +1384,7 @@ fail_unmount: | |||
1384 | xfs_unmount(mp, 0, NULL); | 1384 | xfs_unmount(mp, 0, NULL); |
1385 | 1385 | ||
1386 | fail_vfsop: | 1386 | fail_vfsop: |
1387 | kmem_free(args, sizeof(*args)); | 1387 | kmem_free(args); |
1388 | return -error; | 1388 | return -error; |
1389 | } | 1389 | } |
1390 | 1390 | ||
diff --git a/fs/xfs/quota/xfs_dquot_item.c b/fs/xfs/quota/xfs_dquot_item.c index 36e05ca78412..08d2fc89e6a1 100644 --- a/fs/xfs/quota/xfs_dquot_item.c +++ b/fs/xfs/quota/xfs_dquot_item.c | |||
@@ -576,8 +576,8 @@ xfs_qm_qoffend_logitem_committed( | |||
576 | * xfs_trans_delete_ail() drops the AIL lock. | 576 | * xfs_trans_delete_ail() drops the AIL lock. |
577 | */ | 577 | */ |
578 | xfs_trans_delete_ail(qfs->qql_item.li_mountp, (xfs_log_item_t *)qfs); | 578 | xfs_trans_delete_ail(qfs->qql_item.li_mountp, (xfs_log_item_t *)qfs); |
579 | kmem_free(qfs, sizeof(xfs_qoff_logitem_t)); | 579 | kmem_free(qfs); |
580 | kmem_free(qfe, sizeof(xfs_qoff_logitem_t)); | 580 | kmem_free(qfe); |
581 | return (xfs_lsn_t)-1; | 581 | return (xfs_lsn_t)-1; |
582 | } | 582 | } |
583 | 583 | ||
diff --git a/fs/xfs/quota/xfs_qm.c b/fs/xfs/quota/xfs_qm.c index d31cce1165c5..cde5c508f0e0 100644 --- a/fs/xfs/quota/xfs_qm.c +++ b/fs/xfs/quota/xfs_qm.c | |||
@@ -192,8 +192,8 @@ xfs_qm_destroy( | |||
192 | xfs_qm_list_destroy(&(xqm->qm_usr_dqhtable[i])); | 192 | xfs_qm_list_destroy(&(xqm->qm_usr_dqhtable[i])); |
193 | xfs_qm_list_destroy(&(xqm->qm_grp_dqhtable[i])); | 193 | xfs_qm_list_destroy(&(xqm->qm_grp_dqhtable[i])); |
194 | } | 194 | } |
195 | kmem_free(xqm->qm_usr_dqhtable, hsize * sizeof(xfs_dqhash_t)); | 195 | kmem_free(xqm->qm_usr_dqhtable); |
196 | kmem_free(xqm->qm_grp_dqhtable, hsize * sizeof(xfs_dqhash_t)); | 196 | kmem_free(xqm->qm_grp_dqhtable); |
197 | xqm->qm_usr_dqhtable = NULL; | 197 | xqm->qm_usr_dqhtable = NULL; |
198 | xqm->qm_grp_dqhtable = NULL; | 198 | xqm->qm_grp_dqhtable = NULL; |
199 | xqm->qm_dqhashmask = 0; | 199 | xqm->qm_dqhashmask = 0; |
@@ -201,7 +201,7 @@ xfs_qm_destroy( | |||
201 | #ifdef DEBUG | 201 | #ifdef DEBUG |
202 | mutex_destroy(&qcheck_lock); | 202 | mutex_destroy(&qcheck_lock); |
203 | #endif | 203 | #endif |
204 | kmem_free(xqm, sizeof(xfs_qm_t)); | 204 | kmem_free(xqm); |
205 | } | 205 | } |
206 | 206 | ||
207 | /* | 207 | /* |
@@ -1134,7 +1134,7 @@ xfs_qm_init_quotainfo( | |||
1134 | * and change the superblock accordingly. | 1134 | * and change the superblock accordingly. |
1135 | */ | 1135 | */ |
1136 | if ((error = xfs_qm_init_quotainos(mp))) { | 1136 | if ((error = xfs_qm_init_quotainos(mp))) { |
1137 | kmem_free(qinf, sizeof(xfs_quotainfo_t)); | 1137 | kmem_free(qinf); |
1138 | mp->m_quotainfo = NULL; | 1138 | mp->m_quotainfo = NULL; |
1139 | return error; | 1139 | return error; |
1140 | } | 1140 | } |
@@ -1248,7 +1248,7 @@ xfs_qm_destroy_quotainfo( | |||
1248 | qi->qi_gquotaip = NULL; | 1248 | qi->qi_gquotaip = NULL; |
1249 | } | 1249 | } |
1250 | mutex_destroy(&qi->qi_quotaofflock); | 1250 | mutex_destroy(&qi->qi_quotaofflock); |
1251 | kmem_free(qi, sizeof(xfs_quotainfo_t)); | 1251 | kmem_free(qi); |
1252 | mp->m_quotainfo = NULL; | 1252 | mp->m_quotainfo = NULL; |
1253 | } | 1253 | } |
1254 | 1254 | ||
@@ -1623,7 +1623,7 @@ xfs_qm_dqiterate( | |||
1623 | break; | 1623 | break; |
1624 | } while (nmaps > 0); | 1624 | } while (nmaps > 0); |
1625 | 1625 | ||
1626 | kmem_free(map, XFS_DQITER_MAP_SIZE * sizeof(*map)); | 1626 | kmem_free(map); |
1627 | 1627 | ||
1628 | return error; | 1628 | return error; |
1629 | } | 1629 | } |
diff --git a/fs/xfs/quota/xfs_qm_syscalls.c b/fs/xfs/quota/xfs_qm_syscalls.c index 768a3b27d2b6..413671523cb5 100644 --- a/fs/xfs/quota/xfs_qm_syscalls.c +++ b/fs/xfs/quota/xfs_qm_syscalls.c | |||
@@ -1449,14 +1449,14 @@ xfs_qm_internalqcheck( | |||
1449 | for (d = (xfs_dqtest_t *) h1->qh_next; d != NULL; ) { | 1449 | for (d = (xfs_dqtest_t *) h1->qh_next; d != NULL; ) { |
1450 | xfs_dqtest_cmp(d); | 1450 | xfs_dqtest_cmp(d); |
1451 | e = (xfs_dqtest_t *) d->HL_NEXT; | 1451 | e = (xfs_dqtest_t *) d->HL_NEXT; |
1452 | kmem_free(d, sizeof(xfs_dqtest_t)); | 1452 | kmem_free(d); |
1453 | d = e; | 1453 | d = e; |
1454 | } | 1454 | } |
1455 | h1 = &qmtest_gdqtab[i]; | 1455 | h1 = &qmtest_gdqtab[i]; |
1456 | for (d = (xfs_dqtest_t *) h1->qh_next; d != NULL; ) { | 1456 | for (d = (xfs_dqtest_t *) h1->qh_next; d != NULL; ) { |
1457 | xfs_dqtest_cmp(d); | 1457 | xfs_dqtest_cmp(d); |
1458 | e = (xfs_dqtest_t *) d->HL_NEXT; | 1458 | e = (xfs_dqtest_t *) d->HL_NEXT; |
1459 | kmem_free(d, sizeof(xfs_dqtest_t)); | 1459 | kmem_free(d); |
1460 | d = e; | 1460 | d = e; |
1461 | } | 1461 | } |
1462 | } | 1462 | } |
@@ -1467,8 +1467,8 @@ xfs_qm_internalqcheck( | |||
1467 | } else { | 1467 | } else { |
1468 | cmn_err(CE_DEBUG, "******** quotacheck successful! ********"); | 1468 | cmn_err(CE_DEBUG, "******** quotacheck successful! ********"); |
1469 | } | 1469 | } |
1470 | kmem_free(qmtest_udqtab, qmtest_hashmask * sizeof(xfs_dqhash_t)); | 1470 | kmem_free(qmtest_udqtab); |
1471 | kmem_free(qmtest_gdqtab, qmtest_hashmask * sizeof(xfs_dqhash_t)); | 1471 | kmem_free(qmtest_gdqtab); |
1472 | mutex_unlock(&qcheck_lock); | 1472 | mutex_unlock(&qcheck_lock); |
1473 | return (qmtest_nfails); | 1473 | return (qmtest_nfails); |
1474 | } | 1474 | } |
diff --git a/fs/xfs/support/ktrace.c b/fs/xfs/support/ktrace.c index 0b75d302508f..a34ef05489b1 100644 --- a/fs/xfs/support/ktrace.c +++ b/fs/xfs/support/ktrace.c | |||
@@ -89,7 +89,7 @@ ktrace_alloc(int nentries, unsigned int __nocast sleep) | |||
89 | if (sleep & KM_SLEEP) | 89 | if (sleep & KM_SLEEP) |
90 | panic("ktrace_alloc: NULL memory on KM_SLEEP request!"); | 90 | panic("ktrace_alloc: NULL memory on KM_SLEEP request!"); |
91 | 91 | ||
92 | kmem_free(ktp, sizeof(*ktp)); | 92 | kmem_free(ktp); |
93 | 93 | ||
94 | return NULL; | 94 | return NULL; |
95 | } | 95 | } |
@@ -126,7 +126,7 @@ ktrace_free(ktrace_t *ktp) | |||
126 | } else { | 126 | } else { |
127 | entries_size = (int)(ktp->kt_nentries * sizeof(ktrace_entry_t)); | 127 | entries_size = (int)(ktp->kt_nentries * sizeof(ktrace_entry_t)); |
128 | 128 | ||
129 | kmem_free(ktp->kt_entries, entries_size); | 129 | kmem_free(ktp->kt_entries); |
130 | } | 130 | } |
131 | 131 | ||
132 | kmem_zone_free(ktrace_hdr_zone, ktp); | 132 | kmem_zone_free(ktrace_hdr_zone, ktp); |
diff --git a/fs/xfs/xfs_attr_leaf.c b/fs/xfs/xfs_attr_leaf.c index 303d41e4217b..a85e9caf0156 100644 --- a/fs/xfs/xfs_attr_leaf.c +++ b/fs/xfs/xfs_attr_leaf.c | |||
@@ -555,7 +555,7 @@ xfs_attr_shortform_to_leaf(xfs_da_args_t *args) | |||
555 | out: | 555 | out: |
556 | if(bp) | 556 | if(bp) |
557 | xfs_da_buf_done(bp); | 557 | xfs_da_buf_done(bp); |
558 | kmem_free(tmpbuffer, size); | 558 | kmem_free(tmpbuffer); |
559 | return(error); | 559 | return(error); |
560 | } | 560 | } |
561 | 561 | ||
@@ -676,7 +676,7 @@ xfs_attr_shortform_list(xfs_attr_list_context_t *context) | |||
676 | XFS_ERRLEVEL_LOW, | 676 | XFS_ERRLEVEL_LOW, |
677 | context->dp->i_mount, sfe); | 677 | context->dp->i_mount, sfe); |
678 | xfs_attr_trace_l_c("sf corrupted", context); | 678 | xfs_attr_trace_l_c("sf corrupted", context); |
679 | kmem_free(sbuf, sbsize); | 679 | kmem_free(sbuf); |
680 | return XFS_ERROR(EFSCORRUPTED); | 680 | return XFS_ERROR(EFSCORRUPTED); |
681 | } | 681 | } |
682 | if (!xfs_attr_namesp_match_overrides(context->flags, sfe->flags)) { | 682 | if (!xfs_attr_namesp_match_overrides(context->flags, sfe->flags)) { |
@@ -717,7 +717,7 @@ xfs_attr_shortform_list(xfs_attr_list_context_t *context) | |||
717 | } | 717 | } |
718 | } | 718 | } |
719 | if (i == nsbuf) { | 719 | if (i == nsbuf) { |
720 | kmem_free(sbuf, sbsize); | 720 | kmem_free(sbuf); |
721 | xfs_attr_trace_l_c("blk end", context); | 721 | xfs_attr_trace_l_c("blk end", context); |
722 | return(0); | 722 | return(0); |
723 | } | 723 | } |
@@ -747,7 +747,7 @@ xfs_attr_shortform_list(xfs_attr_list_context_t *context) | |||
747 | cursor->offset++; | 747 | cursor->offset++; |
748 | } | 748 | } |
749 | 749 | ||
750 | kmem_free(sbuf, sbsize); | 750 | kmem_free(sbuf); |
751 | xfs_attr_trace_l_c("sf E-O-F", context); | 751 | xfs_attr_trace_l_c("sf E-O-F", context); |
752 | return(0); | 752 | return(0); |
753 | } | 753 | } |
@@ -873,7 +873,7 @@ xfs_attr_leaf_to_shortform(xfs_dabuf_t *bp, xfs_da_args_t *args, int forkoff) | |||
873 | error = 0; | 873 | error = 0; |
874 | 874 | ||
875 | out: | 875 | out: |
876 | kmem_free(tmpbuffer, XFS_LBSIZE(dp->i_mount)); | 876 | kmem_free(tmpbuffer); |
877 | return(error); | 877 | return(error); |
878 | } | 878 | } |
879 | 879 | ||
@@ -1271,7 +1271,7 @@ xfs_attr_leaf_compact(xfs_trans_t *trans, xfs_dabuf_t *bp) | |||
1271 | be16_to_cpu(hdr_s->count), mp); | 1271 | be16_to_cpu(hdr_s->count), mp); |
1272 | xfs_da_log_buf(trans, bp, 0, XFS_LBSIZE(mp) - 1); | 1272 | xfs_da_log_buf(trans, bp, 0, XFS_LBSIZE(mp) - 1); |
1273 | 1273 | ||
1274 | kmem_free(tmpbuffer, XFS_LBSIZE(mp)); | 1274 | kmem_free(tmpbuffer); |
1275 | } | 1275 | } |
1276 | 1276 | ||
1277 | /* | 1277 | /* |
@@ -1921,7 +1921,7 @@ xfs_attr_leaf_unbalance(xfs_da_state_t *state, xfs_da_state_blk_t *drop_blk, | |||
1921 | be16_to_cpu(drop_hdr->count), mp); | 1921 | be16_to_cpu(drop_hdr->count), mp); |
1922 | } | 1922 | } |
1923 | memcpy((char *)save_leaf, (char *)tmp_leaf, state->blocksize); | 1923 | memcpy((char *)save_leaf, (char *)tmp_leaf, state->blocksize); |
1924 | kmem_free(tmpbuffer, state->blocksize); | 1924 | kmem_free(tmpbuffer); |
1925 | } | 1925 | } |
1926 | 1926 | ||
1927 | xfs_da_log_buf(state->args->trans, save_blk->bp, 0, | 1927 | xfs_da_log_buf(state->args->trans, save_blk->bp, 0, |
@@ -2451,7 +2451,7 @@ xfs_attr_leaf_list_int(xfs_dabuf_t *bp, xfs_attr_list_context_t *context) | |||
2451 | (int)name_rmt->namelen, | 2451 | (int)name_rmt->namelen, |
2452 | valuelen, | 2452 | valuelen, |
2453 | (char*)args.value); | 2453 | (char*)args.value); |
2454 | kmem_free(args.value, valuelen); | 2454 | kmem_free(args.value); |
2455 | } | 2455 | } |
2456 | else { | 2456 | else { |
2457 | retval = context->put_listent(context, | 2457 | retval = context->put_listent(context, |
@@ -2954,7 +2954,7 @@ xfs_attr_leaf_inactive(xfs_trans_t **trans, xfs_inode_t *dp, xfs_dabuf_t *bp) | |||
2954 | error = tmp; /* save only the 1st errno */ | 2954 | error = tmp; /* save only the 1st errno */ |
2955 | } | 2955 | } |
2956 | 2956 | ||
2957 | kmem_free((xfs_caddr_t)list, size); | 2957 | kmem_free((xfs_caddr_t)list); |
2958 | return(error); | 2958 | return(error); |
2959 | } | 2959 | } |
2960 | 2960 | ||
diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c index 53c259f5a5af..a612a90aae4a 100644 --- a/fs/xfs/xfs_bmap.c +++ b/fs/xfs/xfs_bmap.c | |||
@@ -5970,7 +5970,7 @@ unlock_and_return: | |||
5970 | xfs_iunlock_map_shared(ip, lock); | 5970 | xfs_iunlock_map_shared(ip, lock); |
5971 | xfs_iunlock(ip, XFS_IOLOCK_SHARED); | 5971 | xfs_iunlock(ip, XFS_IOLOCK_SHARED); |
5972 | 5972 | ||
5973 | kmem_free(map, subnex * sizeof(*map)); | 5973 | kmem_free(map); |
5974 | 5974 | ||
5975 | return error; | 5975 | return error; |
5976 | } | 5976 | } |
diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c index 53a71c62025d..d86ca2c03a70 100644 --- a/fs/xfs/xfs_buf_item.c +++ b/fs/xfs/xfs_buf_item.c | |||
@@ -889,9 +889,9 @@ xfs_buf_item_relse( | |||
889 | } | 889 | } |
890 | 890 | ||
891 | #ifdef XFS_TRANS_DEBUG | 891 | #ifdef XFS_TRANS_DEBUG |
892 | kmem_free(bip->bli_orig, XFS_BUF_COUNT(bp)); | 892 | kmem_free(bip->bli_orig); |
893 | bip->bli_orig = NULL; | 893 | bip->bli_orig = NULL; |
894 | kmem_free(bip->bli_logged, XFS_BUF_COUNT(bp) / NBBY); | 894 | kmem_free(bip->bli_logged); |
895 | bip->bli_logged = NULL; | 895 | bip->bli_logged = NULL; |
896 | #endif /* XFS_TRANS_DEBUG */ | 896 | #endif /* XFS_TRANS_DEBUG */ |
897 | 897 | ||
@@ -1138,9 +1138,9 @@ xfs_buf_iodone( | |||
1138 | xfs_trans_delete_ail(mp, (xfs_log_item_t *)bip); | 1138 | xfs_trans_delete_ail(mp, (xfs_log_item_t *)bip); |
1139 | 1139 | ||
1140 | #ifdef XFS_TRANS_DEBUG | 1140 | #ifdef XFS_TRANS_DEBUG |
1141 | kmem_free(bip->bli_orig, XFS_BUF_COUNT(bp)); | 1141 | kmem_free(bip->bli_orig); |
1142 | bip->bli_orig = NULL; | 1142 | bip->bli_orig = NULL; |
1143 | kmem_free(bip->bli_logged, XFS_BUF_COUNT(bp) / NBBY); | 1143 | kmem_free(bip->bli_logged); |
1144 | bip->bli_logged = NULL; | 1144 | bip->bli_logged = NULL; |
1145 | #endif /* XFS_TRANS_DEBUG */ | 1145 | #endif /* XFS_TRANS_DEBUG */ |
1146 | 1146 | ||
diff --git a/fs/xfs/xfs_da_btree.c b/fs/xfs/xfs_da_btree.c index 021a8f7e563f..294780427abb 100644 --- a/fs/xfs/xfs_da_btree.c +++ b/fs/xfs/xfs_da_btree.c | |||
@@ -1598,7 +1598,7 @@ xfs_da_grow_inode(xfs_da_args_t *args, xfs_dablk_t *new_blkno) | |||
1598 | args->firstblock, args->total, | 1598 | args->firstblock, args->total, |
1599 | &mapp[mapi], &nmap, args->flist, | 1599 | &mapp[mapi], &nmap, args->flist, |
1600 | NULL))) { | 1600 | NULL))) { |
1601 | kmem_free(mapp, sizeof(*mapp) * count); | 1601 | kmem_free(mapp); |
1602 | return error; | 1602 | return error; |
1603 | } | 1603 | } |
1604 | if (nmap < 1) | 1604 | if (nmap < 1) |
@@ -1620,11 +1620,11 @@ xfs_da_grow_inode(xfs_da_args_t *args, xfs_dablk_t *new_blkno) | |||
1620 | mapp[mapi - 1].br_startoff + mapp[mapi - 1].br_blockcount != | 1620 | mapp[mapi - 1].br_startoff + mapp[mapi - 1].br_blockcount != |
1621 | bno + count) { | 1621 | bno + count) { |
1622 | if (mapp != &map) | 1622 | if (mapp != &map) |
1623 | kmem_free(mapp, sizeof(*mapp) * count); | 1623 | kmem_free(mapp); |
1624 | return XFS_ERROR(ENOSPC); | 1624 | return XFS_ERROR(ENOSPC); |
1625 | } | 1625 | } |
1626 | if (mapp != &map) | 1626 | if (mapp != &map) |
1627 | kmem_free(mapp, sizeof(*mapp) * count); | 1627 | kmem_free(mapp); |
1628 | *new_blkno = (xfs_dablk_t)bno; | 1628 | *new_blkno = (xfs_dablk_t)bno; |
1629 | return 0; | 1629 | return 0; |
1630 | } | 1630 | } |
@@ -2090,10 +2090,10 @@ xfs_da_do_buf( | |||
2090 | } | 2090 | } |
2091 | } | 2091 | } |
2092 | if (bplist) { | 2092 | if (bplist) { |
2093 | kmem_free(bplist, sizeof(*bplist) * nmap); | 2093 | kmem_free(bplist); |
2094 | } | 2094 | } |
2095 | if (mapp != &map) { | 2095 | if (mapp != &map) { |
2096 | kmem_free(mapp, sizeof(*mapp) * nfsb); | 2096 | kmem_free(mapp); |
2097 | } | 2097 | } |
2098 | if (bpp) | 2098 | if (bpp) |
2099 | *bpp = rbp; | 2099 | *bpp = rbp; |
@@ -2102,11 +2102,11 @@ exit1: | |||
2102 | if (bplist) { | 2102 | if (bplist) { |
2103 | for (i = 0; i < nbplist; i++) | 2103 | for (i = 0; i < nbplist; i++) |
2104 | xfs_trans_brelse(trans, bplist[i]); | 2104 | xfs_trans_brelse(trans, bplist[i]); |
2105 | kmem_free(bplist, sizeof(*bplist) * nmap); | 2105 | kmem_free(bplist); |
2106 | } | 2106 | } |
2107 | exit0: | 2107 | exit0: |
2108 | if (mapp != &map) | 2108 | if (mapp != &map) |
2109 | kmem_free(mapp, sizeof(*mapp) * nfsb); | 2109 | kmem_free(mapp); |
2110 | if (bpp) | 2110 | if (bpp) |
2111 | *bpp = NULL; | 2111 | *bpp = NULL; |
2112 | return error; | 2112 | return error; |
@@ -2315,7 +2315,7 @@ xfs_da_buf_done(xfs_dabuf_t *dabuf) | |||
2315 | if (dabuf->dirty) | 2315 | if (dabuf->dirty) |
2316 | xfs_da_buf_clean(dabuf); | 2316 | xfs_da_buf_clean(dabuf); |
2317 | if (dabuf->nbuf > 1) | 2317 | if (dabuf->nbuf > 1) |
2318 | kmem_free(dabuf->data, BBTOB(dabuf->bbcount)); | 2318 | kmem_free(dabuf->data); |
2319 | #ifdef XFS_DABUF_DEBUG | 2319 | #ifdef XFS_DABUF_DEBUG |
2320 | { | 2320 | { |
2321 | spin_lock(&xfs_dabuf_global_lock); | 2321 | spin_lock(&xfs_dabuf_global_lock); |
@@ -2332,7 +2332,7 @@ xfs_da_buf_done(xfs_dabuf_t *dabuf) | |||
2332 | if (dabuf->nbuf == 1) | 2332 | if (dabuf->nbuf == 1) |
2333 | kmem_zone_free(xfs_dabuf_zone, dabuf); | 2333 | kmem_zone_free(xfs_dabuf_zone, dabuf); |
2334 | else | 2334 | else |
2335 | kmem_free(dabuf, XFS_DA_BUF_SIZE(dabuf->nbuf)); | 2335 | kmem_free(dabuf); |
2336 | } | 2336 | } |
2337 | 2337 | ||
2338 | /* | 2338 | /* |
@@ -2403,7 +2403,7 @@ xfs_da_brelse(xfs_trans_t *tp, xfs_dabuf_t *dabuf) | |||
2403 | for (i = 0; i < nbuf; i++) | 2403 | for (i = 0; i < nbuf; i++) |
2404 | xfs_trans_brelse(tp, bplist[i]); | 2404 | xfs_trans_brelse(tp, bplist[i]); |
2405 | if (bplist != &bp) | 2405 | if (bplist != &bp) |
2406 | kmem_free(bplist, nbuf * sizeof(*bplist)); | 2406 | kmem_free(bplist); |
2407 | } | 2407 | } |
2408 | 2408 | ||
2409 | /* | 2409 | /* |
@@ -2429,7 +2429,7 @@ xfs_da_binval(xfs_trans_t *tp, xfs_dabuf_t *dabuf) | |||
2429 | for (i = 0; i < nbuf; i++) | 2429 | for (i = 0; i < nbuf; i++) |
2430 | xfs_trans_binval(tp, bplist[i]); | 2430 | xfs_trans_binval(tp, bplist[i]); |
2431 | if (bplist != &bp) | 2431 | if (bplist != &bp) |
2432 | kmem_free(bplist, nbuf * sizeof(*bplist)); | 2432 | kmem_free(bplist); |
2433 | } | 2433 | } |
2434 | 2434 | ||
2435 | /* | 2435 | /* |
diff --git a/fs/xfs/xfs_dfrag.c b/fs/xfs/xfs_dfrag.c index 5f3647cb9885..2211e885ef24 100644 --- a/fs/xfs/xfs_dfrag.c +++ b/fs/xfs/xfs_dfrag.c | |||
@@ -116,7 +116,7 @@ xfs_swapext( | |||
116 | out_put_file: | 116 | out_put_file: |
117 | fput(file); | 117 | fput(file); |
118 | out_free_sxp: | 118 | out_free_sxp: |
119 | kmem_free(sxp, sizeof(xfs_swapext_t)); | 119 | kmem_free(sxp); |
120 | out: | 120 | out: |
121 | return error; | 121 | return error; |
122 | } | 122 | } |
@@ -381,6 +381,6 @@ xfs_swap_extents( | |||
381 | xfs_iunlock(tip, lock_flags); | 381 | xfs_iunlock(tip, lock_flags); |
382 | } | 382 | } |
383 | if (tempifp != NULL) | 383 | if (tempifp != NULL) |
384 | kmem_free(tempifp, sizeof(xfs_ifork_t)); | 384 | kmem_free(tempifp); |
385 | return error; | 385 | return error; |
386 | } | 386 | } |
diff --git a/fs/xfs/xfs_dir2.c b/fs/xfs/xfs_dir2.c index 7cb26529766b..0284af1734bd 100644 --- a/fs/xfs/xfs_dir2.c +++ b/fs/xfs/xfs_dir2.c | |||
@@ -493,7 +493,7 @@ xfs_dir2_grow_inode( | |||
493 | args->firstblock, args->total, | 493 | args->firstblock, args->total, |
494 | &mapp[mapi], &nmap, args->flist, | 494 | &mapp[mapi], &nmap, args->flist, |
495 | NULL))) { | 495 | NULL))) { |
496 | kmem_free(mapp, sizeof(*mapp) * count); | 496 | kmem_free(mapp); |
497 | return error; | 497 | return error; |
498 | } | 498 | } |
499 | if (nmap < 1) | 499 | if (nmap < 1) |
@@ -525,14 +525,14 @@ xfs_dir2_grow_inode( | |||
525 | mapp[mapi - 1].br_startoff + mapp[mapi - 1].br_blockcount != | 525 | mapp[mapi - 1].br_startoff + mapp[mapi - 1].br_blockcount != |
526 | bno + count) { | 526 | bno + count) { |
527 | if (mapp != &map) | 527 | if (mapp != &map) |
528 | kmem_free(mapp, sizeof(*mapp) * count); | 528 | kmem_free(mapp); |
529 | return XFS_ERROR(ENOSPC); | 529 | return XFS_ERROR(ENOSPC); |
530 | } | 530 | } |
531 | /* | 531 | /* |
532 | * Done with the temporary mapping table. | 532 | * Done with the temporary mapping table. |
533 | */ | 533 | */ |
534 | if (mapp != &map) | 534 | if (mapp != &map) |
535 | kmem_free(mapp, sizeof(*mapp) * count); | 535 | kmem_free(mapp); |
536 | *dbp = xfs_dir2_da_to_db(mp, (xfs_dablk_t)bno); | 536 | *dbp = xfs_dir2_da_to_db(mp, (xfs_dablk_t)bno); |
537 | /* | 537 | /* |
538 | * Update file's size if this is the data space and it grew. | 538 | * Update file's size if this is the data space and it grew. |
diff --git a/fs/xfs/xfs_dir2_block.c b/fs/xfs/xfs_dir2_block.c index fb5a556725b3..e8a7aca5fe23 100644 --- a/fs/xfs/xfs_dir2_block.c +++ b/fs/xfs/xfs_dir2_block.c | |||
@@ -1071,7 +1071,7 @@ xfs_dir2_sf_to_block( | |||
1071 | */ | 1071 | */ |
1072 | error = xfs_dir2_grow_inode(args, XFS_DIR2_DATA_SPACE, &blkno); | 1072 | error = xfs_dir2_grow_inode(args, XFS_DIR2_DATA_SPACE, &blkno); |
1073 | if (error) { | 1073 | if (error) { |
1074 | kmem_free(buf, buf_len); | 1074 | kmem_free(buf); |
1075 | return error; | 1075 | return error; |
1076 | } | 1076 | } |
1077 | /* | 1077 | /* |
@@ -1079,7 +1079,7 @@ xfs_dir2_sf_to_block( | |||
1079 | */ | 1079 | */ |
1080 | error = xfs_dir2_data_init(args, blkno, &bp); | 1080 | error = xfs_dir2_data_init(args, blkno, &bp); |
1081 | if (error) { | 1081 | if (error) { |
1082 | kmem_free(buf, buf_len); | 1082 | kmem_free(buf); |
1083 | return error; | 1083 | return error; |
1084 | } | 1084 | } |
1085 | block = bp->data; | 1085 | block = bp->data; |
@@ -1198,7 +1198,7 @@ xfs_dir2_sf_to_block( | |||
1198 | sfep = xfs_dir2_sf_nextentry(sfp, sfep); | 1198 | sfep = xfs_dir2_sf_nextentry(sfp, sfep); |
1199 | } | 1199 | } |
1200 | /* Done with the temporary buffer */ | 1200 | /* Done with the temporary buffer */ |
1201 | kmem_free(buf, buf_len); | 1201 | kmem_free(buf); |
1202 | /* | 1202 | /* |
1203 | * Sort the leaf entries by hash value. | 1203 | * Sort the leaf entries by hash value. |
1204 | */ | 1204 | */ |
diff --git a/fs/xfs/xfs_dir2_leaf.c b/fs/xfs/xfs_dir2_leaf.c index bc52b803d79b..e33433408e4a 100644 --- a/fs/xfs/xfs_dir2_leaf.c +++ b/fs/xfs/xfs_dir2_leaf.c | |||
@@ -1110,7 +1110,7 @@ xfs_dir2_leaf_getdents( | |||
1110 | *offset = XFS_DIR2_MAX_DATAPTR; | 1110 | *offset = XFS_DIR2_MAX_DATAPTR; |
1111 | else | 1111 | else |
1112 | *offset = xfs_dir2_byte_to_dataptr(mp, curoff); | 1112 | *offset = xfs_dir2_byte_to_dataptr(mp, curoff); |
1113 | kmem_free(map, map_size * sizeof(*map)); | 1113 | kmem_free(map); |
1114 | if (bp) | 1114 | if (bp) |
1115 | xfs_da_brelse(NULL, bp); | 1115 | xfs_da_brelse(NULL, bp); |
1116 | return error; | 1116 | return error; |
diff --git a/fs/xfs/xfs_dir2_sf.c b/fs/xfs/xfs_dir2_sf.c index 919d275a1cef..ca33bc62edc2 100644 --- a/fs/xfs/xfs_dir2_sf.c +++ b/fs/xfs/xfs_dir2_sf.c | |||
@@ -255,7 +255,7 @@ xfs_dir2_block_to_sf( | |||
255 | xfs_dir2_sf_check(args); | 255 | xfs_dir2_sf_check(args); |
256 | out: | 256 | out: |
257 | xfs_trans_log_inode(args->trans, dp, logflags); | 257 | xfs_trans_log_inode(args->trans, dp, logflags); |
258 | kmem_free(block, mp->m_dirblksize); | 258 | kmem_free(block); |
259 | return error; | 259 | return error; |
260 | } | 260 | } |
261 | 261 | ||
@@ -512,7 +512,7 @@ xfs_dir2_sf_addname_hard( | |||
512 | sfep = xfs_dir2_sf_nextentry(sfp, sfep); | 512 | sfep = xfs_dir2_sf_nextentry(sfp, sfep); |
513 | memcpy(sfep, oldsfep, old_isize - nbytes); | 513 | memcpy(sfep, oldsfep, old_isize - nbytes); |
514 | } | 514 | } |
515 | kmem_free(buf, old_isize); | 515 | kmem_free(buf); |
516 | dp->i_d.di_size = new_isize; | 516 | dp->i_d.di_size = new_isize; |
517 | xfs_dir2_sf_check(args); | 517 | xfs_dir2_sf_check(args); |
518 | } | 518 | } |
@@ -1174,7 +1174,7 @@ xfs_dir2_sf_toino4( | |||
1174 | /* | 1174 | /* |
1175 | * Clean up the inode. | 1175 | * Clean up the inode. |
1176 | */ | 1176 | */ |
1177 | kmem_free(buf, oldsize); | 1177 | kmem_free(buf); |
1178 | dp->i_d.di_size = newsize; | 1178 | dp->i_d.di_size = newsize; |
1179 | xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE | XFS_ILOG_DDATA); | 1179 | xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE | XFS_ILOG_DDATA); |
1180 | } | 1180 | } |
@@ -1251,7 +1251,7 @@ xfs_dir2_sf_toino8( | |||
1251 | /* | 1251 | /* |
1252 | * Clean up the inode. | 1252 | * Clean up the inode. |
1253 | */ | 1253 | */ |
1254 | kmem_free(buf, oldsize); | 1254 | kmem_free(buf); |
1255 | dp->i_d.di_size = newsize; | 1255 | dp->i_d.di_size = newsize; |
1256 | xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE | XFS_ILOG_DDATA); | 1256 | xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE | XFS_ILOG_DDATA); |
1257 | } | 1257 | } |
diff --git a/fs/xfs/xfs_error.c b/fs/xfs/xfs_error.c index 05e5365d3c31..7380a00644c8 100644 --- a/fs/xfs/xfs_error.c +++ b/fs/xfs/xfs_error.c | |||
@@ -150,8 +150,7 @@ xfs_errortag_clearall(xfs_mount_t *mp, int loud) | |||
150 | xfs_etest[i]); | 150 | xfs_etest[i]); |
151 | xfs_etest[i] = 0; | 151 | xfs_etest[i] = 0; |
152 | xfs_etest_fsid[i] = 0LL; | 152 | xfs_etest_fsid[i] = 0LL; |
153 | kmem_free(xfs_etest_fsname[i], | 153 | kmem_free(xfs_etest_fsname[i]); |
154 | strlen(xfs_etest_fsname[i]) + 1); | ||
155 | xfs_etest_fsname[i] = NULL; | 154 | xfs_etest_fsname[i] = NULL; |
156 | } | 155 | } |
157 | } | 156 | } |
@@ -175,7 +174,7 @@ xfs_fs_vcmn_err(int level, xfs_mount_t *mp, char *fmt, va_list ap) | |||
175 | newfmt = kmem_alloc(len, KM_SLEEP); | 174 | newfmt = kmem_alloc(len, KM_SLEEP); |
176 | sprintf(newfmt, "Filesystem \"%s\": %s", mp->m_fsname, fmt); | 175 | sprintf(newfmt, "Filesystem \"%s\": %s", mp->m_fsname, fmt); |
177 | icmn_err(level, newfmt, ap); | 176 | icmn_err(level, newfmt, ap); |
178 | kmem_free(newfmt, len); | 177 | kmem_free(newfmt); |
179 | } else { | 178 | } else { |
180 | icmn_err(level, fmt, ap); | 179 | icmn_err(level, fmt, ap); |
181 | } | 180 | } |
diff --git a/fs/xfs/xfs_extfree_item.c b/fs/xfs/xfs_extfree_item.c index 132bd07b9bb8..8aa28f751b2a 100644 --- a/fs/xfs/xfs_extfree_item.c +++ b/fs/xfs/xfs_extfree_item.c | |||
@@ -41,8 +41,7 @@ xfs_efi_item_free(xfs_efi_log_item_t *efip) | |||
41 | int nexts = efip->efi_format.efi_nextents; | 41 | int nexts = efip->efi_format.efi_nextents; |
42 | 42 | ||
43 | if (nexts > XFS_EFI_MAX_FAST_EXTENTS) { | 43 | if (nexts > XFS_EFI_MAX_FAST_EXTENTS) { |
44 | kmem_free(efip, sizeof(xfs_efi_log_item_t) + | 44 | kmem_free(efip); |
45 | (nexts - 1) * sizeof(xfs_extent_t)); | ||
46 | } else { | 45 | } else { |
47 | kmem_zone_free(xfs_efi_zone, efip); | 46 | kmem_zone_free(xfs_efi_zone, efip); |
48 | } | 47 | } |
@@ -374,8 +373,7 @@ xfs_efd_item_free(xfs_efd_log_item_t *efdp) | |||
374 | int nexts = efdp->efd_format.efd_nextents; | 373 | int nexts = efdp->efd_format.efd_nextents; |
375 | 374 | ||
376 | if (nexts > XFS_EFD_MAX_FAST_EXTENTS) { | 375 | if (nexts > XFS_EFD_MAX_FAST_EXTENTS) { |
377 | kmem_free(efdp, sizeof(xfs_efd_log_item_t) + | 376 | kmem_free(efdp); |
378 | (nexts - 1) * sizeof(xfs_extent_t)); | ||
379 | } else { | 377 | } else { |
380 | kmem_zone_free(xfs_efd_zone, efdp); | 378 | kmem_zone_free(xfs_efd_zone, efdp); |
381 | } | 379 | } |
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index e569bf5d6cf0..4b21490334b1 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c | |||
@@ -2258,7 +2258,7 @@ xfs_ifree_cluster( | |||
2258 | xfs_trans_binval(tp, bp); | 2258 | xfs_trans_binval(tp, bp); |
2259 | } | 2259 | } |
2260 | 2260 | ||
2261 | kmem_free(ip_found, ninodes * sizeof(xfs_inode_t *)); | 2261 | kmem_free(ip_found); |
2262 | xfs_put_perag(mp, pag); | 2262 | xfs_put_perag(mp, pag); |
2263 | } | 2263 | } |
2264 | 2264 | ||
@@ -2470,7 +2470,7 @@ xfs_iroot_realloc( | |||
2470 | (int)new_size); | 2470 | (int)new_size); |
2471 | memcpy(np, op, new_max * (uint)sizeof(xfs_dfsbno_t)); | 2471 | memcpy(np, op, new_max * (uint)sizeof(xfs_dfsbno_t)); |
2472 | } | 2472 | } |
2473 | kmem_free(ifp->if_broot, ifp->if_broot_bytes); | 2473 | kmem_free(ifp->if_broot); |
2474 | ifp->if_broot = new_broot; | 2474 | ifp->if_broot = new_broot; |
2475 | ifp->if_broot_bytes = (int)new_size; | 2475 | ifp->if_broot_bytes = (int)new_size; |
2476 | ASSERT(ifp->if_broot_bytes <= | 2476 | ASSERT(ifp->if_broot_bytes <= |
@@ -2514,7 +2514,7 @@ xfs_idata_realloc( | |||
2514 | 2514 | ||
2515 | if (new_size == 0) { | 2515 | if (new_size == 0) { |
2516 | if (ifp->if_u1.if_data != ifp->if_u2.if_inline_data) { | 2516 | if (ifp->if_u1.if_data != ifp->if_u2.if_inline_data) { |
2517 | kmem_free(ifp->if_u1.if_data, ifp->if_real_bytes); | 2517 | kmem_free(ifp->if_u1.if_data); |
2518 | } | 2518 | } |
2519 | ifp->if_u1.if_data = NULL; | 2519 | ifp->if_u1.if_data = NULL; |
2520 | real_size = 0; | 2520 | real_size = 0; |
@@ -2529,7 +2529,7 @@ xfs_idata_realloc( | |||
2529 | ASSERT(ifp->if_real_bytes != 0); | 2529 | ASSERT(ifp->if_real_bytes != 0); |
2530 | memcpy(ifp->if_u2.if_inline_data, ifp->if_u1.if_data, | 2530 | memcpy(ifp->if_u2.if_inline_data, ifp->if_u1.if_data, |
2531 | new_size); | 2531 | new_size); |
2532 | kmem_free(ifp->if_u1.if_data, ifp->if_real_bytes); | 2532 | kmem_free(ifp->if_u1.if_data); |
2533 | ifp->if_u1.if_data = ifp->if_u2.if_inline_data; | 2533 | ifp->if_u1.if_data = ifp->if_u2.if_inline_data; |
2534 | } | 2534 | } |
2535 | real_size = 0; | 2535 | real_size = 0; |
@@ -2636,7 +2636,7 @@ xfs_idestroy_fork( | |||
2636 | 2636 | ||
2637 | ifp = XFS_IFORK_PTR(ip, whichfork); | 2637 | ifp = XFS_IFORK_PTR(ip, whichfork); |
2638 | if (ifp->if_broot != NULL) { | 2638 | if (ifp->if_broot != NULL) { |
2639 | kmem_free(ifp->if_broot, ifp->if_broot_bytes); | 2639 | kmem_free(ifp->if_broot); |
2640 | ifp->if_broot = NULL; | 2640 | ifp->if_broot = NULL; |
2641 | } | 2641 | } |
2642 | 2642 | ||
@@ -2650,7 +2650,7 @@ xfs_idestroy_fork( | |||
2650 | if ((ifp->if_u1.if_data != ifp->if_u2.if_inline_data) && | 2650 | if ((ifp->if_u1.if_data != ifp->if_u2.if_inline_data) && |
2651 | (ifp->if_u1.if_data != NULL)) { | 2651 | (ifp->if_u1.if_data != NULL)) { |
2652 | ASSERT(ifp->if_real_bytes != 0); | 2652 | ASSERT(ifp->if_real_bytes != 0); |
2653 | kmem_free(ifp->if_u1.if_data, ifp->if_real_bytes); | 2653 | kmem_free(ifp->if_u1.if_data); |
2654 | ifp->if_u1.if_data = NULL; | 2654 | ifp->if_u1.if_data = NULL; |
2655 | ifp->if_real_bytes = 0; | 2655 | ifp->if_real_bytes = 0; |
2656 | } | 2656 | } |
@@ -3058,7 +3058,7 @@ xfs_iflush_cluster( | |||
3058 | 3058 | ||
3059 | out_free: | 3059 | out_free: |
3060 | read_unlock(&pag->pag_ici_lock); | 3060 | read_unlock(&pag->pag_ici_lock); |
3061 | kmem_free(ilist, ilist_size); | 3061 | kmem_free(ilist); |
3062 | return 0; | 3062 | return 0; |
3063 | 3063 | ||
3064 | 3064 | ||
@@ -3102,7 +3102,7 @@ cluster_corrupt_out: | |||
3102 | * Unlocks the flush lock | 3102 | * Unlocks the flush lock |
3103 | */ | 3103 | */ |
3104 | xfs_iflush_abort(iq); | 3104 | xfs_iflush_abort(iq); |
3105 | kmem_free(ilist, ilist_size); | 3105 | kmem_free(ilist); |
3106 | return XFS_ERROR(EFSCORRUPTED); | 3106 | return XFS_ERROR(EFSCORRUPTED); |
3107 | } | 3107 | } |
3108 | 3108 | ||
@@ -3836,7 +3836,7 @@ xfs_iext_add_indirect_multi( | |||
3836 | erp = xfs_iext_irec_new(ifp, erp_idx); | 3836 | erp = xfs_iext_irec_new(ifp, erp_idx); |
3837 | } | 3837 | } |
3838 | memmove(&erp->er_extbuf[i], nex2_ep, byte_diff); | 3838 | memmove(&erp->er_extbuf[i], nex2_ep, byte_diff); |
3839 | kmem_free(nex2_ep, byte_diff); | 3839 | kmem_free(nex2_ep); |
3840 | erp->er_extcount += nex2; | 3840 | erp->er_extcount += nex2; |
3841 | xfs_iext_irec_update_extoffs(ifp, erp_idx + 1, nex2); | 3841 | xfs_iext_irec_update_extoffs(ifp, erp_idx + 1, nex2); |
3842 | } | 3842 | } |
@@ -4112,7 +4112,7 @@ xfs_iext_direct_to_inline( | |||
4112 | */ | 4112 | */ |
4113 | memcpy(ifp->if_u2.if_inline_ext, ifp->if_u1.if_extents, | 4113 | memcpy(ifp->if_u2.if_inline_ext, ifp->if_u1.if_extents, |
4114 | nextents * sizeof(xfs_bmbt_rec_t)); | 4114 | nextents * sizeof(xfs_bmbt_rec_t)); |
4115 | kmem_free(ifp->if_u1.if_extents, ifp->if_real_bytes); | 4115 | kmem_free(ifp->if_u1.if_extents); |
4116 | ifp->if_u1.if_extents = ifp->if_u2.if_inline_ext; | 4116 | ifp->if_u1.if_extents = ifp->if_u2.if_inline_ext; |
4117 | ifp->if_real_bytes = 0; | 4117 | ifp->if_real_bytes = 0; |
4118 | } | 4118 | } |
@@ -4186,7 +4186,7 @@ xfs_iext_indirect_to_direct( | |||
4186 | ASSERT(ifp->if_real_bytes == XFS_IEXT_BUFSZ); | 4186 | ASSERT(ifp->if_real_bytes == XFS_IEXT_BUFSZ); |
4187 | 4187 | ||
4188 | ep = ifp->if_u1.if_ext_irec->er_extbuf; | 4188 | ep = ifp->if_u1.if_ext_irec->er_extbuf; |
4189 | kmem_free(ifp->if_u1.if_ext_irec, sizeof(xfs_ext_irec_t)); | 4189 | kmem_free(ifp->if_u1.if_ext_irec); |
4190 | ifp->if_flags &= ~XFS_IFEXTIREC; | 4190 | ifp->if_flags &= ~XFS_IFEXTIREC; |
4191 | ifp->if_u1.if_extents = ep; | 4191 | ifp->if_u1.if_extents = ep; |
4192 | ifp->if_bytes = size; | 4192 | ifp->if_bytes = size; |
@@ -4212,7 +4212,7 @@ xfs_iext_destroy( | |||
4212 | } | 4212 | } |
4213 | ifp->if_flags &= ~XFS_IFEXTIREC; | 4213 | ifp->if_flags &= ~XFS_IFEXTIREC; |
4214 | } else if (ifp->if_real_bytes) { | 4214 | } else if (ifp->if_real_bytes) { |
4215 | kmem_free(ifp->if_u1.if_extents, ifp->if_real_bytes); | 4215 | kmem_free(ifp->if_u1.if_extents); |
4216 | } else if (ifp->if_bytes) { | 4216 | } else if (ifp->if_bytes) { |
4217 | memset(ifp->if_u2.if_inline_ext, 0, XFS_INLINE_EXTS * | 4217 | memset(ifp->if_u2.if_inline_ext, 0, XFS_INLINE_EXTS * |
4218 | sizeof(xfs_bmbt_rec_t)); | 4218 | sizeof(xfs_bmbt_rec_t)); |
@@ -4483,7 +4483,7 @@ xfs_iext_irec_remove( | |||
4483 | if (erp->er_extbuf) { | 4483 | if (erp->er_extbuf) { |
4484 | xfs_iext_irec_update_extoffs(ifp, erp_idx + 1, | 4484 | xfs_iext_irec_update_extoffs(ifp, erp_idx + 1, |
4485 | -erp->er_extcount); | 4485 | -erp->er_extcount); |
4486 | kmem_free(erp->er_extbuf, XFS_IEXT_BUFSZ); | 4486 | kmem_free(erp->er_extbuf); |
4487 | } | 4487 | } |
4488 | /* Compact extent records */ | 4488 | /* Compact extent records */ |
4489 | erp = ifp->if_u1.if_ext_irec; | 4489 | erp = ifp->if_u1.if_ext_irec; |
@@ -4501,8 +4501,7 @@ xfs_iext_irec_remove( | |||
4501 | xfs_iext_realloc_indirect(ifp, | 4501 | xfs_iext_realloc_indirect(ifp, |
4502 | nlists * sizeof(xfs_ext_irec_t)); | 4502 | nlists * sizeof(xfs_ext_irec_t)); |
4503 | } else { | 4503 | } else { |
4504 | kmem_free(ifp->if_u1.if_ext_irec, | 4504 | kmem_free(ifp->if_u1.if_ext_irec); |
4505 | sizeof(xfs_ext_irec_t)); | ||
4506 | } | 4505 | } |
4507 | ifp->if_real_bytes = nlists * XFS_IEXT_BUFSZ; | 4506 | ifp->if_real_bytes = nlists * XFS_IEXT_BUFSZ; |
4508 | } | 4507 | } |
@@ -4571,7 +4570,7 @@ xfs_iext_irec_compact_pages( | |||
4571 | * so er_extoffs don't get modified in | 4570 | * so er_extoffs don't get modified in |
4572 | * xfs_iext_irec_remove. | 4571 | * xfs_iext_irec_remove. |
4573 | */ | 4572 | */ |
4574 | kmem_free(erp_next->er_extbuf, XFS_IEXT_BUFSZ); | 4573 | kmem_free(erp_next->er_extbuf); |
4575 | erp_next->er_extbuf = NULL; | 4574 | erp_next->er_extbuf = NULL; |
4576 | xfs_iext_irec_remove(ifp, erp_idx + 1); | 4575 | xfs_iext_irec_remove(ifp, erp_idx + 1); |
4577 | nlists = ifp->if_real_bytes / XFS_IEXT_BUFSZ; | 4576 | nlists = ifp->if_real_bytes / XFS_IEXT_BUFSZ; |
@@ -4614,8 +4613,7 @@ xfs_iext_irec_compact_full( | |||
4614 | * so er_extoffs don't get modified in | 4613 | * so er_extoffs don't get modified in |
4615 | * xfs_iext_irec_remove. | 4614 | * xfs_iext_irec_remove. |
4616 | */ | 4615 | */ |
4617 | kmem_free(erp_next->er_extbuf, | 4616 | kmem_free(erp_next->er_extbuf); |
4618 | erp_next->er_extcount * sizeof(xfs_bmbt_rec_t)); | ||
4619 | erp_next->er_extbuf = NULL; | 4617 | erp_next->er_extbuf = NULL; |
4620 | xfs_iext_irec_remove(ifp, erp_idx + 1); | 4618 | xfs_iext_irec_remove(ifp, erp_idx + 1); |
4621 | erp = &ifp->if_u1.if_ext_irec[erp_idx]; | 4619 | erp = &ifp->if_u1.if_ext_irec[erp_idx]; |
diff --git a/fs/xfs/xfs_inode_item.c b/fs/xfs/xfs_inode_item.c index 167b33f15772..0eee08a32c26 100644 --- a/fs/xfs/xfs_inode_item.c +++ b/fs/xfs/xfs_inode_item.c | |||
@@ -686,7 +686,7 @@ xfs_inode_item_unlock( | |||
686 | ASSERT(ip->i_d.di_nextents > 0); | 686 | ASSERT(ip->i_d.di_nextents > 0); |
687 | ASSERT(iip->ili_format.ilf_fields & XFS_ILOG_DEXT); | 687 | ASSERT(iip->ili_format.ilf_fields & XFS_ILOG_DEXT); |
688 | ASSERT(ip->i_df.if_bytes > 0); | 688 | ASSERT(ip->i_df.if_bytes > 0); |
689 | kmem_free(iip->ili_extents_buf, ip->i_df.if_bytes); | 689 | kmem_free(iip->ili_extents_buf); |
690 | iip->ili_extents_buf = NULL; | 690 | iip->ili_extents_buf = NULL; |
691 | } | 691 | } |
692 | if (iip->ili_aextents_buf != NULL) { | 692 | if (iip->ili_aextents_buf != NULL) { |
@@ -694,7 +694,7 @@ xfs_inode_item_unlock( | |||
694 | ASSERT(ip->i_d.di_anextents > 0); | 694 | ASSERT(ip->i_d.di_anextents > 0); |
695 | ASSERT(iip->ili_format.ilf_fields & XFS_ILOG_AEXT); | 695 | ASSERT(iip->ili_format.ilf_fields & XFS_ILOG_AEXT); |
696 | ASSERT(ip->i_afp->if_bytes > 0); | 696 | ASSERT(ip->i_afp->if_bytes > 0); |
697 | kmem_free(iip->ili_aextents_buf, ip->i_afp->if_bytes); | 697 | kmem_free(iip->ili_aextents_buf); |
698 | iip->ili_aextents_buf = NULL; | 698 | iip->ili_aextents_buf = NULL; |
699 | } | 699 | } |
700 | 700 | ||
@@ -957,8 +957,7 @@ xfs_inode_item_destroy( | |||
957 | { | 957 | { |
958 | #ifdef XFS_TRANS_DEBUG | 958 | #ifdef XFS_TRANS_DEBUG |
959 | if (ip->i_itemp->ili_root_size != 0) { | 959 | if (ip->i_itemp->ili_root_size != 0) { |
960 | kmem_free(ip->i_itemp->ili_orig_root, | 960 | kmem_free(ip->i_itemp->ili_orig_root); |
961 | ip->i_itemp->ili_root_size); | ||
962 | } | 961 | } |
963 | #endif | 962 | #endif |
964 | kmem_zone_free(xfs_ili_zone, ip->i_itemp); | 963 | kmem_zone_free(xfs_ili_zone, ip->i_itemp); |
diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c index 419de15aeb43..9a3ef9dcaeb9 100644 --- a/fs/xfs/xfs_itable.c +++ b/fs/xfs/xfs_itable.c | |||
@@ -257,7 +257,7 @@ xfs_bulkstat_one( | |||
257 | *ubused = error; | 257 | *ubused = error; |
258 | 258 | ||
259 | out_free: | 259 | out_free: |
260 | kmem_free(buf, sizeof(*buf)); | 260 | kmem_free(buf); |
261 | return error; | 261 | return error; |
262 | } | 262 | } |
263 | 263 | ||
@@ -708,7 +708,7 @@ xfs_bulkstat( | |||
708 | /* | 708 | /* |
709 | * Done, we're either out of filesystem or space to put the data. | 709 | * Done, we're either out of filesystem or space to put the data. |
710 | */ | 710 | */ |
711 | kmem_free(irbuf, irbsize); | 711 | kmem_free(irbuf); |
712 | *ubcountp = ubelem; | 712 | *ubcountp = ubelem; |
713 | /* | 713 | /* |
714 | * Found some inodes, return them now and return the error next time. | 714 | * Found some inodes, return them now and return the error next time. |
@@ -914,7 +914,7 @@ xfs_inumbers( | |||
914 | } | 914 | } |
915 | *lastino = XFS_AGINO_TO_INO(mp, agno, agino); | 915 | *lastino = XFS_AGINO_TO_INO(mp, agno, agino); |
916 | } | 916 | } |
917 | kmem_free(buffer, bcount * sizeof(*buffer)); | 917 | kmem_free(buffer); |
918 | if (cur) | 918 | if (cur) |
919 | xfs_btree_del_cursor(cur, (error ? XFS_BTREE_ERROR : | 919 | xfs_btree_del_cursor(cur, (error ? XFS_BTREE_ERROR : |
920 | XFS_BTREE_NOERROR)); | 920 | XFS_BTREE_NOERROR)); |
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c index ad3d26ddfe31..16a01abe2490 100644 --- a/fs/xfs/xfs_log.c +++ b/fs/xfs/xfs_log.c | |||
@@ -1570,7 +1570,7 @@ xlog_dealloc_log(xlog_t *log) | |||
1570 | } | 1570 | } |
1571 | #endif | 1571 | #endif |
1572 | next_iclog = iclog->ic_next; | 1572 | next_iclog = iclog->ic_next; |
1573 | kmem_free(iclog, sizeof(xlog_in_core_t)); | 1573 | kmem_free(iclog); |
1574 | iclog = next_iclog; | 1574 | iclog = next_iclog; |
1575 | } | 1575 | } |
1576 | freesema(&log->l_flushsema); | 1576 | freesema(&log->l_flushsema); |
@@ -1587,7 +1587,7 @@ xlog_dealloc_log(xlog_t *log) | |||
1587 | } | 1587 | } |
1588 | #endif | 1588 | #endif |
1589 | log->l_mp->m_log = NULL; | 1589 | log->l_mp->m_log = NULL; |
1590 | kmem_free(log, sizeof(xlog_t)); | 1590 | kmem_free(log); |
1591 | } /* xlog_dealloc_log */ | 1591 | } /* xlog_dealloc_log */ |
1592 | 1592 | ||
1593 | /* | 1593 | /* |
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c index e65ab4af0955..9eb722ec744e 100644 --- a/fs/xfs/xfs_log_recover.c +++ b/fs/xfs/xfs_log_recover.c | |||
@@ -1715,8 +1715,7 @@ xlog_check_buffer_cancelled( | |||
1715 | } else { | 1715 | } else { |
1716 | prevp->bc_next = bcp->bc_next; | 1716 | prevp->bc_next = bcp->bc_next; |
1717 | } | 1717 | } |
1718 | kmem_free(bcp, | 1718 | kmem_free(bcp); |
1719 | sizeof(xfs_buf_cancel_t)); | ||
1720 | } | 1719 | } |
1721 | } | 1720 | } |
1722 | return 1; | 1721 | return 1; |
@@ -2519,7 +2518,7 @@ write_inode_buffer: | |||
2519 | 2518 | ||
2520 | error: | 2519 | error: |
2521 | if (need_free) | 2520 | if (need_free) |
2522 | kmem_free(in_f, sizeof(*in_f)); | 2521 | kmem_free(in_f); |
2523 | return XFS_ERROR(error); | 2522 | return XFS_ERROR(error); |
2524 | } | 2523 | } |
2525 | 2524 | ||
@@ -2830,16 +2829,14 @@ xlog_recover_free_trans( | |||
2830 | item = item->ri_next; | 2829 | item = item->ri_next; |
2831 | /* Free the regions in the item. */ | 2830 | /* Free the regions in the item. */ |
2832 | for (i = 0; i < free_item->ri_cnt; i++) { | 2831 | for (i = 0; i < free_item->ri_cnt; i++) { |
2833 | kmem_free(free_item->ri_buf[i].i_addr, | 2832 | kmem_free(free_item->ri_buf[i].i_addr); |
2834 | free_item->ri_buf[i].i_len); | ||
2835 | } | 2833 | } |
2836 | /* Free the item itself */ | 2834 | /* Free the item itself */ |
2837 | kmem_free(free_item->ri_buf, | 2835 | kmem_free(free_item->ri_buf); |
2838 | (free_item->ri_total * sizeof(xfs_log_iovec_t))); | 2836 | kmem_free(free_item); |
2839 | kmem_free(free_item, sizeof(xlog_recover_item_t)); | ||
2840 | } while (first_item != item); | 2837 | } while (first_item != item); |
2841 | /* Free the transaction recover structure */ | 2838 | /* Free the transaction recover structure */ |
2842 | kmem_free(trans, sizeof(xlog_recover_t)); | 2839 | kmem_free(trans); |
2843 | } | 2840 | } |
2844 | 2841 | ||
2845 | STATIC int | 2842 | STATIC int |
@@ -3786,8 +3783,7 @@ xlog_do_log_recovery( | |||
3786 | error = xlog_do_recovery_pass(log, head_blk, tail_blk, | 3783 | error = xlog_do_recovery_pass(log, head_blk, tail_blk, |
3787 | XLOG_RECOVER_PASS1); | 3784 | XLOG_RECOVER_PASS1); |
3788 | if (error != 0) { | 3785 | if (error != 0) { |
3789 | kmem_free(log->l_buf_cancel_table, | 3786 | kmem_free(log->l_buf_cancel_table); |
3790 | XLOG_BC_TABLE_SIZE * sizeof(xfs_buf_cancel_t*)); | ||
3791 | log->l_buf_cancel_table = NULL; | 3787 | log->l_buf_cancel_table = NULL; |
3792 | return error; | 3788 | return error; |
3793 | } | 3789 | } |
@@ -3806,8 +3802,7 @@ xlog_do_log_recovery( | |||
3806 | } | 3802 | } |
3807 | #endif /* DEBUG */ | 3803 | #endif /* DEBUG */ |
3808 | 3804 | ||
3809 | kmem_free(log->l_buf_cancel_table, | 3805 | kmem_free(log->l_buf_cancel_table); |
3810 | XLOG_BC_TABLE_SIZE * sizeof(xfs_buf_cancel_t*)); | ||
3811 | log->l_buf_cancel_table = NULL; | 3806 | log->l_buf_cancel_table = NULL; |
3812 | 3807 | ||
3813 | return error; | 3808 | return error; |
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c index 361c7a755a07..c63f410ccfaa 100644 --- a/fs/xfs/xfs_mount.c +++ b/fs/xfs/xfs_mount.c | |||
@@ -161,11 +161,8 @@ xfs_mount_free( | |||
161 | 161 | ||
162 | for (agno = 0; agno < mp->m_maxagi; agno++) | 162 | for (agno = 0; agno < mp->m_maxagi; agno++) |
163 | if (mp->m_perag[agno].pagb_list) | 163 | if (mp->m_perag[agno].pagb_list) |
164 | kmem_free(mp->m_perag[agno].pagb_list, | 164 | kmem_free(mp->m_perag[agno].pagb_list); |
165 | sizeof(xfs_perag_busy_t) * | 165 | kmem_free(mp->m_perag); |
166 | XFS_PAGB_NUM_SLOTS); | ||
167 | kmem_free(mp->m_perag, | ||
168 | sizeof(xfs_perag_t) * mp->m_sb.sb_agcount); | ||
169 | } | 166 | } |
170 | 167 | ||
171 | spinlock_destroy(&mp->m_ail_lock); | 168 | spinlock_destroy(&mp->m_ail_lock); |
@@ -176,11 +173,11 @@ xfs_mount_free( | |||
176 | XFS_QM_DONE(mp); | 173 | XFS_QM_DONE(mp); |
177 | 174 | ||
178 | if (mp->m_fsname != NULL) | 175 | if (mp->m_fsname != NULL) |
179 | kmem_free(mp->m_fsname, mp->m_fsname_len); | 176 | kmem_free(mp->m_fsname); |
180 | if (mp->m_rtname != NULL) | 177 | if (mp->m_rtname != NULL) |
181 | kmem_free(mp->m_rtname, strlen(mp->m_rtname) + 1); | 178 | kmem_free(mp->m_rtname); |
182 | if (mp->m_logname != NULL) | 179 | if (mp->m_logname != NULL) |
183 | kmem_free(mp->m_logname, strlen(mp->m_logname) + 1); | 180 | kmem_free(mp->m_logname); |
184 | 181 | ||
185 | xfs_icsb_destroy_counters(mp); | 182 | xfs_icsb_destroy_counters(mp); |
186 | } | 183 | } |
@@ -1265,9 +1262,8 @@ xfs_mountfs( | |||
1265 | error2: | 1262 | error2: |
1266 | for (agno = 0; agno < sbp->sb_agcount; agno++) | 1263 | for (agno = 0; agno < sbp->sb_agcount; agno++) |
1267 | if (mp->m_perag[agno].pagb_list) | 1264 | if (mp->m_perag[agno].pagb_list) |
1268 | kmem_free(mp->m_perag[agno].pagb_list, | 1265 | kmem_free(mp->m_perag[agno].pagb_list); |
1269 | sizeof(xfs_perag_busy_t) * XFS_PAGB_NUM_SLOTS); | 1266 | kmem_free(mp->m_perag); |
1270 | kmem_free(mp->m_perag, sbp->sb_agcount * sizeof(xfs_perag_t)); | ||
1271 | mp->m_perag = NULL; | 1267 | mp->m_perag = NULL; |
1272 | /* FALLTHROUGH */ | 1268 | /* FALLTHROUGH */ |
1273 | error1: | 1269 | error1: |
diff --git a/fs/xfs/xfs_mru_cache.c b/fs/xfs/xfs_mru_cache.c index a0b2c0a2589a..26d14a1e0e14 100644 --- a/fs/xfs/xfs_mru_cache.c +++ b/fs/xfs/xfs_mru_cache.c | |||
@@ -382,9 +382,9 @@ xfs_mru_cache_create( | |||
382 | 382 | ||
383 | exit: | 383 | exit: |
384 | if (err && mru && mru->lists) | 384 | if (err && mru && mru->lists) |
385 | kmem_free(mru->lists, mru->grp_count * sizeof(*mru->lists)); | 385 | kmem_free(mru->lists); |
386 | if (err && mru) | 386 | if (err && mru) |
387 | kmem_free(mru, sizeof(*mru)); | 387 | kmem_free(mru); |
388 | 388 | ||
389 | return err; | 389 | return err; |
390 | } | 390 | } |
@@ -424,8 +424,8 @@ xfs_mru_cache_destroy( | |||
424 | 424 | ||
425 | xfs_mru_cache_flush(mru); | 425 | xfs_mru_cache_flush(mru); |
426 | 426 | ||
427 | kmem_free(mru->lists, mru->grp_count * sizeof(*mru->lists)); | 427 | kmem_free(mru->lists); |
428 | kmem_free(mru, sizeof(*mru)); | 428 | kmem_free(mru); |
429 | } | 429 | } |
430 | 430 | ||
431 | /* | 431 | /* |
diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c index a0dc6e5bc5b9..bf87a5913504 100644 --- a/fs/xfs/xfs_rtalloc.c +++ b/fs/xfs/xfs_rtalloc.c | |||
@@ -2062,7 +2062,7 @@ xfs_growfs_rt( | |||
2062 | /* | 2062 | /* |
2063 | * Free the fake mp structure. | 2063 | * Free the fake mp structure. |
2064 | */ | 2064 | */ |
2065 | kmem_free(nmp, sizeof(*nmp)); | 2065 | kmem_free(nmp); |
2066 | 2066 | ||
2067 | return error; | 2067 | return error; |
2068 | } | 2068 | } |
diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c index 140386434aa3..e4ebddd3c500 100644 --- a/fs/xfs/xfs_trans.c +++ b/fs/xfs/xfs_trans.c | |||
@@ -889,7 +889,7 @@ shut_us_down: | |||
889 | 889 | ||
890 | tp->t_commit_lsn = commit_lsn; | 890 | tp->t_commit_lsn = commit_lsn; |
891 | if (nvec > XFS_TRANS_LOGVEC_COUNT) { | 891 | if (nvec > XFS_TRANS_LOGVEC_COUNT) { |
892 | kmem_free(log_vector, nvec * sizeof(xfs_log_iovec_t)); | 892 | kmem_free(log_vector); |
893 | } | 893 | } |
894 | 894 | ||
895 | /* | 895 | /* |
@@ -1265,7 +1265,7 @@ xfs_trans_committed( | |||
1265 | ASSERT(!XFS_LIC_ARE_ALL_FREE(licp)); | 1265 | ASSERT(!XFS_LIC_ARE_ALL_FREE(licp)); |
1266 | xfs_trans_chunk_committed(licp, tp->t_lsn, abortflag); | 1266 | xfs_trans_chunk_committed(licp, tp->t_lsn, abortflag); |
1267 | next_licp = licp->lic_next; | 1267 | next_licp = licp->lic_next; |
1268 | kmem_free(licp, sizeof(xfs_log_item_chunk_t)); | 1268 | kmem_free(licp); |
1269 | licp = next_licp; | 1269 | licp = next_licp; |
1270 | } | 1270 | } |
1271 | 1271 | ||
diff --git a/fs/xfs/xfs_trans_inode.c b/fs/xfs/xfs_trans_inode.c index 4c70bf5e9985..2a1c0f071f91 100644 --- a/fs/xfs/xfs_trans_inode.c +++ b/fs/xfs/xfs_trans_inode.c | |||
@@ -291,7 +291,7 @@ xfs_trans_inode_broot_debug( | |||
291 | iip = ip->i_itemp; | 291 | iip = ip->i_itemp; |
292 | if (iip->ili_root_size != 0) { | 292 | if (iip->ili_root_size != 0) { |
293 | ASSERT(iip->ili_orig_root != NULL); | 293 | ASSERT(iip->ili_orig_root != NULL); |
294 | kmem_free(iip->ili_orig_root, iip->ili_root_size); | 294 | kmem_free(iip->ili_orig_root); |
295 | iip->ili_root_size = 0; | 295 | iip->ili_root_size = 0; |
296 | iip->ili_orig_root = NULL; | 296 | iip->ili_orig_root = NULL; |
297 | } | 297 | } |
diff --git a/fs/xfs/xfs_trans_item.c b/fs/xfs/xfs_trans_item.c index 66a09f0d894b..db5c83595526 100644 --- a/fs/xfs/xfs_trans_item.c +++ b/fs/xfs/xfs_trans_item.c | |||
@@ -161,7 +161,7 @@ xfs_trans_free_item(xfs_trans_t *tp, xfs_log_item_desc_t *lidp) | |||
161 | licpp = &((*licpp)->lic_next); | 161 | licpp = &((*licpp)->lic_next); |
162 | } | 162 | } |
163 | *licpp = licp->lic_next; | 163 | *licpp = licp->lic_next; |
164 | kmem_free(licp, sizeof(xfs_log_item_chunk_t)); | 164 | kmem_free(licp); |
165 | tp->t_items_free -= XFS_LIC_NUM_SLOTS; | 165 | tp->t_items_free -= XFS_LIC_NUM_SLOTS; |
166 | } | 166 | } |
167 | } | 167 | } |
@@ -314,7 +314,7 @@ xfs_trans_free_items( | |||
314 | ASSERT(!XFS_LIC_ARE_ALL_FREE(licp)); | 314 | ASSERT(!XFS_LIC_ARE_ALL_FREE(licp)); |
315 | (void) xfs_trans_unlock_chunk(licp, 1, abort, NULLCOMMITLSN); | 315 | (void) xfs_trans_unlock_chunk(licp, 1, abort, NULLCOMMITLSN); |
316 | next_licp = licp->lic_next; | 316 | next_licp = licp->lic_next; |
317 | kmem_free(licp, sizeof(xfs_log_item_chunk_t)); | 317 | kmem_free(licp); |
318 | licp = next_licp; | 318 | licp = next_licp; |
319 | } | 319 | } |
320 | 320 | ||
@@ -363,7 +363,7 @@ xfs_trans_unlock_items(xfs_trans_t *tp, xfs_lsn_t commit_lsn) | |||
363 | next_licp = licp->lic_next; | 363 | next_licp = licp->lic_next; |
364 | if (XFS_LIC_ARE_ALL_FREE(licp)) { | 364 | if (XFS_LIC_ARE_ALL_FREE(licp)) { |
365 | *licpp = next_licp; | 365 | *licpp = next_licp; |
366 | kmem_free(licp, sizeof(xfs_log_item_chunk_t)); | 366 | kmem_free(licp); |
367 | freed -= XFS_LIC_NUM_SLOTS; | 367 | freed -= XFS_LIC_NUM_SLOTS; |
368 | } else { | 368 | } else { |
369 | licpp = &(licp->lic_next); | 369 | licpp = &(licp->lic_next); |
@@ -530,7 +530,7 @@ xfs_trans_free_busy(xfs_trans_t *tp) | |||
530 | lbcp = tp->t_busy.lbc_next; | 530 | lbcp = tp->t_busy.lbc_next; |
531 | while (lbcp != NULL) { | 531 | while (lbcp != NULL) { |
532 | lbcq = lbcp->lbc_next; | 532 | lbcq = lbcp->lbc_next; |
533 | kmem_free(lbcp, sizeof(xfs_log_busy_chunk_t)); | 533 | kmem_free(lbcp); |
534 | lbcp = lbcq; | 534 | lbcp = lbcq; |
535 | } | 535 | } |
536 | 536 | ||
diff --git a/fs/xfs/xfs_vfsops.c b/fs/xfs/xfs_vfsops.c index bbc911720d81..a005cebf5041 100644 --- a/fs/xfs/xfs_vfsops.c +++ b/fs/xfs/xfs_vfsops.c | |||
@@ -639,7 +639,7 @@ out: | |||
639 | xfs_unmountfs(mp, credp); | 639 | xfs_unmountfs(mp, credp); |
640 | xfs_qmops_put(mp); | 640 | xfs_qmops_put(mp); |
641 | xfs_dmops_put(mp); | 641 | xfs_dmops_put(mp); |
642 | kmem_free(mp, sizeof(xfs_mount_t)); | 642 | kmem_free(mp); |
643 | } | 643 | } |
644 | 644 | ||
645 | return XFS_ERROR(error); | 645 | return XFS_ERROR(error); |
@@ -1055,7 +1055,7 @@ xfs_sync_inodes( | |||
1055 | 1055 | ||
1056 | if (XFS_FORCED_SHUTDOWN(mp) && !(flags & SYNC_CLOSE)) { | 1056 | if (XFS_FORCED_SHUTDOWN(mp) && !(flags & SYNC_CLOSE)) { |
1057 | XFS_MOUNT_IUNLOCK(mp); | 1057 | XFS_MOUNT_IUNLOCK(mp); |
1058 | kmem_free(ipointer, sizeof(xfs_iptr_t)); | 1058 | kmem_free(ipointer); |
1059 | return 0; | 1059 | return 0; |
1060 | } | 1060 | } |
1061 | 1061 | ||
@@ -1201,7 +1201,7 @@ xfs_sync_inodes( | |||
1201 | } | 1201 | } |
1202 | XFS_MOUNT_IUNLOCK(mp); | 1202 | XFS_MOUNT_IUNLOCK(mp); |
1203 | ASSERT(ipointer_in == B_FALSE); | 1203 | ASSERT(ipointer_in == B_FALSE); |
1204 | kmem_free(ipointer, sizeof(xfs_iptr_t)); | 1204 | kmem_free(ipointer); |
1205 | return XFS_ERROR(error); | 1205 | return XFS_ERROR(error); |
1206 | } | 1206 | } |
1207 | 1207 | ||
@@ -1231,7 +1231,7 @@ xfs_sync_inodes( | |||
1231 | 1231 | ||
1232 | ASSERT(ipointer_in == B_FALSE); | 1232 | ASSERT(ipointer_in == B_FALSE); |
1233 | 1233 | ||
1234 | kmem_free(ipointer, sizeof(xfs_iptr_t)); | 1234 | kmem_free(ipointer); |
1235 | return XFS_ERROR(last_error); | 1235 | return XFS_ERROR(last_error); |
1236 | } | 1236 | } |
1237 | 1237 | ||