Currently support for 64-bit sector_t and blkcnt_t is optional on 32-bit architectures. These types are required to support block device and/or file sizes larger than 2 TiB, and have generally defaulted to on for a long time. Enabling the option only increases the i386 tinyconfig size by 145 bytes, and many data structures already always use 64-bit values for their in-core and on-disk data structures anyway, so there should not be a large change in dynamic memory usage either. Dropping this option removes a somewhat weird non-default config that has cause various bugs or compiler warnings when actually used.
Showing the changes to include/linux (3 of 61 files). Show all
Unified · Split
| @@ -714,7 +714,7 @@ static inline void hd_free_part(struct hd_struct *part) · 713 unmodified lines | |||
| 714 | */ | 714 | */ |
| 715 | static inline sector_t part_nr_sects_read(struct hd_struct *part) | 715 | static inline sector_t part_nr_sects_read(struct hd_struct *part) |
| 716 | { | 716 | { |
| 717 | #if BITS_PER_LONG==32 && defined(CONFIG_LBDAF) && defined(CONFIG_SMP) | 717 | #if BITS_PER_LONG==32 && defined(CONFIG_SMP) |
| 718 | sector_t nr_sects; | 718 | sector_t nr_sects; |
| 719 | unsigned seq; | 719 | unsigned seq; |
| 720 | do { | 720 | do { |
| @@ -722,7 +722,7 @@ static inline sector_t part_nr_sects_read(struct hd_struct *part) · 1 unmodified line | |||
| 722 | nr_sects = part->nr_sects; | 722 | nr_sects = part->nr_sects; |
| 723 | } while (read_seqcount_retry(&part->nr_sects_seq, seq)); | 723 | } while (read_seqcount_retry(&part->nr_sects_seq, seq)); |
| 724 | return nr_sects; | 724 | return nr_sects; |
| 725 | #elif BITS_PER_LONG==32 && defined(CONFIG_LBDAF) && defined(CONFIG_PREEMPT) | 725 | #elif BITS_PER_LONG==32 && defined(CONFIG_PREEMPT) |
| 726 | sector_t nr_sects; | 726 | sector_t nr_sects; |
| 727 | 727 | ||
| 728 | preempt_disable(); | 728 | preempt_disable(); |
| @@ -741,11 +741,11 @@ static inline sector_t part_nr_sects_read(struct hd_struct *part) · 12 unmodified lines | |||
| 741 | */ | 741 | */ |
| 742 | static inline void part_nr_sects_write(struct hd_struct *part, sector_t size) | 742 | static inline void part_nr_sects_write(struct hd_struct *part, sector_t size) |
| 743 | { | 743 | { |
| 744 | #if BITS_PER_LONG==32 && defined(CONFIG_LBDAF) && defined(CONFIG_SMP) | 744 | #if BITS_PER_LONG==32 && defined(CONFIG_SMP) |
| 745 | write_seqcount_begin(&part->nr_sects_seq); | 745 | write_seqcount_begin(&part->nr_sects_seq); |
| 746 | part->nr_sects = size; | 746 | part->nr_sects = size; |
| 747 | write_seqcount_end(&part->nr_sects_seq); | 747 | write_seqcount_end(&part->nr_sects_seq); |
| 748 | #elif BITS_PER_LONG==32 && defined(CONFIG_LBDAF) && defined(CONFIG_PREEMPT) | 748 | #elif BITS_PER_LONG==32 && defined(CONFIG_PREEMPT) |
| 749 | preempt_disable(); | 749 | preempt_disable(); |
| 750 | part->nr_sects = size; | 750 | part->nr_sects = size; |
| 751 | preempt_enable(); | 751 | preempt_enable(); |
| @@ -17,6 +17,7 @@ · 16 unmodified lines | |||
| 17 | #include <asm/byteorder.h> | 17 | #include <asm/byteorder.h> |
| 18 | #include <asm/div64.h> | 18 | #include <asm/div64.h> |
| 19 | #include <uapi/linux/kernel.h> | 19 | #include <uapi/linux/kernel.h> |
| 20 | #include <asm/div64.h> | ||
| 20 | 21 | ||
| 21 | #define STACK_MAGIC 0xdeadbeef | 22 | #define STACK_MAGIC 0xdeadbeef |
| 22 | 23 | ||
| @@ -175,18 +176,7 @@ · 152 unmodified lines | |||
| 175 | #define _RET_IP_ (unsigned long)__builtin_return_address(0) | 176 | #define _RET_IP_ (unsigned long)__builtin_return_address(0) |
| 176 | #define _THIS_IP_ ({ __label__ __here; __here: (unsigned long)&&__here; }) | 177 | #define _THIS_IP_ ({ __label__ __here; __here: (unsigned long)&&__here; }) |
| 177 | 178 | ||
| 178 | #ifdef CONFIG_LBDAF | 179 | #define sector_div(a, b) do_div(a, b) |
| 179 | # define sector_div(a, b) do_div(a, b) | ||
| 180 | #else | ||
| 181 | # define sector_div(n, b)( \ | ||
| 182 | { \ | ||
| 183 | int _res; \ | ||
| 184 | _res = (n) % (b); \ | ||
| 185 | (n) /= (b); \ | ||
| 186 | _res; \ | ||
| 187 | } \ | ||
| 188 | ) | ||
| 189 | #endif | ||
| 190 | 180 | ||
| 191 | /** | 181 | /** |
| 192 | * upper_32_bits - return bits 32-63 of a number | 182 | * upper_32_bits - return bits 32-63 of a number |
| @@ -127,13 +127,8 @@ typedef s64 int64_t; · 126 unmodified lines | |||
| 127 | * | 127 | * |
| 128 | * blkcnt_t is the type of the inode's block count. | 128 | * blkcnt_t is the type of the inode's block count. |
| 129 | */ | 129 | */ |
| 130 | #ifdef CONFIG_LBDAF | ||
| 131 | typedef u64 sector_t; | 130 | typedef u64 sector_t; |
| 132 | typedef u64 blkcnt_t; | 131 | typedef u64 blkcnt_t; |
| 133 | #else | ||
| 134 | typedef unsigned long sector_t; | ||
| 135 | typedef unsigned long blkcnt_t; | ||
| 136 | #endif | ||
| 137 | 132 | ||
| 138 | /* | 133 | /* |
| 139 | * The type of an index into the pagecache. | 134 | * The type of an index into the pagecache. |