All of lore.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@zeniv.linux.org.uk>
To: linux-fsdevel@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 3/4] minixfs: Use dir_put_page() in minix_unlink() and minix_rename()
Date: Wed, 13 Dec 2023 00:08:48 +0000	[thread overview]
Message-ID: <20231213000849.2748576-3-viro@zeniv.linux.org.uk> (raw)
In-Reply-To: <20231213000849.2748576-1-viro@zeniv.linux.org.uk>

... rather than open-coding it there.  Counterpart of the
corresponding fs/sysv commit from Fabio's series...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
 fs/minix/dir.c   |  6 ------
 fs/minix/minix.h |  5 +++++
 fs/minix/namei.c | 12 ++++--------
 3 files changed, 9 insertions(+), 14 deletions(-)

diff --git a/fs/minix/dir.c b/fs/minix/dir.c
index 4e5483adea40..ccb6c47fd7fe 100644
--- a/fs/minix/dir.c
+++ b/fs/minix/dir.c
@@ -26,12 +26,6 @@ const struct file_operations minix_dir_operations = {
 	.fsync		= generic_file_fsync,
 };
 
-static inline void dir_put_page(struct page *page)
-{
-	kunmap(page);
-	put_page(page);
-}
-
 /*
  * Return the offset into page `page_nr' of the last valid
  * byte in that page, plus one.
diff --git a/fs/minix/minix.h b/fs/minix/minix.h
index d493507c064f..cb42b6cf7909 100644
--- a/fs/minix/minix.h
+++ b/fs/minix/minix.h
@@ -64,6 +64,11 @@ extern int V2_minix_get_block(struct inode *, long, struct buffer_head *, int);
 extern unsigned V1_minix_blocks(loff_t, struct super_block *);
 extern unsigned V2_minix_blocks(loff_t, struct super_block *);
 
+static inline void dir_put_page(struct page *page)
+{
+	kunmap(page);
+	put_page(page);
+}
 extern struct minix_dir_entry *minix_find_entry(struct dentry*, struct page**);
 extern int minix_add_link(struct dentry*, struct inode*);
 extern int minix_delete_entry(struct minix_dir_entry*, struct page*);
diff --git a/fs/minix/namei.c b/fs/minix/namei.c
index 114084d5636a..20923a15e30a 100644
--- a/fs/minix/namei.c
+++ b/fs/minix/namei.c
@@ -149,8 +149,7 @@ static int minix_unlink(struct inode * dir, struct dentry *dentry)
 	if (!de)
 		return -ENOENT;
 	err = minix_delete_entry(de, page);
-	kunmap(page);
-	put_page(page);
+	dir_put_page(page);
 
 	if (err)
 		return err;
@@ -242,13 +241,10 @@ static int minix_rename(struct mnt_idmap *idmap,
 			inode_dec_link_count(old_dir);
 	}
 out_dir:
-	if (dir_de) {
-		kunmap(dir_page);
-		put_page(dir_page);
-	}
+	if (dir_de)
+		dir_put_page(dir_page);
 out_old:
-	kunmap(old_page);
-	put_page(old_page);
+	dir_put_page(old_page);
 out:
 	return err;
 }
-- 
2.39.2


  parent reply	other threads:[~2023-12-13  0:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-13  0:06 [minixfs] conversion to kmap_local_page() Al Viro
2023-12-13  0:08 ` [PATCH 1/4] minixfs: use offset_in_page() Al Viro
2023-12-13  0:08   ` [PATCH 2/4] minixfs: change the signature of dir_get_page() Al Viro
2023-12-14 11:58     ` Fabio M. De Francesco
2023-12-13  0:08   ` Al Viro [this message]
2023-12-14 12:02     ` [PATCH 3/4] minixfs: Use dir_put_page() in minix_unlink() and minix_rename() Fabio M. De Francesco
2023-12-13  0:08   ` [PATCH 4/4] minixfs: switch to kmap_local_page() Al Viro
2023-12-14 12:06     ` Fabio M. De Francesco
2023-12-14 11:51   ` [PATCH 1/4] minixfs: use offset_in_page() Fabio M. De Francesco

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=20231213000849.2748576-3-viro@zeniv.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.