History

fs: Add uoff_t

In a recent commit, I inadvertently changed a comparison from being an unsigned comparison (on 64-bit systems) to being a signed comparison (which it had always been on 32-bit systems). This led to a sporadic fstests failure. To make sure this comparison is always unsigned, introduce a new type, uoff_t which is the unsigned version of loff_t. Generally file sizes are restricted to being a signed integer, but in these two places it is convenient to pass -1 to indicate "up to the end of the file".

Matthew Wilcox (Oracle) committed 11 months ago

Commit 37d369f1 parent a77a5956 files · +11 −9Browse files

Showing the changes to include/uapi (1 of 6 files). Show all

Unified · Split

include/uapi/asm-generic/posix_types.h+1−0
@@ -86,6 +86,7 @@ typedef struct { · 85 unmodified lines
8686 */
8787 typedef __kernel_long_t __kernel_off_t;
8888 typedef long long __kernel_loff_t;
89+typedef unsigned long long __kernel_uoff_t;
8990 typedef __kernel_long_t __kernel_old_time_t;
9091 #ifndef __KERNEL__
9192 typedef __kernel_long_t __kernel_time_t;