From: Yuichiro Tsuji <yuichtsu@amazon.com>
To: <linux-fsdevel@vger.kernel.org>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
Kuniyuki Iwashima <kuniyu@amazon.com>,
Yuichiro Tsuji <yuichtsu@amazon.com>
Subject: [PATCH v1 vfs 2/2] ioctl: Fix return type of several functions from long to int
Date: Sun, 19 Jan 2025 18:02:49 +0900 [thread overview]
Message-ID: <20250119090322.2598-3-yuichtsu@amazon.com> (raw)
In-Reply-To: <20250119090322.2598-1-yuichtsu@amazon.com>
Fix the return type of several functions from long to int to match its actu
al behavior. These functions only return int values. This change improves
type consistency across the filesystem code and aligns the function signatu
re with its existing implementation and usage.
---
fs/ioctl.c | 6 +++---
include/linux/fs.h | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/fs/ioctl.c b/fs/ioctl.c
index 638a36be31c1..502306499dfd 100644
--- a/fs/ioctl.c
+++ b/fs/ioctl.c
@@ -41,7 +41,7 @@
*
* Returns 0 on success, -errno on error.
*/
-long vfs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
+int vfs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
{
int error = -ENOTTY;
@@ -228,7 +228,7 @@ static int ioctl_fiemap(struct file *filp, struct fiemap __user *ufiemap)
return error;
}
-static long ioctl_file_clone(struct file *dst_file, unsigned long srcfd,
+static int ioctl_file_clone(struct file *dst_file, unsigned long srcfd,
u64 off, u64 olen, u64 destoff)
{
CLASS(fd, src_file)(srcfd);
@@ -248,7 +248,7 @@ static long ioctl_file_clone(struct file *dst_file, unsigned long srcfd,
return ret;
}
-static long ioctl_file_clone_range(struct file *file,
+static int ioctl_file_clone_range(struct file *file,
struct file_clone_range __user *argp)
{
struct file_clone_range args;
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 999ae4790a5a..1094fb0b601c 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1992,7 +1992,7 @@ int vfs_fchown(struct file *file, uid_t user, gid_t group);
int vfs_fchmod(struct file *file, umode_t mode);
int vfs_utimes(const struct path *path, struct timespec64 *times);
-extern long vfs_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
+int vfs_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
#ifdef CONFIG_COMPAT
extern long compat_ptr_ioctl(struct file *file, unsigned int cmd,
--
2.43.5
next prev parent reply other threads:[~2025-01-19 9:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-19 9:02 [PATCH v1 vfs 0/2] Fix the return type of several functions from long to int Yuichiro Tsuji
2025-01-19 9:02 ` [PATCH v1 vfs 1/2] open: Fix " Yuichiro Tsuji
2025-01-19 9:02 ` Yuichiro Tsuji [this message]
2025-01-20 15:18 ` [PATCH v1 vfs 0/2] Fix the " Christian Brauner
2025-01-20 15:31 ` Jan Kara
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=20250119090322.2598-3-yuichtsu@amazon.com \
--to=yuichtsu@amazon.com \
--cc=brauner@kernel.org \
--cc=jack@suse.cz \
--cc=kuniyu@amazon.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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