svn commit: r344484 - head/sys/compat/linuxkpi/common/include/linux

Matt Macy mmacy at FreeBSD.org
Sat Feb 23 20:45:47 UTC 2019


Author: mmacy
Date: Sat Feb 23 20:45:45 2019
New Revision: 344484
URL: https://svnweb.freebsd.org/changeset/base/344484

Log:
  linux/fs: simplify interop and correct definition of loff_t
  
  - offsets can be negative, loff_t needs to be signed, it also simplifies
    interop with the rest of the code base to use off_t than the actual linux
    definition "long long"
  - don't rely on the defining "file" to "linux_file" in interface definitions
    as that causes heartache with includes
  
  Reviewed by:	hps@
  MFC after:	1 week
  Sponsored by:	iX Systems
  Differential Revision:	https://reviews.freebsd.org/D19274

Modified:
  head/sys/compat/linuxkpi/common/include/linux/fs.h
  head/sys/compat/linuxkpi/common/include/linux/types.h

Modified: head/sys/compat/linuxkpi/common/include/linux/fs.h
==============================================================================
--- head/sys/compat/linuxkpi/common/include/linux/fs.h	Sat Feb 23 14:27:09 2019	(r344483)
+++ head/sys/compat/linuxkpi/common/include/linux/fs.h	Sat Feb 23 20:45:45 2019	(r344484)
@@ -129,25 +129,25 @@ do {									\
 		pgsigio(*(queue), (sig), 0);				\
 } while (0)
 
-typedef int (*filldir_t)(void *, const char *, int, loff_t, u64, unsigned);
+typedef int (*filldir_t)(void *, const char *, int, off_t, u64, unsigned);
 
 struct file_operations {
 	struct module *owner;
-	ssize_t (*read)(struct file *, char __user *, size_t, loff_t *);
-	ssize_t (*write)(struct file *, const char __user *, size_t, loff_t *);
-	unsigned int (*poll) (struct file *, struct poll_table_struct *);
-	long (*unlocked_ioctl)(struct file *, unsigned int, unsigned long);
-	long (*compat_ioctl)(struct file *, unsigned int, unsigned long);
-	int (*mmap)(struct file *, struct vm_area_struct *);
+	ssize_t (*read)(struct linux_file *, char __user *, size_t, off_t *);
+	ssize_t (*write)(struct linux_file *, const char __user *, size_t, off_t *);
+	unsigned int (*poll) (struct linux_file *, struct poll_table_struct *);
+	long (*unlocked_ioctl)(struct linux_file *, unsigned int, unsigned long);
+	long (*compat_ioctl)(struct linux_file *, unsigned int, unsigned long);
+	int (*mmap)(struct linux_file *, struct vm_area_struct *);
 	int (*open)(struct inode *, struct file *);
-	int (*release)(struct inode *, struct file *);
-	int (*fasync)(int, struct file *, int);
+	int (*release)(struct inode *, struct linux_file *);
+	int (*fasync)(int, struct linux_file *, int);
 
 /* Although not supported in FreeBSD, to align with Linux code
  * we are adding llseek() only when it is mapped to no_llseek which returns
  * an illegal seek error
  */
-	loff_t (*llseek)(struct file *, loff_t, int);
+	off_t (*llseek)(struct linux_file *, off_t, int);
 #if 0
 	/* We do not support these methods.  Don't permit them to compile. */
 	loff_t (*llseek)(struct file *, loff_t, int);

Modified: head/sys/compat/linuxkpi/common/include/linux/types.h
==============================================================================
--- head/sys/compat/linuxkpi/common/include/linux/types.h	Sat Feb 23 14:27:09 2019	(r344483)
+++ head/sys/compat/linuxkpi/common/include/linux/types.h	Sat Feb 23 20:45:45 2019	(r344484)
@@ -55,7 +55,7 @@ typedef uint64_t __be64;
 
 typedef unsigned int    uint;
 typedef unsigned gfp_t;
-typedef uint64_t loff_t;
+typedef off_t loff_t;
 typedef vm_paddr_t resource_size_t;
 typedef uint16_t __bitwise__ __sum16;
 typedef unsigned long pgoff_t;


More information about the svn-src-all mailing list