f2fs.h (6ae1be13e85f4c42c8ca371fda50ae39eebbfd96) | f2fs.h (3c62be17d4f562f43fe1d03b48194399caa35aa5) |
---|---|
1/* 2 * fs/f2fs/f2fs.h 3 * 4 * Copyright (c) 2012 Samsung Electronics Co., Ltd. 5 * http://www.samsung.com/ 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License version 2 as --- 695 unchanged lines hidden (view full) --- 704struct f2fs_bio_info { 705 struct f2fs_sb_info *sbi; /* f2fs superblock */ 706 struct bio *bio; /* bios to merge */ 707 sector_t last_block_in_bio; /* last block number */ 708 struct f2fs_io_info fio; /* store buffered io info. */ 709 struct rw_semaphore io_rwsem; /* blocking op for bio */ 710}; 711 | 1/* 2 * fs/f2fs/f2fs.h 3 * 4 * Copyright (c) 2012 Samsung Electronics Co., Ltd. 5 * http://www.samsung.com/ 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License version 2 as --- 695 unchanged lines hidden (view full) --- 704struct f2fs_bio_info { 705 struct f2fs_sb_info *sbi; /* f2fs superblock */ 706 struct bio *bio; /* bios to merge */ 707 sector_t last_block_in_bio; /* last block number */ 708 struct f2fs_io_info fio; /* store buffered io info. */ 709 struct rw_semaphore io_rwsem; /* blocking op for bio */ 710}; 711 |
712#define FDEV(i) (sbi->devs[i]) 713#define RDEV(i) (raw_super->devs[i]) 714struct f2fs_dev_info { 715 struct block_device *bdev; 716 char path[MAX_PATH_LEN]; 717 unsigned int total_segments; 718 block_t start_blk; 719 block_t end_blk; 720#ifdef CONFIG_BLK_DEV_ZONED 721 unsigned int nr_blkz; /* Total number of zones */ 722 u8 *blkz_type; /* Array of zones type */ 723#endif 724}; 725 |
|
712enum inode_type { 713 DIR_INODE, /* for dirty dir inode */ 714 FILE_INODE, /* for dirty regular/symlink inode */ 715 DIRTY_META, /* for all dirtied inode metadata */ 716 NR_INODE_TYPE, 717}; 718 719/* for inner inode cache management */ --- 32 unchanged lines hidden (view full) --- 752 unsigned long s_flag; /* flags for sbi */ 753 754#ifdef CONFIG_F2FS_FS_ENCRYPTION 755 u8 key_prefix[F2FS_KEY_DESC_PREFIX_SIZE]; 756 u8 key_prefix_size; 757#endif 758 759#ifdef CONFIG_BLK_DEV_ZONED | 726enum inode_type { 727 DIR_INODE, /* for dirty dir inode */ 728 FILE_INODE, /* for dirty regular/symlink inode */ 729 DIRTY_META, /* for all dirtied inode metadata */ 730 NR_INODE_TYPE, 731}; 732 733/* for inner inode cache management */ --- 32 unchanged lines hidden (view full) --- 766 unsigned long s_flag; /* flags for sbi */ 767 768#ifdef CONFIG_F2FS_FS_ENCRYPTION 769 u8 key_prefix[F2FS_KEY_DESC_PREFIX_SIZE]; 770 u8 key_prefix_size; 771#endif 772 773#ifdef CONFIG_BLK_DEV_ZONED |
760 unsigned int nr_blkz; /* Total number of zones */ | |
761 unsigned int blocks_per_blkz; /* F2FS blocks per zone */ 762 unsigned int log_blocks_per_blkz; /* log2 F2FS blocks per zone */ | 774 unsigned int blocks_per_blkz; /* F2FS blocks per zone */ 775 unsigned int log_blocks_per_blkz; /* log2 F2FS blocks per zone */ |
763 u8 *blkz_type; /* Array of zones type */ | |
764#endif 765 766 /* for node-related operations */ 767 struct f2fs_nm_info *nm_info; /* node manager */ 768 struct inode *node_inode; /* cache node blocks */ 769 770 /* for segment-related operations */ 771 struct f2fs_sm_info *sm_info; /* segment manager */ --- 99 unchanged lines hidden (view full) --- 871 spinlock_t stat_lock; /* lock for stat operations */ 872 873 /* For sysfs suppport */ 874 struct kobject s_kobj; 875 struct completion s_kobj_unregister; 876 877 /* For shrinker support */ 878 struct list_head s_list; | 776#endif 777 778 /* for node-related operations */ 779 struct f2fs_nm_info *nm_info; /* node manager */ 780 struct inode *node_inode; /* cache node blocks */ 781 782 /* for segment-related operations */ 783 struct f2fs_sm_info *sm_info; /* segment manager */ --- 99 unchanged lines hidden (view full) --- 883 spinlock_t stat_lock; /* lock for stat operations */ 884 885 /* For sysfs suppport */ 886 struct kobject s_kobj; 887 struct completion s_kobj_unregister; 888 889 /* For shrinker support */ 890 struct list_head s_list; |
891 int s_ndevs; /* number of devices */ 892 struct f2fs_dev_info *devs; /* for device list */ |
|
879 struct mutex umount_mutex; 880 unsigned int shrinker_run_no; 881 882 /* For write statistics */ 883 u64 sectors_written_start; 884 u64 kbytes_written; 885 886 /* Reference to checksum algorithm driver via cryptoapi */ --- 1246 unchanged lines hidden (view full) --- 2133 * data.c 2134 */ 2135void f2fs_submit_merged_bio(struct f2fs_sb_info *, enum page_type, int); 2136void f2fs_submit_merged_bio_cond(struct f2fs_sb_info *, struct inode *, 2137 struct page *, nid_t, enum page_type, int); 2138void f2fs_flush_merged_bios(struct f2fs_sb_info *); 2139int f2fs_submit_page_bio(struct f2fs_io_info *); 2140void f2fs_submit_page_mbio(struct f2fs_io_info *); | 893 struct mutex umount_mutex; 894 unsigned int shrinker_run_no; 895 896 /* For write statistics */ 897 u64 sectors_written_start; 898 u64 kbytes_written; 899 900 /* Reference to checksum algorithm driver via cryptoapi */ --- 1246 unchanged lines hidden (view full) --- 2147 * data.c 2148 */ 2149void f2fs_submit_merged_bio(struct f2fs_sb_info *, enum page_type, int); 2150void f2fs_submit_merged_bio_cond(struct f2fs_sb_info *, struct inode *, 2151 struct page *, nid_t, enum page_type, int); 2152void f2fs_flush_merged_bios(struct f2fs_sb_info *); 2153int f2fs_submit_page_bio(struct f2fs_io_info *); 2154void f2fs_submit_page_mbio(struct f2fs_io_info *); |
2155struct block_device *f2fs_target_device(struct f2fs_sb_info *, 2156 block_t, struct bio *); 2157int f2fs_target_device_index(struct f2fs_sb_info *, block_t); |
|
2141void set_data_blkaddr(struct dnode_of_data *); 2142void f2fs_update_data_blkaddr(struct dnode_of_data *, block_t); 2143int reserve_new_blocks(struct dnode_of_data *, blkcnt_t); 2144int reserve_new_block(struct dnode_of_data *); 2145int f2fs_get_block(struct dnode_of_data *, pgoff_t); 2146ssize_t f2fs_preallocate_blocks(struct kiocb *, struct iov_iter *); 2147int f2fs_reserve_block(struct dnode_of_data *, pgoff_t); 2148struct page *get_read_data_page(struct inode *, pgoff_t, int, bool); --- 271 unchanged lines hidden (view full) --- 2420 2421static inline int f2fs_sb_mounted_blkzoned(struct super_block *sb) 2422{ 2423 return F2FS_HAS_FEATURE(sb, F2FS_FEATURE_BLKZONED); 2424} 2425 2426#ifdef CONFIG_BLK_DEV_ZONED 2427static inline int get_blkz_type(struct f2fs_sb_info *sbi, | 2158void set_data_blkaddr(struct dnode_of_data *); 2159void f2fs_update_data_blkaddr(struct dnode_of_data *, block_t); 2160int reserve_new_blocks(struct dnode_of_data *, blkcnt_t); 2161int reserve_new_block(struct dnode_of_data *); 2162int f2fs_get_block(struct dnode_of_data *, pgoff_t); 2163ssize_t f2fs_preallocate_blocks(struct kiocb *, struct iov_iter *); 2164int f2fs_reserve_block(struct dnode_of_data *, pgoff_t); 2165struct page *get_read_data_page(struct inode *, pgoff_t, int, bool); --- 271 unchanged lines hidden (view full) --- 2437 2438static inline int f2fs_sb_mounted_blkzoned(struct super_block *sb) 2439{ 2440 return F2FS_HAS_FEATURE(sb, F2FS_FEATURE_BLKZONED); 2441} 2442 2443#ifdef CONFIG_BLK_DEV_ZONED 2444static inline int get_blkz_type(struct f2fs_sb_info *sbi, |
2428 block_t blkaddr) | 2445 struct block_device *bdev, block_t blkaddr) |
2429{ 2430 unsigned int zno = blkaddr >> sbi->log_blocks_per_blkz; | 2446{ 2447 unsigned int zno = blkaddr >> sbi->log_blocks_per_blkz; |
2448 int i; |
|
2431 | 2449 |
2432 return sbi->blkz_type[zno]; | 2450 for (i = 0; i < sbi->s_ndevs; i++) 2451 if (FDEV(i).bdev == bdev) 2452 return FDEV(i).blkz_type[zno]; 2453 return -EINVAL; |
2433} 2434#endif 2435 2436static inline bool f2fs_discard_en(struct f2fs_sb_info *sbi) 2437{ 2438 struct request_queue *q = bdev_get_queue(sbi->sb->s_bdev); 2439 2440 return blk_queue_discard(q) || f2fs_sb_mounted_blkzoned(sbi->sb); --- 53 unchanged lines hidden --- | 2454} 2455#endif 2456 2457static inline bool f2fs_discard_en(struct f2fs_sb_info *sbi) 2458{ 2459 struct request_queue *q = bdev_get_queue(sbi->sb->s_bdev); 2460 2461 return blk_queue_discard(q) || f2fs_sb_mounted_blkzoned(sbi->sb); --- 53 unchanged lines hidden --- |