diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/ext3_fs.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h index a443965946bb..65990ef612f5 100644 --- a/include/linux/ext3_fs.h +++ b/include/linux/ext3_fs.h | |||
@@ -724,21 +724,30 @@ struct ext3_dir_entry_2 { | |||
724 | ~EXT3_DIR_ROUND) | 724 | ~EXT3_DIR_ROUND) |
725 | #define EXT3_MAX_REC_LEN ((1<<16)-1) | 725 | #define EXT3_MAX_REC_LEN ((1<<16)-1) |
726 | 726 | ||
727 | /* | ||
728 | * Tests against MAX_REC_LEN etc were put in place for 64k block | ||
729 | * sizes; if that is not possible on this arch, we can skip | ||
730 | * those tests and speed things up. | ||
731 | */ | ||
727 | static inline unsigned ext3_rec_len_from_disk(__le16 dlen) | 732 | static inline unsigned ext3_rec_len_from_disk(__le16 dlen) |
728 | { | 733 | { |
729 | unsigned len = le16_to_cpu(dlen); | 734 | unsigned len = le16_to_cpu(dlen); |
730 | 735 | ||
736 | #if (PAGE_CACHE_SIZE >= 65536) | ||
731 | if (len == EXT3_MAX_REC_LEN) | 737 | if (len == EXT3_MAX_REC_LEN) |
732 | return 1 << 16; | 738 | return 1 << 16; |
739 | #endif | ||
733 | return len; | 740 | return len; |
734 | } | 741 | } |
735 | 742 | ||
736 | static inline __le16 ext3_rec_len_to_disk(unsigned len) | 743 | static inline __le16 ext3_rec_len_to_disk(unsigned len) |
737 | { | 744 | { |
745 | #if (PAGE_CACHE_SIZE >= 65536) | ||
738 | if (len == (1 << 16)) | 746 | if (len == (1 << 16)) |
739 | return cpu_to_le16(EXT3_MAX_REC_LEN); | 747 | return cpu_to_le16(EXT3_MAX_REC_LEN); |
740 | else if (len > (1 << 16)) | 748 | else if (len > (1 << 16)) |
741 | BUG(); | 749 | BUG(); |
750 | #endif | ||
742 | return cpu_to_le16(len); | 751 | return cpu_to_le16(len); |
743 | } | 752 | } |
744 | 753 | ||