f2fs.h (71af75b6929458d85f63c0649dc26d6f4c19729e) | f2fs.h (4d67490498acb4ffcef5ba7bc44990d46e66a44c) |
---|---|
1/* SPDX-License-Identifier: GPL-2.0 */ 2/* 3 * fs/f2fs/f2fs.h 4 * 5 * Copyright (c) 2012 Samsung Electronics Co., Ltd. 6 * http://www.samsung.com/ 7 */ 8#ifndef _LINUX_F2FS_H --- 29 unchanged lines hidden (view full) --- 38 } while (0) 39#endif 40 41enum { 42 FAULT_KMALLOC, 43 FAULT_KVMALLOC, 44 FAULT_PAGE_ALLOC, 45 FAULT_PAGE_GET, | 1/* SPDX-License-Identifier: GPL-2.0 */ 2/* 3 * fs/f2fs/f2fs.h 4 * 5 * Copyright (c) 2012 Samsung Electronics Co., Ltd. 6 * http://www.samsung.com/ 7 */ 8#ifndef _LINUX_F2FS_H --- 29 unchanged lines hidden (view full) --- 38 } while (0) 39#endif 40 41enum { 42 FAULT_KMALLOC, 43 FAULT_KVMALLOC, 44 FAULT_PAGE_ALLOC, 45 FAULT_PAGE_GET, |
46 FAULT_ALLOC_BIO, /* it's obsolete due to bio_alloc() will never fail */ |
|
46 FAULT_ALLOC_NID, 47 FAULT_ORPHAN, 48 FAULT_BLOCK, 49 FAULT_DIR_DEPTH, 50 FAULT_EVICT_INODE, 51 FAULT_TRUNCATE, 52 FAULT_READ_IO, 53 FAULT_CHECKPOINT, 54 FAULT_DISCARD, 55 FAULT_WRITE_IO, | 47 FAULT_ALLOC_NID, 48 FAULT_ORPHAN, 49 FAULT_BLOCK, 50 FAULT_DIR_DEPTH, 51 FAULT_EVICT_INODE, 52 FAULT_TRUNCATE, 53 FAULT_READ_IO, 54 FAULT_CHECKPOINT, 55 FAULT_DISCARD, 56 FAULT_WRITE_IO, |
57 FAULT_SLAB_ALLOC, |
|
56 FAULT_MAX, 57}; 58 59#ifdef CONFIG_F2FS_FAULT_INJECTION 60#define F2FS_ALL_FAULT_TYPE ((1 << FAULT_MAX) - 1) 61 62struct f2fs_fault_info { 63 atomic_t inject_ops; --- 70 unchanged lines hidden (view full) --- 134 int s_jquota_fmt; /* Format of quota to use */ 135#endif 136 /* For which write hints are passed down to block layer */ 137 int whint_mode; 138 int alloc_mode; /* segment allocation policy */ 139 int fsync_mode; /* fsync policy */ 140 int fs_mode; /* fs mode: LFS or ADAPTIVE */ 141 int bggc_mode; /* bggc mode: off, on or sync */ | 58 FAULT_MAX, 59}; 60 61#ifdef CONFIG_F2FS_FAULT_INJECTION 62#define F2FS_ALL_FAULT_TYPE ((1 << FAULT_MAX) - 1) 63 64struct f2fs_fault_info { 65 atomic_t inject_ops; --- 70 unchanged lines hidden (view full) --- 136 int s_jquota_fmt; /* Format of quota to use */ 137#endif 138 /* For which write hints are passed down to block layer */ 139 int whint_mode; 140 int alloc_mode; /* segment allocation policy */ 141 int fsync_mode; /* fsync policy */ 142 int fs_mode; /* fs mode: LFS or ADAPTIVE */ 143 int bggc_mode; /* bggc mode: off, on or sync */ |
144 int discard_unit; /* 145 * discard command's offset/size should 146 * be aligned to this unit: block, 147 * segment or section 148 */ |
|
142 struct fscrypt_dummy_policy dummy_enc_policy; /* test dummy encryption */ 143 block_t unusable_cap_perc; /* percentage for cap */ 144 block_t unusable_cap; /* Amount of space allowed to be 145 * unusable when disabling checkpoint 146 */ 147 148 /* For compression */ 149 unsigned char compress_algorithm; /* algorithm type */ --- 387 unchanged lines hidden (view full) --- 537 ALLOC_NODE, /* allocate a new node page if needed */ 538 LOOKUP_NODE, /* look up a node without readahead */ 539 LOOKUP_NODE_RA, /* 540 * look up a node with readahead called 541 * by get_data_block. 542 */ 543}; 544 | 149 struct fscrypt_dummy_policy dummy_enc_policy; /* test dummy encryption */ 150 block_t unusable_cap_perc; /* percentage for cap */ 151 block_t unusable_cap; /* Amount of space allowed to be 152 * unusable when disabling checkpoint 153 */ 154 155 /* For compression */ 156 unsigned char compress_algorithm; /* algorithm type */ --- 387 unchanged lines hidden (view full) --- 544 ALLOC_NODE, /* allocate a new node page if needed */ 545 LOOKUP_NODE, /* look up a node without readahead */ 546 LOOKUP_NODE_RA, /* 547 * look up a node with readahead called 548 * by get_data_block. 549 */ 550}; 551 |
545#define DEFAULT_RETRY_IO_COUNT 8 /* maximum retry read IO count */ | 552#define DEFAULT_RETRY_IO_COUNT 8 /* maximum retry read IO or flush count */ |
546 547/* congestion wait timeout value, default: 20ms */ 548#define DEFAULT_IO_TIMEOUT (msecs_to_jiffies(20)) 549 550/* maximum retry quota flush count */ 551#define DEFAULT_RETRY_QUOTA_FLUSH_COUNT 8 552 553#define F2FS_LINK_MAX 0xffffffff /* maximum link count per file */ --- 16 unchanged lines hidden (view full) --- 570 unsigned long long key; /* 64-bits key */ 571 } __packed; 572}; 573 574struct extent_info { 575 unsigned int fofs; /* start offset in a file */ 576 unsigned int len; /* length of the extent */ 577 u32 blk; /* start block address of the extent */ | 553 554/* congestion wait timeout value, default: 20ms */ 555#define DEFAULT_IO_TIMEOUT (msecs_to_jiffies(20)) 556 557/* maximum retry quota flush count */ 558#define DEFAULT_RETRY_QUOTA_FLUSH_COUNT 8 559 560#define F2FS_LINK_MAX 0xffffffff /* maximum link count per file */ --- 16 unchanged lines hidden (view full) --- 577 unsigned long long key; /* 64-bits key */ 578 } __packed; 579}; 580 581struct extent_info { 582 unsigned int fofs; /* start offset in a file */ 583 unsigned int len; /* length of the extent */ 584 u32 blk; /* start block address of the extent */ |
585#ifdef CONFIG_F2FS_FS_COMPRESSION 586 unsigned int c_len; /* physical extent length of compressed blocks */ 587#endif |
|
578}; 579 580struct extent_node { 581 struct rb_node rb_node; /* rb node located in rb-tree */ 582 struct extent_info ei; /* extent info */ 583 struct list_head list; /* node in global extent list of sbi */ 584 struct extent_tree *et; /* extent tree pointer */ 585}; --- 203 unchanged lines hidden (view full) --- 789} 790 791static inline void set_extent_info(struct extent_info *ei, unsigned int fofs, 792 u32 blk, unsigned int len) 793{ 794 ei->fofs = fofs; 795 ei->blk = blk; 796 ei->len = len; | 588}; 589 590struct extent_node { 591 struct rb_node rb_node; /* rb node located in rb-tree */ 592 struct extent_info ei; /* extent info */ 593 struct list_head list; /* node in global extent list of sbi */ 594 struct extent_tree *et; /* extent tree pointer */ 595}; --- 203 unchanged lines hidden (view full) --- 799} 800 801static inline void set_extent_info(struct extent_info *ei, unsigned int fofs, 802 u32 blk, unsigned int len) 803{ 804 ei->fofs = fofs; 805 ei->blk = blk; 806 ei->len = len; |
807#ifdef CONFIG_F2FS_FS_COMPRESSION 808 ei->c_len = 0; 809#endif |
|
797} 798 799static inline bool __is_discard_mergeable(struct discard_info *back, 800 struct discard_info *front, unsigned int max_len) 801{ 802 return (back->lstart + back->len == front->lstart) && 803 (back->len + front->len <= max_len); 804} --- 8 unchanged lines hidden (view full) --- 813 struct discard_info *front, unsigned int max_len) 814{ 815 return __is_discard_mergeable(cur, front, max_len); 816} 817 818static inline bool __is_extent_mergeable(struct extent_info *back, 819 struct extent_info *front) 820{ | 810} 811 812static inline bool __is_discard_mergeable(struct discard_info *back, 813 struct discard_info *front, unsigned int max_len) 814{ 815 return (back->lstart + back->len == front->lstart) && 816 (back->len + front->len <= max_len); 817} --- 8 unchanged lines hidden (view full) --- 826 struct discard_info *front, unsigned int max_len) 827{ 828 return __is_discard_mergeable(cur, front, max_len); 829} 830 831static inline bool __is_extent_mergeable(struct extent_info *back, 832 struct extent_info *front) 833{ |
834#ifdef CONFIG_F2FS_FS_COMPRESSION 835 if (back->c_len && back->len != back->c_len) 836 return false; 837 if (front->c_len && front->len != front->c_len) 838 return false; 839#endif |
|
821 return (back->fofs + back->len == front->fofs && 822 back->blk + back->len == front->blk); 823} 824 825static inline bool __is_back_mergeable(struct extent_info *cur, 826 struct extent_info *back) 827{ 828 return __is_extent_mergeable(back, cur); --- 419 unchanged lines hidden (view full) --- 1248 1249enum { 1250 GC_NORMAL, 1251 GC_IDLE_CB, 1252 GC_IDLE_GREEDY, 1253 GC_IDLE_AT, 1254 GC_URGENT_HIGH, 1255 GC_URGENT_LOW, | 840 return (back->fofs + back->len == front->fofs && 841 back->blk + back->len == front->blk); 842} 843 844static inline bool __is_back_mergeable(struct extent_info *cur, 845 struct extent_info *back) 846{ 847 return __is_extent_mergeable(back, cur); --- 419 unchanged lines hidden (view full) --- 1267 1268enum { 1269 GC_NORMAL, 1270 GC_IDLE_CB, 1271 GC_IDLE_GREEDY, 1272 GC_IDLE_AT, 1273 GC_URGENT_HIGH, 1274 GC_URGENT_LOW, |
1275 MAX_GC_MODE, |
|
1256}; 1257 1258enum { 1259 BGGC_MODE_ON, /* background gc is on */ 1260 BGGC_MODE_OFF, /* background gc is off */ 1261 BGGC_MODE_SYNC, /* 1262 * background gc is on, migrating blocks 1263 * like foreground gc --- 29 unchanged lines hidden (view full) --- 1293 */ 1294 COMPR_MODE_USER, /* 1295 * automatical compression is disabled. 1296 * user can control the file compression 1297 * using ioctls 1298 */ 1299}; 1300 | 1276}; 1277 1278enum { 1279 BGGC_MODE_ON, /* background gc is on */ 1280 BGGC_MODE_OFF, /* background gc is off */ 1281 BGGC_MODE_SYNC, /* 1282 * background gc is on, migrating blocks 1283 * like foreground gc --- 29 unchanged lines hidden (view full) --- 1313 */ 1314 COMPR_MODE_USER, /* 1315 * automatical compression is disabled. 1316 * user can control the file compression 1317 * using ioctls 1318 */ 1319}; 1320 |
1321enum { 1322 DISCARD_UNIT_BLOCK, /* basic discard unit is block */ 1323 DISCARD_UNIT_SEGMENT, /* basic discard unit is segment */ 1324 DISCARD_UNIT_SECTION, /* basic discard unit is section */ 1325}; 1326 |
|
1301static inline int f2fs_test_bit(unsigned int nr, char *addr); 1302static inline void f2fs_set_bit(unsigned int nr, char *addr); 1303static inline void f2fs_clear_bit(unsigned int nr, char *addr); 1304 1305/* 1306 * Layout of f2fs page.private: 1307 * 1308 * Layout A: lowest bit should be 1 --- 373 unchanged lines hidden (view full) --- 1682 atomic_t max_aw_cnt; /* max # of atomic writes */ 1683 atomic_t max_vw_cnt; /* max # of volatile writes */ 1684 unsigned int io_skip_bggc; /* skip background gc for in-flight IO */ 1685 unsigned int other_skip_bggc; /* skip background gc for other reasons */ 1686 unsigned int ndirty_inode[NR_INODE_TYPE]; /* # of dirty inodes */ 1687#endif 1688 spinlock_t stat_lock; /* lock for stat operations */ 1689 | 1327static inline int f2fs_test_bit(unsigned int nr, char *addr); 1328static inline void f2fs_set_bit(unsigned int nr, char *addr); 1329static inline void f2fs_clear_bit(unsigned int nr, char *addr); 1330 1331/* 1332 * Layout of f2fs page.private: 1333 * 1334 * Layout A: lowest bit should be 1 --- 373 unchanged lines hidden (view full) --- 1708 atomic_t max_aw_cnt; /* max # of atomic writes */ 1709 atomic_t max_vw_cnt; /* max # of volatile writes */ 1710 unsigned int io_skip_bggc; /* skip background gc for in-flight IO */ 1711 unsigned int other_skip_bggc; /* skip background gc for other reasons */ 1712 unsigned int ndirty_inode[NR_INODE_TYPE]; /* # of dirty inodes */ 1713#endif 1714 spinlock_t stat_lock; /* lock for stat operations */ 1715 |
1690 /* For app/fs IO statistics */ 1691 spinlock_t iostat_lock; 1692 unsigned long long rw_iostat[NR_IO_TYPE]; 1693 unsigned long long prev_rw_iostat[NR_IO_TYPE]; 1694 bool iostat_enable; 1695 unsigned long iostat_next_period; 1696 unsigned int iostat_period_ms; 1697 | |
1698 /* to attach REQ_META|REQ_FUA flags */ 1699 unsigned int data_io_flag; 1700 unsigned int node_io_flag; 1701 1702 /* For sysfs suppport */ 1703 struct kobject s_kobj; /* /sys/fs/f2fs/<devname> */ 1704 struct completion s_kobj_unregister; 1705 --- 22 unchanged lines hidden (view full) --- 1728 /* Precomputed FS UUID checksum for seeding other checksums */ 1729 __u32 s_chksum_seed; 1730 1731 struct workqueue_struct *post_read_wq; /* post read workqueue */ 1732 1733 struct kmem_cache *inline_xattr_slab; /* inline xattr entry */ 1734 unsigned int inline_xattr_slab_size; /* default inline xattr slab size */ 1735 | 1716 /* to attach REQ_META|REQ_FUA flags */ 1717 unsigned int data_io_flag; 1718 unsigned int node_io_flag; 1719 1720 /* For sysfs suppport */ 1721 struct kobject s_kobj; /* /sys/fs/f2fs/<devname> */ 1722 struct completion s_kobj_unregister; 1723 --- 22 unchanged lines hidden (view full) --- 1746 /* Precomputed FS UUID checksum for seeding other checksums */ 1747 __u32 s_chksum_seed; 1748 1749 struct workqueue_struct *post_read_wq; /* post read workqueue */ 1750 1751 struct kmem_cache *inline_xattr_slab; /* inline xattr entry */ 1752 unsigned int inline_xattr_slab_size; /* default inline xattr slab size */ 1753 |
1754 /* For reclaimed segs statistics per each GC mode */ 1755 unsigned int gc_segment_mode; /* GC state for reclaimed segments */ 1756 unsigned int gc_reclaimed_segs[MAX_GC_MODE]; /* Reclaimed segs for each mode */ 1757 1758 unsigned long seq_file_ra_mul; /* multiplier for ra_pages of seq. files in fadvise */ 1759 |
|
1736#ifdef CONFIG_F2FS_FS_COMPRESSION 1737 struct kmem_cache *page_array_slab; /* page array entry */ 1738 unsigned int page_array_slab_size; /* default page array slab size */ 1739 1740 /* For runtime compression statistics */ 1741 u64 compr_written_block; 1742 u64 compr_saved_block; 1743 u32 compr_new_inode; 1744 1745 /* For compressed block cache */ 1746 struct inode *compress_inode; /* cache compressed blocks */ 1747 unsigned int compress_percent; /* cache page percentage */ 1748 unsigned int compress_watermark; /* cache page watermark */ 1749 atomic_t compress_page_hit; /* cache hit count */ 1750#endif | 1760#ifdef CONFIG_F2FS_FS_COMPRESSION 1761 struct kmem_cache *page_array_slab; /* page array entry */ 1762 unsigned int page_array_slab_size; /* default page array slab size */ 1763 1764 /* For runtime compression statistics */ 1765 u64 compr_written_block; 1766 u64 compr_saved_block; 1767 u32 compr_new_inode; 1768 1769 /* For compressed block cache */ 1770 struct inode *compress_inode; /* cache compressed blocks */ 1771 unsigned int compress_percent; /* cache page percentage */ 1772 unsigned int compress_watermark; /* cache page watermark */ 1773 atomic_t compress_page_hit; /* cache hit count */ 1774#endif |
1775 1776#ifdef CONFIG_F2FS_IOSTAT 1777 /* For app/fs IO statistics */ 1778 spinlock_t iostat_lock; 1779 unsigned long long rw_iostat[NR_IO_TYPE]; 1780 unsigned long long prev_rw_iostat[NR_IO_TYPE]; 1781 bool iostat_enable; 1782 unsigned long iostat_next_period; 1783 unsigned int iostat_period_ms; 1784 1785 /* For io latency related statistics info in one iostat period */ 1786 spinlock_t iostat_lat_lock; 1787 struct iostat_lat_info *iostat_io_lat; 1788#endif |
|
1751}; 1752 1753struct f2fs_private_dio { 1754 struct inode *inode; 1755 void *orig_private; 1756 bio_end_io_t *orig_end_io; 1757 bool write; 1758}; --- 271 unchanged lines hidden (view full) --- 2030{ 2031 unsigned long flags; 2032 2033 spin_lock_irqsave(&sbi->cp_lock, flags); 2034 __clear_ckpt_flags(F2FS_CKPT(sbi), f); 2035 spin_unlock_irqrestore(&sbi->cp_lock, flags); 2036} 2037 | 1789}; 1790 1791struct f2fs_private_dio { 1792 struct inode *inode; 1793 void *orig_private; 1794 bio_end_io_t *orig_end_io; 1795 bool write; 1796}; --- 271 unchanged lines hidden (view full) --- 2068{ 2069 unsigned long flags; 2070 2071 spin_lock_irqsave(&sbi->cp_lock, flags); 2072 __clear_ckpt_flags(F2FS_CKPT(sbi), f); 2073 spin_unlock_irqrestore(&sbi->cp_lock, flags); 2074} 2075 |
2038static inline void disable_nat_bits(struct f2fs_sb_info *sbi, bool lock) 2039{ 2040 unsigned long flags; 2041 unsigned char *nat_bits; 2042 2043 /* 2044 * In order to re-enable nat_bits we need to call fsck.f2fs by 2045 * set_sbi_flag(sbi, SBI_NEED_FSCK). But it may give huge cost, 2046 * so let's rely on regular fsck or unclean shutdown. 2047 */ 2048 2049 if (lock) 2050 spin_lock_irqsave(&sbi->cp_lock, flags); 2051 __clear_ckpt_flags(F2FS_CKPT(sbi), CP_NAT_BITS_FLAG); 2052 nat_bits = NM_I(sbi)->nat_bits; 2053 NM_I(sbi)->nat_bits = NULL; 2054 if (lock) 2055 spin_unlock_irqrestore(&sbi->cp_lock, flags); 2056 2057 kvfree(nat_bits); 2058} 2059 2060static inline bool enabled_nat_bits(struct f2fs_sb_info *sbi, 2061 struct cp_control *cpc) 2062{ 2063 bool set = is_set_ckpt_flags(sbi, CP_NAT_BITS_FLAG); 2064 2065 return (cpc) ? (cpc->reason & CP_UMOUNT) && set : set; 2066} 2067 | |
2068static inline void f2fs_lock_op(struct f2fs_sb_info *sbi) 2069{ 2070 down_read(&sbi->cp_rwsem); 2071} 2072 2073static inline int f2fs_trylock_op(struct f2fs_sb_info *sbi) 2074{ 2075 return down_read_trylock(&sbi->cp_rwsem); --- 507 unchanged lines hidden (view full) --- 2583} 2584 2585static inline struct kmem_cache *f2fs_kmem_cache_create(const char *name, 2586 size_t size) 2587{ 2588 return kmem_cache_create(name, size, 0, SLAB_RECLAIM_ACCOUNT, NULL); 2589} 2590 | 2076static inline void f2fs_lock_op(struct f2fs_sb_info *sbi) 2077{ 2078 down_read(&sbi->cp_rwsem); 2079} 2080 2081static inline int f2fs_trylock_op(struct f2fs_sb_info *sbi) 2082{ 2083 return down_read_trylock(&sbi->cp_rwsem); --- 507 unchanged lines hidden (view full) --- 2591} 2592 2593static inline struct kmem_cache *f2fs_kmem_cache_create(const char *name, 2594 size_t size) 2595{ 2596 return kmem_cache_create(name, size, 0, SLAB_RECLAIM_ACCOUNT, NULL); 2597} 2598 |
2591static inline void *f2fs_kmem_cache_alloc(struct kmem_cache *cachep, | 2599static inline void *f2fs_kmem_cache_alloc_nofail(struct kmem_cache *cachep, |
2592 gfp_t flags) 2593{ 2594 void *entry; 2595 2596 entry = kmem_cache_alloc(cachep, flags); 2597 if (!entry) 2598 entry = kmem_cache_alloc(cachep, flags | __GFP_NOFAIL); 2599 return entry; 2600} 2601 | 2600 gfp_t flags) 2601{ 2602 void *entry; 2603 2604 entry = kmem_cache_alloc(cachep, flags); 2605 if (!entry) 2606 entry = kmem_cache_alloc(cachep, flags | __GFP_NOFAIL); 2607 return entry; 2608} 2609 |
2610static inline void *f2fs_kmem_cache_alloc(struct kmem_cache *cachep, 2611 gfp_t flags, bool nofail, struct f2fs_sb_info *sbi) 2612{ 2613 if (nofail) 2614 return f2fs_kmem_cache_alloc_nofail(cachep, flags); 2615 2616 if (time_to_inject(sbi, FAULT_SLAB_ALLOC)) { 2617 f2fs_show_injection_info(sbi, FAULT_SLAB_ALLOC); 2618 return NULL; 2619 } 2620 2621 return kmem_cache_alloc(cachep, flags); 2622} 2623 |
|
2602static inline bool is_inflight_io(struct f2fs_sb_info *sbi, int type) 2603{ 2604 if (get_pages(sbi, F2FS_RD_DATA) || get_pages(sbi, F2FS_RD_NODE) || 2605 get_pages(sbi, F2FS_RD_META) || get_pages(sbi, F2FS_WB_DATA) || 2606 get_pages(sbi, F2FS_WB_CP_DATA) || 2607 get_pages(sbi, F2FS_DIO_READ) || 2608 get_pages(sbi, F2FS_DIO_WRITE)) 2609 return true; --- 596 unchanged lines hidden (view full) --- 3206 offsetof(struct f2fs_inode, i_extra_isize)) \ 3207 3208#define F2FS_OLD_ATTRIBUTE_SIZE (offsetof(struct f2fs_inode, i_addr)) 3209#define F2FS_FITS_IN_INODE(f2fs_inode, extra_isize, field) \ 3210 ((offsetof(typeof(*(f2fs_inode)), field) + \ 3211 sizeof((f2fs_inode)->field)) \ 3212 <= (F2FS_OLD_ATTRIBUTE_SIZE + (extra_isize))) \ 3213 | 2624static inline bool is_inflight_io(struct f2fs_sb_info *sbi, int type) 2625{ 2626 if (get_pages(sbi, F2FS_RD_DATA) || get_pages(sbi, F2FS_RD_NODE) || 2627 get_pages(sbi, F2FS_RD_META) || get_pages(sbi, F2FS_WB_DATA) || 2628 get_pages(sbi, F2FS_WB_CP_DATA) || 2629 get_pages(sbi, F2FS_DIO_READ) || 2630 get_pages(sbi, F2FS_DIO_WRITE)) 2631 return true; --- 596 unchanged lines hidden (view full) --- 3228 offsetof(struct f2fs_inode, i_extra_isize)) \ 3229 3230#define F2FS_OLD_ATTRIBUTE_SIZE (offsetof(struct f2fs_inode, i_addr)) 3231#define F2FS_FITS_IN_INODE(f2fs_inode, extra_isize, field) \ 3232 ((offsetof(typeof(*(f2fs_inode)), field) + \ 3233 sizeof((f2fs_inode)->field)) \ 3234 <= (F2FS_OLD_ATTRIBUTE_SIZE + (extra_isize))) \ 3235 |
3214#define DEFAULT_IOSTAT_PERIOD_MS 3000 3215#define MIN_IOSTAT_PERIOD_MS 100 3216/* maximum period of iostat tracing is 1 day */ 3217#define MAX_IOSTAT_PERIOD_MS 8640000 3218 3219static inline void f2fs_reset_iostat(struct f2fs_sb_info *sbi) 3220{ 3221 int i; 3222 3223 spin_lock(&sbi->iostat_lock); 3224 for (i = 0; i < NR_IO_TYPE; i++) { 3225 sbi->rw_iostat[i] = 0; 3226 sbi->prev_rw_iostat[i] = 0; 3227 } 3228 spin_unlock(&sbi->iostat_lock); 3229} 3230 3231extern void f2fs_record_iostat(struct f2fs_sb_info *sbi); 3232 3233static inline void f2fs_update_iostat(struct f2fs_sb_info *sbi, 3234 enum iostat_type type, unsigned long long io_bytes) 3235{ 3236 if (!sbi->iostat_enable) 3237 return; 3238 spin_lock(&sbi->iostat_lock); 3239 sbi->rw_iostat[type] += io_bytes; 3240 3241 if (type == APP_WRITE_IO || type == APP_DIRECT_IO) 3242 sbi->rw_iostat[APP_BUFFERED_IO] = 3243 sbi->rw_iostat[APP_WRITE_IO] - 3244 sbi->rw_iostat[APP_DIRECT_IO]; 3245 3246 if (type == APP_READ_IO || type == APP_DIRECT_READ_IO) 3247 sbi->rw_iostat[APP_BUFFERED_READ_IO] = 3248 sbi->rw_iostat[APP_READ_IO] - 3249 sbi->rw_iostat[APP_DIRECT_READ_IO]; 3250 spin_unlock(&sbi->iostat_lock); 3251 3252 f2fs_record_iostat(sbi); 3253} 3254 | |
3255#define __is_large_section(sbi) ((sbi)->segs_per_sec > 1) 3256 3257#define __is_meta_io(fio) (PAGE_TYPE_OF_BIO((fio)->type) == META) 3258 3259bool f2fs_is_valid_blkaddr(struct f2fs_sb_info *sbi, 3260 block_t blkaddr, int type); 3261static inline void verify_blkaddr(struct f2fs_sb_info *sbi, 3262 block_t blkaddr, int type) --- 150 unchanged lines hidden (view full) --- 3413int f2fs_get_node_info(struct f2fs_sb_info *sbi, nid_t nid, 3414 struct node_info *ni); 3415pgoff_t f2fs_get_next_page_offset(struct dnode_of_data *dn, pgoff_t pgofs); 3416int f2fs_get_dnode_of_data(struct dnode_of_data *dn, pgoff_t index, int mode); 3417int f2fs_truncate_inode_blocks(struct inode *inode, pgoff_t from); 3418int f2fs_truncate_xattr_node(struct inode *inode); 3419int f2fs_wait_on_node_pages_writeback(struct f2fs_sb_info *sbi, 3420 unsigned int seq_id); | 3236#define __is_large_section(sbi) ((sbi)->segs_per_sec > 1) 3237 3238#define __is_meta_io(fio) (PAGE_TYPE_OF_BIO((fio)->type) == META) 3239 3240bool f2fs_is_valid_blkaddr(struct f2fs_sb_info *sbi, 3241 block_t blkaddr, int type); 3242static inline void verify_blkaddr(struct f2fs_sb_info *sbi, 3243 block_t blkaddr, int type) --- 150 unchanged lines hidden (view full) --- 3394int f2fs_get_node_info(struct f2fs_sb_info *sbi, nid_t nid, 3395 struct node_info *ni); 3396pgoff_t f2fs_get_next_page_offset(struct dnode_of_data *dn, pgoff_t pgofs); 3397int f2fs_get_dnode_of_data(struct dnode_of_data *dn, pgoff_t index, int mode); 3398int f2fs_truncate_inode_blocks(struct inode *inode, pgoff_t from); 3399int f2fs_truncate_xattr_node(struct inode *inode); 3400int f2fs_wait_on_node_pages_writeback(struct f2fs_sb_info *sbi, 3401 unsigned int seq_id); |
3402bool f2fs_nat_bitmap_enabled(struct f2fs_sb_info *sbi); |
|
3421int f2fs_remove_inode_page(struct inode *inode); 3422struct page *f2fs_new_inode_page(struct inode *inode); 3423struct page *f2fs_new_node_page(struct dnode_of_data *dn, unsigned int ofs); 3424void f2fs_ra_node_page(struct f2fs_sb_info *sbi, nid_t nid); 3425struct page *f2fs_get_node_page(struct f2fs_sb_info *sbi, pgoff_t nid); 3426struct page *f2fs_get_node_page_ra(struct page *parent, int start); 3427int f2fs_move_node_page(struct page *node_page, int gc_type); 3428void f2fs_flush_inline_data(struct f2fs_sb_info *sbi); --- 8 unchanged lines hidden (view full) --- 3437void f2fs_alloc_nid_done(struct f2fs_sb_info *sbi, nid_t nid); 3438void f2fs_alloc_nid_failed(struct f2fs_sb_info *sbi, nid_t nid); 3439int f2fs_try_to_free_nids(struct f2fs_sb_info *sbi, int nr_shrink); 3440int f2fs_recover_inline_xattr(struct inode *inode, struct page *page); 3441int f2fs_recover_xattr_data(struct inode *inode, struct page *page); 3442int f2fs_recover_inode_page(struct f2fs_sb_info *sbi, struct page *page); 3443int f2fs_restore_node_summary(struct f2fs_sb_info *sbi, 3444 unsigned int segno, struct f2fs_summary_block *sum); | 3403int f2fs_remove_inode_page(struct inode *inode); 3404struct page *f2fs_new_inode_page(struct inode *inode); 3405struct page *f2fs_new_node_page(struct dnode_of_data *dn, unsigned int ofs); 3406void f2fs_ra_node_page(struct f2fs_sb_info *sbi, nid_t nid); 3407struct page *f2fs_get_node_page(struct f2fs_sb_info *sbi, pgoff_t nid); 3408struct page *f2fs_get_node_page_ra(struct page *parent, int start); 3409int f2fs_move_node_page(struct page *node_page, int gc_type); 3410void f2fs_flush_inline_data(struct f2fs_sb_info *sbi); --- 8 unchanged lines hidden (view full) --- 3419void f2fs_alloc_nid_done(struct f2fs_sb_info *sbi, nid_t nid); 3420void f2fs_alloc_nid_failed(struct f2fs_sb_info *sbi, nid_t nid); 3421int f2fs_try_to_free_nids(struct f2fs_sb_info *sbi, int nr_shrink); 3422int f2fs_recover_inline_xattr(struct inode *inode, struct page *page); 3423int f2fs_recover_xattr_data(struct inode *inode, struct page *page); 3424int f2fs_recover_inode_page(struct f2fs_sb_info *sbi, struct page *page); 3425int f2fs_restore_node_summary(struct f2fs_sb_info *sbi, 3426 unsigned int segno, struct f2fs_summary_block *sum); |
3427void f2fs_enable_nat_bits(struct f2fs_sb_info *sbi); |
|
3445int f2fs_flush_nat_entries(struct f2fs_sb_info *sbi, struct cp_control *cpc); 3446int f2fs_build_node_manager(struct f2fs_sb_info *sbi); 3447void f2fs_destroy_node_manager(struct f2fs_sb_info *sbi); 3448int __init f2fs_create_node_manager_caches(void); 3449void f2fs_destroy_node_manager_caches(void); 3450 3451/* 3452 * segment.c --- 7 unchanged lines hidden (view full) --- 3460void f2fs_balance_fs(struct f2fs_sb_info *sbi, bool need); 3461void f2fs_balance_fs_bg(struct f2fs_sb_info *sbi, bool from_bg); 3462int f2fs_issue_flush(struct f2fs_sb_info *sbi, nid_t ino); 3463int f2fs_create_flush_cmd_control(struct f2fs_sb_info *sbi); 3464int f2fs_flush_device_cache(struct f2fs_sb_info *sbi); 3465void f2fs_destroy_flush_cmd_control(struct f2fs_sb_info *sbi, bool free); 3466void f2fs_invalidate_blocks(struct f2fs_sb_info *sbi, block_t addr); 3467bool f2fs_is_checkpointed_data(struct f2fs_sb_info *sbi, block_t blkaddr); | 3428int f2fs_flush_nat_entries(struct f2fs_sb_info *sbi, struct cp_control *cpc); 3429int f2fs_build_node_manager(struct f2fs_sb_info *sbi); 3430void f2fs_destroy_node_manager(struct f2fs_sb_info *sbi); 3431int __init f2fs_create_node_manager_caches(void); 3432void f2fs_destroy_node_manager_caches(void); 3433 3434/* 3435 * segment.c --- 7 unchanged lines hidden (view full) --- 3443void f2fs_balance_fs(struct f2fs_sb_info *sbi, bool need); 3444void f2fs_balance_fs_bg(struct f2fs_sb_info *sbi, bool from_bg); 3445int f2fs_issue_flush(struct f2fs_sb_info *sbi, nid_t ino); 3446int f2fs_create_flush_cmd_control(struct f2fs_sb_info *sbi); 3447int f2fs_flush_device_cache(struct f2fs_sb_info *sbi); 3448void f2fs_destroy_flush_cmd_control(struct f2fs_sb_info *sbi, bool free); 3449void f2fs_invalidate_blocks(struct f2fs_sb_info *sbi, block_t addr); 3450bool f2fs_is_checkpointed_data(struct f2fs_sb_info *sbi, block_t blkaddr); |
3451int f2fs_start_discard_thread(struct f2fs_sb_info *sbi); |
|
3468void f2fs_drop_discard_cmd(struct f2fs_sb_info *sbi); 3469void f2fs_stop_discard_thread(struct f2fs_sb_info *sbi); 3470bool f2fs_issue_discard_timeout(struct f2fs_sb_info *sbi); 3471void f2fs_clear_prefree_segments(struct f2fs_sb_info *sbi, 3472 struct cp_control *cpc); 3473void f2fs_dirty_to_prefree(struct f2fs_sb_info *sbi); 3474block_t f2fs_get_unusable_blocks(struct f2fs_sb_info *sbi); 3475int f2fs_disable_cp_again(struct f2fs_sb_info *sbi, block_t unusable); --- 506 unchanged lines hidden (view full) --- 3982 pgoff_t fofs, block_t blkaddr, unsigned int len); 3983void f2fs_init_extent_cache_info(struct f2fs_sb_info *sbi); 3984int __init f2fs_create_extent_cache(void); 3985void f2fs_destroy_extent_cache(void); 3986 3987/* 3988 * sysfs.c 3989 */ | 3452void f2fs_drop_discard_cmd(struct f2fs_sb_info *sbi); 3453void f2fs_stop_discard_thread(struct f2fs_sb_info *sbi); 3454bool f2fs_issue_discard_timeout(struct f2fs_sb_info *sbi); 3455void f2fs_clear_prefree_segments(struct f2fs_sb_info *sbi, 3456 struct cp_control *cpc); 3457void f2fs_dirty_to_prefree(struct f2fs_sb_info *sbi); 3458block_t f2fs_get_unusable_blocks(struct f2fs_sb_info *sbi); 3459int f2fs_disable_cp_again(struct f2fs_sb_info *sbi, block_t unusable); --- 506 unchanged lines hidden (view full) --- 3966 pgoff_t fofs, block_t blkaddr, unsigned int len); 3967void f2fs_init_extent_cache_info(struct f2fs_sb_info *sbi); 3968int __init f2fs_create_extent_cache(void); 3969void f2fs_destroy_extent_cache(void); 3970 3971/* 3972 * sysfs.c 3973 */ |
3974#define MIN_RA_MUL 2 3975#define MAX_RA_MUL 256 3976 |
|
3990int __init f2fs_init_sysfs(void); 3991void f2fs_exit_sysfs(void); 3992int f2fs_register_sysfs(struct f2fs_sb_info *sbi); 3993void f2fs_unregister_sysfs(struct f2fs_sb_info *sbi); 3994 3995/* verity.c */ 3996extern const struct fsverity_operations f2fs_verityops; 3997 --- 38 unchanged lines hidden (view full) --- 4036bool f2fs_is_compress_backend_ready(struct inode *inode); 4037int f2fs_init_compress_mempool(void); 4038void f2fs_destroy_compress_mempool(void); 4039void f2fs_decompress_cluster(struct decompress_io_ctx *dic); 4040void f2fs_end_read_compressed_page(struct page *page, bool failed, 4041 block_t blkaddr); 4042bool f2fs_cluster_is_empty(struct compress_ctx *cc); 4043bool f2fs_cluster_can_merge_page(struct compress_ctx *cc, pgoff_t index); | 3977int __init f2fs_init_sysfs(void); 3978void f2fs_exit_sysfs(void); 3979int f2fs_register_sysfs(struct f2fs_sb_info *sbi); 3980void f2fs_unregister_sysfs(struct f2fs_sb_info *sbi); 3981 3982/* verity.c */ 3983extern const struct fsverity_operations f2fs_verityops; 3984 --- 38 unchanged lines hidden (view full) --- 4023bool f2fs_is_compress_backend_ready(struct inode *inode); 4024int f2fs_init_compress_mempool(void); 4025void f2fs_destroy_compress_mempool(void); 4026void f2fs_decompress_cluster(struct decompress_io_ctx *dic); 4027void f2fs_end_read_compressed_page(struct page *page, bool failed, 4028 block_t blkaddr); 4029bool f2fs_cluster_is_empty(struct compress_ctx *cc); 4030bool f2fs_cluster_can_merge_page(struct compress_ctx *cc, pgoff_t index); |
4031bool f2fs_sanity_check_cluster(struct dnode_of_data *dn); |
|
4044void f2fs_compress_ctx_add_page(struct compress_ctx *cc, struct page *page); 4045int f2fs_write_multi_pages(struct compress_ctx *cc, 4046 int *submitted, 4047 struct writeback_control *wbc, 4048 enum iostat_type io_type); 4049int f2fs_is_compressed_cluster(struct inode *inode, pgoff_t index); | 4032void f2fs_compress_ctx_add_page(struct compress_ctx *cc, struct page *page); 4033int f2fs_write_multi_pages(struct compress_ctx *cc, 4034 int *submitted, 4035 struct writeback_control *wbc, 4036 enum iostat_type io_type); 4037int f2fs_is_compressed_cluster(struct inode *inode, pgoff_t index); |
4038void f2fs_update_extent_tree_range_compressed(struct inode *inode, 4039 pgoff_t fofs, block_t blkaddr, unsigned int llen, 4040 unsigned int c_len); |
|
4050int f2fs_read_multi_pages(struct compress_ctx *cc, struct bio **bio_ret, 4051 unsigned nr_pages, sector_t *last_block_in_bio, 4052 bool is_readahead, bool for_write); 4053struct decompress_io_ctx *f2fs_alloc_dic(struct compress_ctx *cc); 4054void f2fs_decompress_end_io(struct decompress_io_ctx *dic, bool failed); 4055void f2fs_put_page_dic(struct page *page); | 4041int f2fs_read_multi_pages(struct compress_ctx *cc, struct bio **bio_ret, 4042 unsigned nr_pages, sector_t *last_block_in_bio, 4043 bool is_readahead, bool for_write); 4044struct decompress_io_ctx *f2fs_alloc_dic(struct compress_ctx *cc); 4045void f2fs_decompress_end_io(struct decompress_io_ctx *dic, bool failed); 4046void f2fs_put_page_dic(struct page *page); |
4047unsigned int f2fs_cluster_blocks_are_contiguous(struct dnode_of_data *dn); |
|
4056int f2fs_init_compress_ctx(struct compress_ctx *cc); 4057void f2fs_destroy_compress_ctx(struct compress_ctx *cc, bool reuse); 4058void f2fs_init_compress_info(struct f2fs_sb_info *sbi); 4059int f2fs_init_compress_inode(struct f2fs_sb_info *sbi); 4060void f2fs_destroy_compress_inode(struct f2fs_sb_info *sbi); 4061int f2fs_init_page_array_cache(struct f2fs_sb_info *sbi); 4062void f2fs_destroy_page_array_cache(struct f2fs_sb_info *sbi); 4063int __init f2fs_init_compress_cache(void); --- 38 unchanged lines hidden (view full) --- 4102 bool failed, block_t blkaddr) 4103{ 4104 WARN_ON_ONCE(1); 4105} 4106static inline void f2fs_put_page_dic(struct page *page) 4107{ 4108 WARN_ON_ONCE(1); 4109} | 4048int f2fs_init_compress_ctx(struct compress_ctx *cc); 4049void f2fs_destroy_compress_ctx(struct compress_ctx *cc, bool reuse); 4050void f2fs_init_compress_info(struct f2fs_sb_info *sbi); 4051int f2fs_init_compress_inode(struct f2fs_sb_info *sbi); 4052void f2fs_destroy_compress_inode(struct f2fs_sb_info *sbi); 4053int f2fs_init_page_array_cache(struct f2fs_sb_info *sbi); 4054void f2fs_destroy_page_array_cache(struct f2fs_sb_info *sbi); 4055int __init f2fs_init_compress_cache(void); --- 38 unchanged lines hidden (view full) --- 4094 bool failed, block_t blkaddr) 4095{ 4096 WARN_ON_ONCE(1); 4097} 4098static inline void f2fs_put_page_dic(struct page *page) 4099{ 4100 WARN_ON_ONCE(1); 4101} |
4102static inline unsigned int f2fs_cluster_blocks_are_contiguous(struct dnode_of_data *dn) { return 0; } 4103static inline bool f2fs_sanity_check_cluster(struct dnode_of_data *dn) { return false; } |
|
4110static inline int f2fs_init_compress_inode(struct f2fs_sb_info *sbi) { return 0; } 4111static inline void f2fs_destroy_compress_inode(struct f2fs_sb_info *sbi) { } 4112static inline int f2fs_init_page_array_cache(struct f2fs_sb_info *sbi) { return 0; } 4113static inline void f2fs_destroy_page_array_cache(struct f2fs_sb_info *sbi) { } 4114static inline int __init f2fs_init_compress_cache(void) { return 0; } 4115static inline void f2fs_destroy_compress_cache(void) { } 4116static inline void f2fs_invalidate_compress_page(struct f2fs_sb_info *sbi, 4117 block_t blkaddr) { } 4118static inline void f2fs_cache_compressed_page(struct f2fs_sb_info *sbi, 4119 struct page *page, nid_t ino, block_t blkaddr) { } 4120static inline bool f2fs_load_compressed_page(struct f2fs_sb_info *sbi, 4121 struct page *page, block_t blkaddr) { return false; } 4122static inline void f2fs_invalidate_compress_pages(struct f2fs_sb_info *sbi, 4123 nid_t ino) { } 4124#define inc_compr_inode_stat(inode) do { } while (0) | 4104static inline int f2fs_init_compress_inode(struct f2fs_sb_info *sbi) { return 0; } 4105static inline void f2fs_destroy_compress_inode(struct f2fs_sb_info *sbi) { } 4106static inline int f2fs_init_page_array_cache(struct f2fs_sb_info *sbi) { return 0; } 4107static inline void f2fs_destroy_page_array_cache(struct f2fs_sb_info *sbi) { } 4108static inline int __init f2fs_init_compress_cache(void) { return 0; } 4109static inline void f2fs_destroy_compress_cache(void) { } 4110static inline void f2fs_invalidate_compress_page(struct f2fs_sb_info *sbi, 4111 block_t blkaddr) { } 4112static inline void f2fs_cache_compressed_page(struct f2fs_sb_info *sbi, 4113 struct page *page, nid_t ino, block_t blkaddr) { } 4114static inline bool f2fs_load_compressed_page(struct f2fs_sb_info *sbi, 4115 struct page *page, block_t blkaddr) { return false; } 4116static inline void f2fs_invalidate_compress_pages(struct f2fs_sb_info *sbi, 4117 nid_t ino) { } 4118#define inc_compr_inode_stat(inode) do { } while (0) |
4119static inline void f2fs_update_extent_tree_range_compressed(struct inode *inode, 4120 pgoff_t fofs, block_t blkaddr, unsigned int llen, 4121 unsigned int c_len) { } |
|
4125#endif 4126 4127static inline void set_compress_context(struct inode *inode) 4128{ 4129 struct f2fs_sb_info *sbi = F2FS_I_SB(inode); 4130 4131 F2FS_I(inode)->i_compress_algorithm = 4132 F2FS_OPTION(sbi).compress_algorithm; 4133 F2FS_I(inode)->i_log_cluster_size = 4134 F2FS_OPTION(sbi).compress_log_size; 4135 F2FS_I(inode)->i_compress_flag = 4136 F2FS_OPTION(sbi).compress_chksum ? 4137 1 << COMPRESS_CHKSUM : 0; 4138 F2FS_I(inode)->i_cluster_size = 4139 1 << F2FS_I(inode)->i_log_cluster_size; | 4122#endif 4123 4124static inline void set_compress_context(struct inode *inode) 4125{ 4126 struct f2fs_sb_info *sbi = F2FS_I_SB(inode); 4127 4128 F2FS_I(inode)->i_compress_algorithm = 4129 F2FS_OPTION(sbi).compress_algorithm; 4130 F2FS_I(inode)->i_log_cluster_size = 4131 F2FS_OPTION(sbi).compress_log_size; 4132 F2FS_I(inode)->i_compress_flag = 4133 F2FS_OPTION(sbi).compress_chksum ? 4134 1 << COMPRESS_CHKSUM : 0; 4135 F2FS_I(inode)->i_cluster_size = 4136 1 << F2FS_I(inode)->i_log_cluster_size; |
4140 if (F2FS_I(inode)->i_compress_algorithm == COMPRESS_LZ4 && | 4137 if ((F2FS_I(inode)->i_compress_algorithm == COMPRESS_LZ4 || 4138 F2FS_I(inode)->i_compress_algorithm == COMPRESS_ZSTD) && |
4141 F2FS_OPTION(sbi).compress_level) 4142 F2FS_I(inode)->i_compress_flag |= 4143 F2FS_OPTION(sbi).compress_level << 4144 COMPRESS_LEVEL_OFFSET; 4145 F2FS_I(inode)->i_flags |= F2FS_COMPR_FL; 4146 set_inode_flag(inode, FI_COMPRESSED_FILE); 4147 stat_inc_compr_inode(inode); 4148 inc_compr_inode_stat(inode); --- 151 unchanged lines hidden (view full) --- 4300 unsigned int i_blkbits = READ_ONCE(inode->i_blkbits); 4301 unsigned int blocksize_mask = (1 << i_blkbits) - 1; 4302 loff_t offset = iocb->ki_pos; 4303 unsigned long align = offset | iov_iter_alignment(iter); 4304 4305 return align & blocksize_mask; 4306} 4307 | 4139 F2FS_OPTION(sbi).compress_level) 4140 F2FS_I(inode)->i_compress_flag |= 4141 F2FS_OPTION(sbi).compress_level << 4142 COMPRESS_LEVEL_OFFSET; 4143 F2FS_I(inode)->i_flags |= F2FS_COMPR_FL; 4144 set_inode_flag(inode, FI_COMPRESSED_FILE); 4145 stat_inc_compr_inode(inode); 4146 inc_compr_inode_stat(inode); --- 151 unchanged lines hidden (view full) --- 4298 unsigned int i_blkbits = READ_ONCE(inode->i_blkbits); 4299 unsigned int blocksize_mask = (1 << i_blkbits) - 1; 4300 loff_t offset = iocb->ki_pos; 4301 unsigned long align = offset | iov_iter_alignment(iter); 4302 4303 return align & blocksize_mask; 4304} 4305 |
4308static inline int allow_outplace_dio(struct inode *inode, 4309 struct kiocb *iocb, struct iov_iter *iter) 4310{ 4311 struct f2fs_sb_info *sbi = F2FS_I_SB(inode); 4312 int rw = iov_iter_rw(iter); 4313 4314 return (f2fs_lfs_mode(sbi) && (rw == WRITE) && 4315 !block_unaligned_IO(inode, iocb, iter)); 4316} 4317 | |
4318static inline bool f2fs_force_buffered_io(struct inode *inode, 4319 struct kiocb *iocb, struct iov_iter *iter) 4320{ 4321 struct f2fs_sb_info *sbi = F2FS_I_SB(inode); 4322 int rw = iov_iter_rw(iter); 4323 4324 if (f2fs_post_read_required(inode)) 4325 return true; --- 38 unchanged lines hidden (view full) --- 4364 if (F2FS_OPTION(sbi).s_qf_names[USRQUOTA] || 4365 F2FS_OPTION(sbi).s_qf_names[GRPQUOTA] || 4366 F2FS_OPTION(sbi).s_qf_names[PRJQUOTA]) 4367 return true; 4368#endif 4369 return false; 4370} 4371 | 4306static inline bool f2fs_force_buffered_io(struct inode *inode, 4307 struct kiocb *iocb, struct iov_iter *iter) 4308{ 4309 struct f2fs_sb_info *sbi = F2FS_I_SB(inode); 4310 int rw = iov_iter_rw(iter); 4311 4312 if (f2fs_post_read_required(inode)) 4313 return true; --- 38 unchanged lines hidden (view full) --- 4352 if (F2FS_OPTION(sbi).s_qf_names[USRQUOTA] || 4353 F2FS_OPTION(sbi).s_qf_names[GRPQUOTA] || 4354 F2FS_OPTION(sbi).s_qf_names[PRJQUOTA]) 4355 return true; 4356#endif 4357 return false; 4358} 4359 |
4360static inline bool f2fs_block_unit_discard(struct f2fs_sb_info *sbi) 4361{ 4362 return F2FS_OPTION(sbi).discard_unit == DISCARD_UNIT_BLOCK; 4363} 4364 |
|
4372#define EFSBADCRC EBADMSG /* Bad CRC detected */ 4373#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */ 4374 4375#endif /* _LINUX_F2FS_H */ | 4365#define EFSBADCRC EBADMSG /* Bad CRC detected */ 4366#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */ 4367 4368#endif /* _LINUX_F2FS_H */ |