]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ioctl: Fix return type of several functions from long to int
authorYuichiro Tsuji <yuichtsu@amazon.com>
Tue, 21 Jan 2025 07:08:23 +0000 (16:08 +0900)
committerChristian Brauner <brauner@kernel.org>
Fri, 21 Feb 2025 09:25:32 +0000 (10:25 +0100)
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.

Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Yuichiro Tsuji <yuichtsu@amazon.com>
Link: https://lore.kernel.org/r/20250121070844.4413-3-yuichtsu@amazon.com
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/ioctl.c
include/linux/fs.h

index 638a36be31c14afc66a7fd6eb237d9545e8ad997..c91fd2b46a77f6f1ea99aab56b4d92b6d9a8c534 100644 (file)
@@ -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,8 +228,8 @@ 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,
-                            u64 off, u64 olen, u64 destoff)
+static int ioctl_file_clone(struct file *dst_file, unsigned long srcfd,
+                           u64 off, u64 olen, u64 destoff)
 {
        CLASS(fd, src_file)(srcfd);
        loff_t cloned;
@@ -248,8 +248,8 @@ static long ioctl_file_clone(struct file *dst_file, unsigned long srcfd,
        return ret;
 }
 
-static long ioctl_file_clone_range(struct file *file,
-                                  struct file_clone_range __user *argp)
+static int ioctl_file_clone_range(struct file *file,
+                                 struct file_clone_range __user *argp)
 {
        struct file_clone_range args;
 
index d1f1673956e20100211e289e4e754206a9e26b2d..c1763b022d06af9d5fd4458bfa30efea3fddc932 100644 (file)
@@ -2030,7 +2030,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,