From patchwork Mon Jan 15 22:59:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Chinner X-Patchwork-Id: 13520254 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D6EBFC4707B for ; Mon, 15 Jan 2024 23:01:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5061E6B0075; Mon, 15 Jan 2024 18:01:23 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4B8256B0072; Mon, 15 Jan 2024 18:01:23 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 32EF56B0078; Mon, 15 Jan 2024 18:01:23 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 1C1546B0072 for ; Mon, 15 Jan 2024 18:01:23 -0500 (EST) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id D826D1A08BF for ; Mon, 15 Jan 2024 23:01:22 +0000 (UTC) X-FDA: 81683068404.25.9A87BF2 Received: from mail-pg1-f175.google.com (mail-pg1-f175.google.com [209.85.215.175]) by imf25.hostedemail.com (Postfix) with ESMTP id E58B9A0005 for ; Mon, 15 Jan 2024 23:01:20 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=fromorbit-com.20230601.gappssmtp.com header.s=20230601 header.b=C9T3bGtP; dmarc=pass (policy=quarantine) header.from=fromorbit.com; spf=pass (imf25.hostedemail.com: domain of david@fromorbit.com designates 209.85.215.175 as permitted sender) smtp.mailfrom=david@fromorbit.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1705359681; a=rsa-sha256; cv=none; b=b6rZfuKdCffFIy6WMVTsXQoK0yUoTRIhncmlpsqfv8SuoyqdPeNw+owiaWt8j8Iaa8NapR 92cSN4JCsQIEaD2WfjPaOIsxyVO3kfnykWRginoLtoOHJJcXzJsZoyUmI5HfOFAJpXz3IG ao7AsQZA9Wp2jm0rlI8PXxqq4UMAdOA= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=fromorbit-com.20230601.gappssmtp.com header.s=20230601 header.b=C9T3bGtP; dmarc=pass (policy=quarantine) header.from=fromorbit.com; spf=pass (imf25.hostedemail.com: domain of david@fromorbit.com designates 209.85.215.175 as permitted sender) smtp.mailfrom=david@fromorbit.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1705359681; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Y9TwWrvHaBvdVNybXoOWZa9DHgcrJ7OiMVTIbeklwyI=; b=6qyj+yb8viJiTbrpGL5OLBTQ5qZ1sU8s3X2dD3vLyYLz5AjzCLlpmOPurhtR3zuNjC2dI2 QrhAMHy5HYDN7VLC9q0jfRR+cPKLkDPblQ00nWR96hUvKKeULa/07VsGTq5rcuN6VAMem/ VAaQf1i2ijbTc4tjRc+oQEQIFsWPbAM= Received: by mail-pg1-f175.google.com with SMTP id 41be03b00d2f7-53fa455cd94so3410181a12.2 for ; Mon, 15 Jan 2024 15:01:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20230601.gappssmtp.com; s=20230601; t=1705359680; x=1705964480; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Y9TwWrvHaBvdVNybXoOWZa9DHgcrJ7OiMVTIbeklwyI=; b=C9T3bGtPlS/gXq7BgF9+u43qHk+JXC0Gbi+dtZja9Jk2EjWrosHn/ymxNnrX+QK0Al ePekyF+Zq4Np7CnItbxOQTnYvgCdXCMsKXxon8QL2HAUgo8DjmeMM/PilwxBiWxnxIsx GkGU4LeQA4HdnP/XU3q8M6Z3lg3MR4ozlm6j14CH2mVdsrZGiCj1+td3u6TUiAfH+dlN lAQvSQhSXKFbXhm5vzP1s4EVWplpUg4IHrw2A9rtcvwQOpL+x+nwiyZzJx6oSkO7gouz UoukOq3Rsub2U3SqdS211e5R/0F/YEQbhbc+RzfmlxYRQj9c2pNMvgA61ypHmHzs+mXE I3Hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705359680; x=1705964480; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Y9TwWrvHaBvdVNybXoOWZa9DHgcrJ7OiMVTIbeklwyI=; b=PTjmmXyKDCXu/oshAeCshUZ167f6fSNFm2IhMRBIzcpFTcTR4gQYDttzY6bFOh6C2M GE4HP5m1oo/ozduppagL74PWGzbDqEc8rFDeqG3RTNNCOPsqCCesz1rEfpufn6WaEXDY lIIol3PD8rMnW60g9/PlJdAdgpzMJResYGjIC98LhHYGDq+ZSFafRqlpFkl7y7QFqQgy BFgaFLIAFYsx+I4eIYhgVmhmuXmWqwvtJQ/yvYL1ITjXC042bPE2fk+K61Ch/iwXW2uP dRo1tC4/lENf4aDQPKP6BNOk8eyLRkSKh+3Upym6GsBERPBdX1PsPdhUOdQecFOO6klR T57w== X-Gm-Message-State: AOJu0YxmzJZZHGaG+U3SPUDBHIyz6k9EHdih6nkAg5ByF01doVZUiA/X GKDZJZEb036t0pO5mnFTOLUxYxT5VbgBPA== X-Google-Smtp-Source: AGHT+IFeCUfFT3a7WOWtHMkWlHPfZ9V+wnzrGrsnuvhU8qp6+MkImBCY8pcnBEb+N6k0lUKy7rtgLQ== X-Received: by 2002:a17:90b:1957:b0:28e:5b0c:74f6 with SMTP id nk23-20020a17090b195700b0028e5b0c74f6mr1007270pjb.34.1705359679764; Mon, 15 Jan 2024 15:01:19 -0800 (PST) Received: from dread.disaster.area (pa49-180-249-6.pa.nsw.optusnet.com.au. [49.180.249.6]) by smtp.gmail.com with ESMTPSA id oh6-20020a17090b3a4600b0028cc9afaae9sm10360385pjb.34.2024.01.15.15.01.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jan 2024 15:01:18 -0800 (PST) Received: from [192.168.253.23] (helo=devoid.disaster.area) by dread.disaster.area with esmtp (Exim 4.96) (envelope-from ) id 1rPVxE-00AtK0-0I; Tue, 16 Jan 2024 10:01:15 +1100 Received: from dave by devoid.disaster.area with local (Exim 4.97) (envelope-from ) id 1rPVxD-0000000H8fc-2Nuf; Tue, 16 Jan 2024 10:01:15 +1100 From: Dave Chinner To: linux-xfs@vger.kernel.org Cc: willy@infradead.org, linux-mm@kvack.org Subject: [PATCH 04/12] xfs: convert kmem_free() for kvmalloc users to kvfree() Date: Tue, 16 Jan 2024 09:59:42 +1100 Message-ID: <20240115230113.4080105-5-david@fromorbit.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240115230113.4080105-1-david@fromorbit.com> References: <20240115230113.4080105-1-david@fromorbit.com> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: E58B9A0005 X-Stat-Signature: nz7j45y6bmchik4msk48ncde7bxqb9r9 X-HE-Tag: 1705359680-990975 X-HE-Meta: U2FsdGVkX19n1tIEyT74BKgoQbD8tiva/35420QjpaPW/+OdNHk5yU6Ikcy6HZtenupTncmWeXxz5nKS6mK8vr8ltZQ1fRk1xAo3WcBgYHNAlBWUJvynvUqGJfXDAMHZvRFFk57nsHxp2dkPE0VYjC+f/xmkVR2keJIc89HPpvpNW4IGYhpYo5SRtUQWcv+Adcka+AmThUVa+tybbwmRIptvIQl0O07jReVI7B92Lk6j5F0WyGZnC2ts7BkVrEoAFuWd5mYVTdg2eGN070Ohcs85uy/8zsPdTZi3vFu81TNNUzzUmP7c5UDq6s1Daf4B61bcUCnmrkEddd5M58NhLsYbWP9gGiyhmsFnoZ0LdhYknmqDqQZzPP4VzmPllKlH+Ct/FvllPOI3JYc/uI/y6QTsF9VJNLGzyqWHZmB/IO4UwWBSxq951nX9ZJRXxOOTxVpEVJpvckO6bZdNQAx1SGtRq8v4oGKfcCNE89ykgr568idaPZemDDKXA2D3pr+R2YSVTru0RNHyjfbv6UqFdyhi0MYbagD1wCD1x17CDaTBF3RVMxiDno3YofaBNDbb1QfA17DCvySWsPT7n6IVTcwxlqmSCoKrioWLdEEQkVvjBtYYh3TIyHyhQzSeFaqgVkumG36OyZF0NoIKWejXLjH9UbgZbJGXL4513ZfqXMh0v56RtAALo/m0WjYS5MdCrbbFZFXkygDcurWv/oC6ij+wAKUbZKimK6slRTiflnS/cv7kYsJR01+zziuT1xMI8iXKB83BUz+spPQ/ch8q/D2Cod4UV5gG/ZQ4IJGmmbKRxodq9kCTPDocll3NSmXoQhvFtOmn1a0QlcPDZH0ORmXtTBpddjBD+1j6nBVLK4nmcDceaPU2n8ScM5CB5BhG8vV2HLqtQ2/n07AmDh3G/iW3WaRKl8cebJMhINubnjvYSQ5gL6ukCeuCRqgqR7dTGyXeySYga1VQildVEX/ hm+Rfmcn LnHtcoOwfEKI6Nv8UQ0r4xqPRUP66f0DPV1iIVgUGKYeYIXi93sBGcJ0qn1B4JhyZklgYjA4/zJMmLWr9pp+yJiUsiLFwFOv0nVx2TwXa8wpOmj23q3Ev1Rf8+GyA+6IRpUOwqn8e4g2vdunr/EvBmAAQj7aihD12KcG8EGgFCMCMEygxcZ8w3JZ2qG5e8UmPglYxw5DfYmk2k+CBlSekFJ7Q+Y7KmwRl0KrnaOy8A76y717IDP43unlrKpU84DlGYDCcVrO2CB5ymiPwyTDPTY/bIYN93BFpUv7zhUJfMae92uq0vManpes3QVoXJzZlYsjdo7cDNrkRwLDF4L3Z1xuYpoVWUIWM6toCXhSHOBktXj4jpxm9zo5Gdg2xXZyqGkipebOy4XyssxB6ihVOiyOyKsyC3xXCvy2P/qQhCXb3Gp35P9ZT6QRoCu+y0aPEaI6SS6geHlkpKYbDJie6ghmBEXOJe5a2+eyVkIBOeU/hmmU2NvnIyAIgJQ9GXDsVV7Pzvsf5Dhj9uvklOUgOl1U4dg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.005773, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: From: Dave Chinner Start getting rid of kmem_free() by converting all the cases where memory can come from vmalloc interfaces to calling kvfree() directly. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong --- fs/xfs/xfs_acl.c | 4 ++-- fs/xfs/xfs_attr_item.c | 4 ++-- fs/xfs/xfs_bmap_item.c | 4 ++-- fs/xfs/xfs_buf_item.c | 2 +- fs/xfs/xfs_dquot.c | 2 +- fs/xfs/xfs_extfree_item.c | 4 ++-- fs/xfs/xfs_icreate_item.c | 2 +- fs/xfs/xfs_inode_item.c | 2 +- fs/xfs/xfs_ioctl.c | 2 +- fs/xfs/xfs_log.c | 4 ++-- fs/xfs/xfs_log_cil.c | 2 +- fs/xfs/xfs_log_recover.c | 42 +++++++++++++++++++------------------- fs/xfs/xfs_refcount_item.c | 4 ++-- fs/xfs/xfs_rmap_item.c | 4 ++-- fs/xfs/xfs_rtalloc.c | 6 +++--- 15 files changed, 44 insertions(+), 44 deletions(-) diff --git a/fs/xfs/xfs_acl.c b/fs/xfs/xfs_acl.c index 6b840301817a..4bf69c9c088e 100644 --- a/fs/xfs/xfs_acl.c +++ b/fs/xfs/xfs_acl.c @@ -167,7 +167,7 @@ xfs_get_acl(struct inode *inode, int type, bool rcu) acl = ERR_PTR(error); } - kmem_free(args.value); + kvfree(args.value); return acl; } @@ -204,7 +204,7 @@ __xfs_set_acl(struct inode *inode, struct posix_acl *acl, int type) } error = xfs_attr_change(&args); - kmem_free(args.value); + kvfree(args.value); /* * If the attribute didn't exist to start with that's fine. diff --git a/fs/xfs/xfs_attr_item.c b/fs/xfs/xfs_attr_item.c index 2e454a0d6f19..f7ba80d575d4 100644 --- a/fs/xfs/xfs_attr_item.c +++ b/fs/xfs/xfs_attr_item.c @@ -108,7 +108,7 @@ STATIC void xfs_attri_item_free( struct xfs_attri_log_item *attrip) { - kmem_free(attrip->attri_item.li_lv_shadow); + kvfree(attrip->attri_item.li_lv_shadow); xfs_attri_log_nameval_put(attrip->attri_nameval); kmem_cache_free(xfs_attri_cache, attrip); } @@ -251,7 +251,7 @@ static inline struct xfs_attrd_log_item *ATTRD_ITEM(struct xfs_log_item *lip) STATIC void xfs_attrd_item_free(struct xfs_attrd_log_item *attrdp) { - kmem_free(attrdp->attrd_item.li_lv_shadow); + kvfree(attrdp->attrd_item.li_lv_shadow); kmem_cache_free(xfs_attrd_cache, attrdp); } diff --git a/fs/xfs/xfs_bmap_item.c b/fs/xfs/xfs_bmap_item.c index 52fb8a148b7d..029a6a8d0efd 100644 --- a/fs/xfs/xfs_bmap_item.c +++ b/fs/xfs/xfs_bmap_item.c @@ -40,7 +40,7 @@ STATIC void xfs_bui_item_free( struct xfs_bui_log_item *buip) { - kmem_free(buip->bui_item.li_lv_shadow); + kvfree(buip->bui_item.li_lv_shadow); kmem_cache_free(xfs_bui_cache, buip); } @@ -201,7 +201,7 @@ xfs_bud_item_release( struct xfs_bud_log_item *budp = BUD_ITEM(lip); xfs_bui_release(budp->bud_buip); - kmem_free(budp->bud_item.li_lv_shadow); + kvfree(budp->bud_item.li_lv_shadow); kmem_cache_free(xfs_bud_cache, budp); } diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c index ec93d34188c8..545040c6ae87 100644 --- a/fs/xfs/xfs_buf_item.c +++ b/fs/xfs/xfs_buf_item.c @@ -1044,7 +1044,7 @@ xfs_buf_item_free( struct xfs_buf_log_item *bip) { xfs_buf_item_free_format(bip); - kmem_free(bip->bli_item.li_lv_shadow); + kvfree(bip->bli_item.li_lv_shadow); kmem_cache_free(xfs_buf_item_cache, bip); } diff --git a/fs/xfs/xfs_dquot.c b/fs/xfs/xfs_dquot.c index a93ad76f23c5..17c82f5e783c 100644 --- a/fs/xfs/xfs_dquot.c +++ b/fs/xfs/xfs_dquot.c @@ -53,7 +53,7 @@ xfs_qm_dqdestroy( { ASSERT(list_empty(&dqp->q_lru)); - kmem_free(dqp->q_logitem.qli_item.li_lv_shadow); + kvfree(dqp->q_logitem.qli_item.li_lv_shadow); mutex_destroy(&dqp->q_qlock); XFS_STATS_DEC(dqp->q_mount, xs_qm_dquot); diff --git a/fs/xfs/xfs_extfree_item.c b/fs/xfs/xfs_extfree_item.c index 1d1185fca6a5..6062703a2723 100644 --- a/fs/xfs/xfs_extfree_item.c +++ b/fs/xfs/xfs_extfree_item.c @@ -40,7 +40,7 @@ STATIC void xfs_efi_item_free( struct xfs_efi_log_item *efip) { - kmem_free(efip->efi_item.li_lv_shadow); + kvfree(efip->efi_item.li_lv_shadow); if (efip->efi_format.efi_nextents > XFS_EFI_MAX_FAST_EXTENTS) kmem_free(efip); else @@ -229,7 +229,7 @@ static inline struct xfs_efd_log_item *EFD_ITEM(struct xfs_log_item *lip) STATIC void xfs_efd_item_free(struct xfs_efd_log_item *efdp) { - kmem_free(efdp->efd_item.li_lv_shadow); + kvfree(efdp->efd_item.li_lv_shadow); if (efdp->efd_format.efd_nextents > XFS_EFD_MAX_FAST_EXTENTS) kmem_free(efdp); else diff --git a/fs/xfs/xfs_icreate_item.c b/fs/xfs/xfs_icreate_item.c index b05314d48176..4345db501714 100644 --- a/fs/xfs/xfs_icreate_item.c +++ b/fs/xfs/xfs_icreate_item.c @@ -63,7 +63,7 @@ STATIC void xfs_icreate_item_release( struct xfs_log_item *lip) { - kmem_free(ICR_ITEM(lip)->ic_item.li_lv_shadow); + kvfree(ICR_ITEM(lip)->ic_item.li_lv_shadow); kmem_cache_free(xfs_icreate_cache, ICR_ITEM(lip)); } diff --git a/fs/xfs/xfs_inode_item.c b/fs/xfs/xfs_inode_item.c index 0aee97ba0be8..bfbeafc8e120 100644 --- a/fs/xfs/xfs_inode_item.c +++ b/fs/xfs/xfs_inode_item.c @@ -856,7 +856,7 @@ xfs_inode_item_destroy( ASSERT(iip->ili_item.li_buf == NULL); ip->i_itemp = NULL; - kmem_free(iip->ili_item.li_lv_shadow); + kvfree(iip->ili_item.li_lv_shadow); kmem_cache_free(xfs_ili_cache, iip); } diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c index f02b6e558af5..45fb169bd819 100644 --- a/fs/xfs/xfs_ioctl.c +++ b/fs/xfs/xfs_ioctl.c @@ -493,7 +493,7 @@ xfs_attrmulti_attr_get( error = -EFAULT; out_kfree: - kmem_free(args.value); + kvfree(args.value); return error; } diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c index d38cfaadc726..0009ffbec932 100644 --- a/fs/xfs/xfs_log.c +++ b/fs/xfs/xfs_log.c @@ -1662,7 +1662,7 @@ xlog_alloc_log( out_free_iclog: for (iclog = log->l_iclog; iclog; iclog = prev_iclog) { prev_iclog = iclog->ic_next; - kmem_free(iclog->ic_data); + kvfree(iclog->ic_data); kmem_free(iclog); if (prev_iclog == log->l_iclog) break; @@ -2119,7 +2119,7 @@ xlog_dealloc_log( iclog = log->l_iclog; for (i = 0; i < log->l_iclog_bufs; i++) { next_iclog = iclog->ic_next; - kmem_free(iclog->ic_data); + kvfree(iclog->ic_data); kmem_free(iclog); iclog = next_iclog; } diff --git a/fs/xfs/xfs_log_cil.c b/fs/xfs/xfs_log_cil.c index 3c705f22b0ab..2c0512916cc9 100644 --- a/fs/xfs/xfs_log_cil.c +++ b/fs/xfs/xfs_log_cil.c @@ -339,7 +339,7 @@ xlog_cil_alloc_shadow_bufs( * the buffer, only the log vector header and the iovec * storage. */ - kmem_free(lip->li_lv_shadow); + kvfree(lip->li_lv_shadow); lv = xlog_kvmalloc(buf_size); memset(lv, 0, xlog_cil_iovec_space(niovecs)); diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c index e3bd503edcab..295306ef6959 100644 --- a/fs/xfs/xfs_log_recover.c +++ b/fs/xfs/xfs_log_recover.c @@ -361,7 +361,7 @@ xlog_find_verify_cycle( *new_blk = -1; out: - kmem_free(buffer); + kvfree(buffer); return error; } @@ -477,7 +477,7 @@ xlog_find_verify_log_record( *last_blk = i; out: - kmem_free(buffer); + kvfree(buffer); return error; } @@ -731,7 +731,7 @@ xlog_find_head( goto out_free_buffer; } - kmem_free(buffer); + kvfree(buffer); if (head_blk == log_bbnum) *return_head_blk = 0; else @@ -745,7 +745,7 @@ xlog_find_head( return 0; out_free_buffer: - kmem_free(buffer); + kvfree(buffer); if (error) xfs_warn(log->l_mp, "failed to find log head"); return error; @@ -999,7 +999,7 @@ xlog_verify_tail( "Tail block (0x%llx) overwrite detected. Updated to 0x%llx", orig_tail, *tail_blk); out: - kmem_free(buffer); + kvfree(buffer); return error; } @@ -1046,7 +1046,7 @@ xlog_verify_head( error = xlog_rseek_logrec_hdr(log, *head_blk, *tail_blk, XLOG_MAX_ICLOGS, tmp_buffer, &tmp_rhead_blk, &tmp_rhead, &tmp_wrapped); - kmem_free(tmp_buffer); + kvfree(tmp_buffer); if (error < 0) return error; @@ -1365,7 +1365,7 @@ xlog_find_tail( error = xlog_clear_stale_blocks(log, tail_lsn); done: - kmem_free(buffer); + kvfree(buffer); if (error) xfs_warn(log->l_mp, "failed to locate log tail"); @@ -1399,6 +1399,7 @@ xlog_find_zeroed( xfs_daddr_t new_blk, last_blk, start_blk; xfs_daddr_t num_scan_bblks; int error, log_bbnum = log->l_logBBsize; + int ret = 1; *blk_no = 0; @@ -1413,8 +1414,7 @@ xlog_find_zeroed( first_cycle = xlog_get_cycle(offset); if (first_cycle == 0) { /* completely zeroed log */ *blk_no = 0; - kmem_free(buffer); - return 1; + goto out_free_buffer; } /* check partially zeroed log */ @@ -1424,8 +1424,8 @@ xlog_find_zeroed( last_cycle = xlog_get_cycle(offset); if (last_cycle != 0) { /* log completely written to */ - kmem_free(buffer); - return 0; + ret = 0; + goto out_free_buffer; } /* we have a partially zeroed log */ @@ -1471,10 +1471,10 @@ xlog_find_zeroed( *blk_no = last_blk; out_free_buffer: - kmem_free(buffer); + kvfree(buffer); if (error) return error; - return 1; + return ret; } /* @@ -1583,7 +1583,7 @@ xlog_write_log_records( } out_free_buffer: - kmem_free(buffer); + kvfree(buffer); return error; } @@ -2183,7 +2183,7 @@ xlog_recover_add_to_trans( "bad number of regions (%d) in inode log format", in_f->ilf_size); ASSERT(0); - kmem_free(ptr); + kvfree(ptr); return -EFSCORRUPTED; } @@ -2197,7 +2197,7 @@ xlog_recover_add_to_trans( "log item region count (%d) overflowed size (%d)", item->ri_cnt, item->ri_total); ASSERT(0); - kmem_free(ptr); + kvfree(ptr); return -EFSCORRUPTED; } @@ -2227,7 +2227,7 @@ xlog_recover_free_trans( /* Free the regions in the item. */ list_del(&item->ri_list); for (i = 0; i < item->ri_cnt; i++) - kmem_free(item->ri_buf[i].i_addr); + kvfree(item->ri_buf[i].i_addr); /* Free the item itself */ kmem_free(item->ri_buf); kmem_free(item); @@ -3024,7 +3024,7 @@ xlog_do_recovery_pass( hblks = xlog_logrec_hblks(log, rhead); if (hblks != 1) { - kmem_free(hbp); + kvfree(hbp); hbp = xlog_alloc_buffer(log, hblks); } } else { @@ -3038,7 +3038,7 @@ xlog_do_recovery_pass( return -ENOMEM; dbp = xlog_alloc_buffer(log, BTOBB(h_size)); if (!dbp) { - kmem_free(hbp); + kvfree(hbp); return -ENOMEM; } @@ -3199,9 +3199,9 @@ xlog_do_recovery_pass( } bread_err2: - kmem_free(dbp); + kvfree(dbp); bread_err1: - kmem_free(hbp); + kvfree(hbp); /* * Submit buffers that have been added from the last record processed, diff --git a/fs/xfs/xfs_refcount_item.c b/fs/xfs/xfs_refcount_item.c index 78d0cda60abf..a9b322e23cfb 100644 --- a/fs/xfs/xfs_refcount_item.c +++ b/fs/xfs/xfs_refcount_item.c @@ -36,7 +36,7 @@ STATIC void xfs_cui_item_free( struct xfs_cui_log_item *cuip) { - kmem_free(cuip->cui_item.li_lv_shadow); + kvfree(cuip->cui_item.li_lv_shadow); if (cuip->cui_format.cui_nextents > XFS_CUI_MAX_FAST_EXTENTS) kmem_free(cuip); else @@ -207,7 +207,7 @@ xfs_cud_item_release( struct xfs_cud_log_item *cudp = CUD_ITEM(lip); xfs_cui_release(cudp->cud_cuip); - kmem_free(cudp->cud_item.li_lv_shadow); + kvfree(cudp->cud_item.li_lv_shadow); kmem_cache_free(xfs_cud_cache, cudp); } diff --git a/fs/xfs/xfs_rmap_item.c b/fs/xfs/xfs_rmap_item.c index 31a921fc34b2..489ca8c0e1dc 100644 --- a/fs/xfs/xfs_rmap_item.c +++ b/fs/xfs/xfs_rmap_item.c @@ -36,7 +36,7 @@ STATIC void xfs_rui_item_free( struct xfs_rui_log_item *ruip) { - kmem_free(ruip->rui_item.li_lv_shadow); + kvfree(ruip->rui_item.li_lv_shadow); if (ruip->rui_format.rui_nextents > XFS_RUI_MAX_FAST_EXTENTS) kmem_free(ruip); else @@ -206,7 +206,7 @@ xfs_rud_item_release( struct xfs_rud_log_item *rudp = RUD_ITEM(lip); xfs_rui_release(rudp->rud_ruip); - kmem_free(rudp->rud_item.li_lv_shadow); + kvfree(rudp->rud_item.li_lv_shadow); kmem_cache_free(xfs_rud_cache, rudp); } diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c index 8a8d6197203e..57ed9baaf156 100644 --- a/fs/xfs/xfs_rtalloc.c +++ b/fs/xfs/xfs_rtalloc.c @@ -1059,10 +1059,10 @@ xfs_growfs_rt( */ if (rsum_cache != mp->m_rsum_cache) { if (error) { - kmem_free(mp->m_rsum_cache); + kvfree(mp->m_rsum_cache); mp->m_rsum_cache = rsum_cache; } else { - kmem_free(rsum_cache); + kvfree(rsum_cache); } } @@ -1233,7 +1233,7 @@ void xfs_rtunmount_inodes( struct xfs_mount *mp) { - kmem_free(mp->m_rsum_cache); + kvfree(mp->m_rsum_cache); if (mp->m_rbmip) xfs_irele(mp->m_rbmip); if (mp->m_rsumip)