linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Carlos Maiolino <cmaiolino@redhat.com>
To: linux-xfs@vger.kernel.org
Subject: [PATCH 3/4] xfs: Modify xlog_ticket_alloc() to use kernel's MM API
Date: Wed,  8 Jul 2020 14:56:07 +0200	[thread overview]
Message-ID: <20200708125608.155645-4-cmaiolino@redhat.com> (raw)
In-Reply-To: <20200708125608.155645-1-cmaiolino@redhat.com>

change xlog_ticket_alloc() to use default kmem_cache_zalloc(), and
modify its callers to pass MM flags as arguments.

Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
---
 fs/xfs/xfs_log.c      | 7 ++++---
 fs/xfs/xfs_log_cil.c  | 2 +-
 fs/xfs/xfs_log_priv.h | 2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
index 00fda2e8e7380..6d40d479e34a1 100644
--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -433,7 +433,8 @@ xfs_log_reserve(
 	XFS_STATS_INC(mp, xs_try_logspace);
 
 	ASSERT(*ticp == NULL);
-	tic = xlog_ticket_alloc(log, unit_bytes, cnt, client, permanent, 0);
+	tic = xlog_ticket_alloc(log, unit_bytes, cnt, client, permanent,
+				(GFP_KERNEL | __GFP_NOFAIL));
 	*ticp = tic;
 
 	xlog_grant_push_ail(log, tic->t_cnt ? tic->t_unit_res * tic->t_cnt
@@ -3409,12 +3410,12 @@ xlog_ticket_alloc(
 	int			cnt,
 	char			client,
 	bool			permanent,
-	xfs_km_flags_t		alloc_flags)
+	gfp_t			alloc_flags)
 {
 	struct xlog_ticket	*tic;
 	int			unit_res;
 
-	tic = kmem_zone_zalloc(xfs_log_ticket_zone, alloc_flags);
+	tic = kmem_cache_zalloc(xfs_log_ticket_zone, alloc_flags);
 	if (!tic)
 		return NULL;
 
diff --git a/fs/xfs/xfs_log_cil.c b/fs/xfs/xfs_log_cil.c
index 9ed90368ab311..636c53a62cd3f 100644
--- a/fs/xfs/xfs_log_cil.c
+++ b/fs/xfs/xfs_log_cil.c
@@ -38,7 +38,7 @@ xlog_cil_ticket_alloc(
 	struct xlog_ticket *tic;
 
 	tic = xlog_ticket_alloc(log, 0, 1, XFS_TRANSACTION, 0,
-				KM_NOFS);
+				(GFP_NOFS | __GFP_NOFAIL));
 
 	/*
 	 * set the current reservation to zero so we know to steal the basic
diff --git a/fs/xfs/xfs_log_priv.h b/fs/xfs/xfs_log_priv.h
index 75a62870b63af..039b5cf6e692e 100644
--- a/fs/xfs/xfs_log_priv.h
+++ b/fs/xfs/xfs_log_priv.h
@@ -465,7 +465,7 @@ xlog_ticket_alloc(
 	int		count,
 	char		client,
 	bool		permanent,
-	xfs_km_flags_t	alloc_flags);
+	gfp_t		alloc_flags);
 
 
 static inline void
-- 
2.26.2


  parent reply	other threads:[~2020-07-08 12:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-08 12:56 [PATCH 0/4] Continue xfs kmem cleanup Carlos Maiolino
2020-07-08 12:56 ` [PATCH 1/4] xfs: Remove kmem_zone_alloc() usage Carlos Maiolino
2020-07-09  2:45   ` Dave Chinner
2020-07-08 12:56 ` [PATCH 2/4] xfs: Remove kmem_zone_zalloc() usage Carlos Maiolino
2020-07-09  2:55   ` Dave Chinner
2020-07-09  8:55     ` Carlos Maiolino
2020-07-09 16:42       ` Darrick J. Wong
2020-07-09 21:52         ` Dave Chinner
2020-07-08 12:56 ` Carlos Maiolino [this message]
2020-07-09  3:00   ` [PATCH 3/4] xfs: Modify xlog_ticket_alloc() to use kernel's MM API Dave Chinner
2020-07-08 12:56 ` [PATCH 4/4] xfs: remove xfs_zone_{alloc,zalloc} helpers Carlos Maiolino
2020-07-09  3:00   ` Dave Chinner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200708125608.155645-4-cmaiolino@redhat.com \
    --to=cmaiolino@redhat.com \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).