* [f2fs-dev] [PATCH 1/3] f2fs: zone: introduce first_zoned_segno in f2fs_sb_info @ 2024-10-18 6:26 Chao Yu via Linux-f2fs-devel 2024-10-18 6:26 ` [f2fs-dev] [PATCH 2/3] f2fs: zone: allow IPU for regular file in regular block device Chao Yu via Linux-f2fs-devel ` (2 more replies) 0 siblings, 3 replies; 6+ messages in thread From: Chao Yu via Linux-f2fs-devel @ 2024-10-18 6:26 UTC (permalink / raw) To: jaegeuk; +Cc: linux-kernel, linux-f2fs-devel first_zoned_segno() returns a fixed value, let's cache it in structure f2fs_sb_info to avoid redundant calculation. Signed-off-by: Chao Yu <chao@kernel.org> --- fs/f2fs/f2fs.h | 1 + fs/f2fs/segment.c | 4 ++-- fs/f2fs/segment.h | 10 ---------- fs/f2fs/super.c | 13 +++++++++++++ 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 0ff7f2812312..55bcd411257a 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -1760,6 +1760,7 @@ struct f2fs_sb_info { unsigned int dirty_device; /* for checkpoint data flush */ spinlock_t dev_lock; /* protect dirty_device */ bool aligned_blksize; /* all devices has the same logical blksize */ + unsigned int first_zoned_segno; /* first zoned segno */ /* For write statistics */ u64 sectors_written_start; diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index e1003e262184..a1806976f4ad 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -2732,7 +2732,7 @@ static int get_new_segment(struct f2fs_sb_info *sbi, if (sbi->blkzone_alloc_policy == BLKZONE_ALLOC_PRIOR_CONV || pinning) segno = 0; else - segno = max(first_zoned_segno(sbi), *newseg); + segno = max(sbi->first_zoned_segno, *newseg); hint = GET_SEC_FROM_SEG(sbi, segno); } #endif @@ -2744,7 +2744,7 @@ static int get_new_segment(struct f2fs_sb_info *sbi, if (secno >= MAIN_SECS(sbi) && f2fs_sb_has_blkzoned(sbi)) { /* Write only to sequential zones */ if (sbi->blkzone_alloc_policy == BLKZONE_ALLOC_ONLY_SEQ) { - hint = GET_SEC_FROM_SEG(sbi, first_zoned_segno(sbi)); + hint = GET_SEC_FROM_SEG(sbi, sbi->first_zoned_segno); secno = find_next_zero_bit(free_i->free_secmap, MAIN_SECS(sbi), hint); } else secno = find_first_zero_bit(free_i->free_secmap, diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h index cd6325f3b9ca..838c436266f4 100644 --- a/fs/f2fs/segment.h +++ b/fs/f2fs/segment.h @@ -971,13 +971,3 @@ static inline void wake_up_discard_thread(struct f2fs_sb_info *sbi, bool force) dcc->discard_wake = true; wake_up_interruptible_all(&dcc->discard_wait_queue); } - -static inline unsigned int first_zoned_segno(struct f2fs_sb_info *sbi) -{ - int devi; - - for (devi = 0; devi < sbi->s_ndevs; devi++) - if (bdev_is_zoned(FDEV(devi).bdev)) - return GET_SEGNO(sbi, FDEV(devi).start_blk); - return 0; -} diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 0d96e352b4ac..9325d8dc7f7d 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -4223,6 +4223,16 @@ static void f2fs_record_error_work(struct work_struct *work) f2fs_record_stop_reason(sbi); } +static inline unsigned int get_first_zoned_segno(struct f2fs_sb_info *sbi) +{ + int devi; + + for (devi = 0; devi < sbi->s_ndevs; devi++) + if (bdev_is_zoned(FDEV(devi).bdev)) + return GET_SEGNO(sbi, FDEV(devi).start_blk); + return 0; +} + static int f2fs_scan_devices(struct f2fs_sb_info *sbi) { struct f2fs_super_block *raw_super = F2FS_RAW_SUPER(sbi); @@ -4623,6 +4633,9 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent) /* For write statistics */ sbi->sectors_written_start = f2fs_get_sectors_written(sbi); + /* get segno of first zoned block device */ + sbi->first_zoned_segno = get_first_zoned_segno(sbi); + /* Read accumulated write IO statistics if exists */ seg_i = CURSEG_I(sbi, CURSEG_HOT_NODE); if (__exist_node_summaries(sbi)) -- 2.40.1 _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [f2fs-dev] [PATCH 2/3] f2fs: zone: allow IPU for regular file in regular block device 2024-10-18 6:26 [f2fs-dev] [PATCH 1/3] f2fs: zone: introduce first_zoned_segno in f2fs_sb_info Chao Yu via Linux-f2fs-devel @ 2024-10-18 6:26 ` Chao Yu via Linux-f2fs-devel 2024-10-21 23:18 ` Jaegeuk Kim via Linux-f2fs-devel 2024-10-18 6:26 ` [f2fs-dev] [PATCH 3/3] f2fs: support NOCoW flag Chao Yu via Linux-f2fs-devel 2024-10-28 17:40 ` [f2fs-dev] [PATCH 1/3] f2fs: zone: introduce first_zoned_segno in f2fs_sb_info patchwork-bot+f2fs--- via Linux-f2fs-devel 2 siblings, 1 reply; 6+ messages in thread From: Chao Yu via Linux-f2fs-devel @ 2024-10-18 6:26 UTC (permalink / raw) To: jaegeuk; +Cc: linux-kernel, linux-f2fs-devel blkzoned feature enables lfs mode by default, for data updates from regular file, it only allow to use OPU, this patch changes to allow to use IPU if regular file's data block locates in regular block device, if data block locates in zoned block device, it still uses OPU. Signed-off-by: Chao Yu <chao@kernel.org> --- fs/f2fs/data.c | 12 ++++++++++-- fs/f2fs/f2fs.h | 5 +++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 949b6bb957c7..c6d0e4aa12e3 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -2648,8 +2648,16 @@ bool f2fs_should_update_outplace(struct inode *inode, struct f2fs_io_info *fio) return false; if (fio && is_sbi_flag_set(sbi, SBI_NEED_FSCK)) return true; - if (f2fs_lfs_mode(sbi)) - return true; + if (f2fs_lfs_mode(sbi)) { + /* no regular block device in mainarea */ + if (!f2fs_blkzoned_has_regular_section(sbi)) + return true; + /* blkaddr locates in sequential zone */ + if (fio && __is_valid_data_blkaddr(fio->old_blkaddr) && + GET_SEGNO(sbi, fio->old_blkaddr) >= + sbi->first_zoned_segno) + return true; + } if (S_ISDIR(inode->i_mode)) return true; if (IS_NOQUOTA(inode)) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 55bcd411257a..6781b4fab43f 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -4790,6 +4790,11 @@ static inline void f2fs_invalidate_internal_cache(struct f2fs_sb_info *sbi, f2fs_invalidate_compress_page(sbi, blkaddr); } +static inline bool f2fs_blkzoned_has_regular_section(struct f2fs_sb_info *sbi) +{ + return f2fs_sb_has_blkzoned(sbi) && sbi->first_zoned_segno; +} + #define EFSBADCRC EBADMSG /* Bad CRC detected */ #define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */ -- 2.40.1 _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [f2fs-dev] [PATCH 2/3] f2fs: zone: allow IPU for regular file in regular block device 2024-10-18 6:26 ` [f2fs-dev] [PATCH 2/3] f2fs: zone: allow IPU for regular file in regular block device Chao Yu via Linux-f2fs-devel @ 2024-10-21 23:18 ` Jaegeuk Kim via Linux-f2fs-devel 2024-10-22 1:58 ` Chao Yu via Linux-f2fs-devel 0 siblings, 1 reply; 6+ messages in thread From: Jaegeuk Kim via Linux-f2fs-devel @ 2024-10-21 23:18 UTC (permalink / raw) To: Chao Yu; +Cc: linux-kernel, linux-f2fs-devel On 10/18, Chao Yu wrote: > blkzoned feature enables lfs mode by default, for data updates from > regular file, it only allow to use OPU, this patch changes to allow > to use IPU if regular file's data block locates in regular block > device, if data block locates in zoned block device, it still uses > OPU. > > Signed-off-by: Chao Yu <chao@kernel.org> > --- > fs/f2fs/data.c | 12 ++++++++++-- > fs/f2fs/f2fs.h | 5 +++++ > 2 files changed, 15 insertions(+), 2 deletions(-) > > diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c > index 949b6bb957c7..c6d0e4aa12e3 100644 > --- a/fs/f2fs/data.c > +++ b/fs/f2fs/data.c > @@ -2648,8 +2648,16 @@ bool f2fs_should_update_outplace(struct inode *inode, struct f2fs_io_info *fio) > return false; > if (fio && is_sbi_flag_set(sbi, SBI_NEED_FSCK)) > return true; > - if (f2fs_lfs_mode(sbi)) > - return true; > + if (f2fs_lfs_mode(sbi)) { > + /* no regular block device in mainarea */ > + if (!f2fs_blkzoned_has_regular_section(sbi)) > + return true; > + /* blkaddr locates in sequential zone */ > + if (fio && __is_valid_data_blkaddr(fio->old_blkaddr) && > + GET_SEGNO(sbi, fio->old_blkaddr) >= > + sbi->first_zoned_segno) What if there's another regular device beyond zoned partition? I prefer to keep the entire area as lfs mode to simplify the performance. Do we really need IPU on conventional partition? Why not asking to use file pinning, if someone needs IPU? > + return true; > + } > if (S_ISDIR(inode->i_mode)) > return true; > if (IS_NOQUOTA(inode)) > diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h > index 55bcd411257a..6781b4fab43f 100644 > --- a/fs/f2fs/f2fs.h > +++ b/fs/f2fs/f2fs.h > @@ -4790,6 +4790,11 @@ static inline void f2fs_invalidate_internal_cache(struct f2fs_sb_info *sbi, > f2fs_invalidate_compress_page(sbi, blkaddr); > } > > +static inline bool f2fs_blkzoned_has_regular_section(struct f2fs_sb_info *sbi) > +{ > + return f2fs_sb_has_blkzoned(sbi) && sbi->first_zoned_segno; > +} > + > #define EFSBADCRC EBADMSG /* Bad CRC detected */ > #define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */ > > -- > 2.40.1 _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [f2fs-dev] [PATCH 2/3] f2fs: zone: allow IPU for regular file in regular block device 2024-10-21 23:18 ` Jaegeuk Kim via Linux-f2fs-devel @ 2024-10-22 1:58 ` Chao Yu via Linux-f2fs-devel 0 siblings, 0 replies; 6+ messages in thread From: Chao Yu via Linux-f2fs-devel @ 2024-10-22 1:58 UTC (permalink / raw) To: Jaegeuk Kim; +Cc: linux-kernel, linux-f2fs-devel On 2024/10/22 7:18, Jaegeuk Kim wrote: > On 10/18, Chao Yu wrote: >> blkzoned feature enables lfs mode by default, for data updates from >> regular file, it only allow to use OPU, this patch changes to allow >> to use IPU if regular file's data block locates in regular block >> device, if data block locates in zoned block device, it still uses >> OPU. >> >> Signed-off-by: Chao Yu <chao@kernel.org> >> --- >> fs/f2fs/data.c | 12 ++++++++++-- >> fs/f2fs/f2fs.h | 5 +++++ >> 2 files changed, 15 insertions(+), 2 deletions(-) >> >> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c >> index 949b6bb957c7..c6d0e4aa12e3 100644 >> --- a/fs/f2fs/data.c >> +++ b/fs/f2fs/data.c >> @@ -2648,8 +2648,16 @@ bool f2fs_should_update_outplace(struct inode *inode, struct f2fs_io_info *fio) >> return false; >> if (fio && is_sbi_flag_set(sbi, SBI_NEED_FSCK)) >> return true; >> - if (f2fs_lfs_mode(sbi)) >> - return true; >> + if (f2fs_lfs_mode(sbi)) { >> + /* no regular block device in mainarea */ >> + if (!f2fs_blkzoned_has_regular_section(sbi)) >> + return true; >> + /* blkaddr locates in sequential zone */ >> + if (fio && __is_valid_data_blkaddr(fio->old_blkaddr) && >> + GET_SEGNO(sbi, fio->old_blkaddr) >= >> + sbi->first_zoned_segno) > > What if there's another regular device beyond zoned partition? With above logic, it will trigger OPU if data locates in regular device which is beyond zoned partition. > I prefer to keep the entire area as lfs mode to simplify the performance. Oh, what do you think of introducing another option mode=hybrid? so that we can provide an option to allow LFS/IPU/SSR in regular device beside we limit LFS mode in zoned device. > Do we really need IPU on conventional partition? Why not asking to use > file pinning, if someone needs IPU? One concern is size of pinned file should be multiple of section, pined file will cost too much space if section size is large. Another problem is flow of third-party applications can not be controlled by us, so it's not possible to execute pinfile & falloc after file creation. Thanks, > >> + return true; >> + } >> if (S_ISDIR(inode->i_mode)) >> return true; >> if (IS_NOQUOTA(inode)) >> diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h >> index 55bcd411257a..6781b4fab43f 100644 >> --- a/fs/f2fs/f2fs.h >> +++ b/fs/f2fs/f2fs.h >> @@ -4790,6 +4790,11 @@ static inline void f2fs_invalidate_internal_cache(struct f2fs_sb_info *sbi, >> f2fs_invalidate_compress_page(sbi, blkaddr); >> } >> >> +static inline bool f2fs_blkzoned_has_regular_section(struct f2fs_sb_info *sbi) >> +{ >> + return f2fs_sb_has_blkzoned(sbi) && sbi->first_zoned_segno; >> +} >> + >> #define EFSBADCRC EBADMSG /* Bad CRC detected */ >> #define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */ >> >> -- >> 2.40.1 _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel ^ permalink raw reply [flat|nested] 6+ messages in thread
* [f2fs-dev] [PATCH 3/3] f2fs: support NOCoW flag 2024-10-18 6:26 [f2fs-dev] [PATCH 1/3] f2fs: zone: introduce first_zoned_segno in f2fs_sb_info Chao Yu via Linux-f2fs-devel 2024-10-18 6:26 ` [f2fs-dev] [PATCH 2/3] f2fs: zone: allow IPU for regular file in regular block device Chao Yu via Linux-f2fs-devel @ 2024-10-18 6:26 ` Chao Yu via Linux-f2fs-devel 2024-10-28 17:40 ` [f2fs-dev] [PATCH 1/3] f2fs: zone: introduce first_zoned_segno in f2fs_sb_info patchwork-bot+f2fs--- via Linux-f2fs-devel 2 siblings, 0 replies; 6+ messages in thread From: Chao Yu via Linux-f2fs-devel @ 2024-10-18 6:26 UTC (permalink / raw) To: jaegeuk; +Cc: linux-kernel, linux-f2fs-devel Overhead of pinfile is heavy due to: 1) GC tries to skip migrating section which contains pinfile's data block, it will cost more time during GC, 2) and also it will take high risk when GC unpins file and migrates it's data block once inode.i_gc_failure exceeds threshold. This patch proposes to support NOCoW flag on inode, which has similar semantics to pinfile: Pinfile NOCoW [Enable] only regular yes yes only empty file yes no blkzoned=on,mode=lfs Support Support blkzoned=off,mode=lfs Not support Not support [fsync/wb/dio IO behavior] block in regular device IPU IPU block in zoned device N/A OPU [Misc IO behavior] GC skip/OPU OPU defrag ioc/swapon Not support Support If userspace doesn't need pinned physical block address for following direct access, we can tag file w/ NOCoW flag instead of pinfile flag, we will be benefit from it for below cases: 1) user's write won't fragment NOCoW file's data block due to IPU 2) GC/defrag/swapon won't fail on NOCoW file. Please note that, this patch changes to not show NOCoW flag for a pinned file, the logic is as below: Before Pinned file lsattr C f2fs_io pinfile get pinned After Pinned file NOCoW file lsattr - C f2fs_io pinfile get pinned un-pinned So, to consider backward compatibility, if NOCoW flag shown on a target inode, we need to check pinned flag to see whether NOCoW flag was really tagged or not. Signed-off-by: Chao Yu <chao@kernel.org> --- fs/f2fs/data.c | 21 ++++++++++++++++++++- fs/f2fs/f2fs.h | 10 ++++++++-- fs/f2fs/file.c | 22 ++++++++++++++++++---- 3 files changed, 46 insertions(+), 7 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index c6d0e4aa12e3..b8ba97b2c11f 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -1636,7 +1636,7 @@ int f2fs_map_blocks(struct inode *inode, struct f2fs_map_blocks *map, int flag) /* use out-place-update for direct IO under LFS mode */ if (map->m_may_create && (is_hole || (flag == F2FS_GET_BLOCK_DIO && f2fs_lfs_mode(sbi) && - !f2fs_is_pinned_file(inode)))) { + !f2fs_is_pinned_file(inode) && !f2fs_is_nocow_file(inode)))) { if (unlikely(f2fs_cp_error(sbi))) { err = -EIO; goto sync_out; @@ -2636,6 +2636,11 @@ bool f2fs_should_update_inplace(struct inode *inode, struct f2fs_io_info *fio) if (file_is_cold(inode) && !is_inode_flag_set(inode, FI_OPU_WRITE)) return true; + /* allows NOCoW file to be migrated during defragmentation and swapon */ + if (f2fs_is_nocow_file(inode) && + !is_inode_flag_set(inode, FI_OPU_WRITE)) + return true; + return check_inplace_update_policy(inode, fio); } @@ -2658,6 +2663,9 @@ bool f2fs_should_update_outplace(struct inode *inode, struct f2fs_io_info *fio) sbi->first_zoned_segno) return true; } + /* should check NOCoW flag after lfs_mode check condition */ + if (f2fs_is_nocow_file(inode)) + return false; if (S_ISDIR(inode->i_mode)) return true; if (IS_NOQUOTA(inode)) @@ -2722,11 +2730,22 @@ int f2fs_do_write_data_page(struct f2fs_io_info *fio) DATA_GENERIC_ENHANCE)) return -EFSCORRUPTED; + /* + * if data block of NOCoW inode locates in sequential-zone, + * let's trigger OPU. + */ + if (f2fs_is_nocow_file(inode) && + f2fs_blkzoned_has_regular_section(fio->sbi) && + GET_SEGNO(fio->sbi, fio->old_blkaddr) >= + fio->sbi->first_zoned_segno) + goto get_dnode; + ipu_force = true; fio->need_lock = LOCK_DONE; goto got_it; } +get_dnode: /* Deadlock due to between page->lock and f2fs_lock_op */ if (fio->need_lock == LOCK_REQ && !f2fs_trylock_op(fio->sbi)) return -EAGAIN; diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 6781b4fab43f..9b7fa960cd8b 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -3047,6 +3047,7 @@ static inline void f2fs_change_bit(unsigned int nr, char *addr) #define F2FS_NOCOMP_FL 0x00000400 /* Don't compress */ #define F2FS_INDEX_FL 0x00001000 /* hash-indexed directory */ #define F2FS_DIRSYNC_FL 0x00010000 /* dirsync behaviour (directories only) */ +#define F2FS_NOCOW_FL 0x00800000 /* Do not cow file */ #define F2FS_PROJINHERIT_FL 0x20000000 /* Create with parents projid */ #define F2FS_CASEFOLD_FL 0x40000000 /* Casefolded file */ #define F2FS_DEVICE_ALIAS_FL 0x80000000 /* File for aliasing a device */ @@ -3332,6 +3333,11 @@ static inline bool f2fs_is_cow_file(struct inode *inode) return is_inode_flag_set(inode, FI_COW_FILE); } +static inline bool f2fs_is_nocow_file(struct inode *inode) +{ + return F2FS_I(inode)->i_flags & F2FS_NOCOW_FL; +} + static inline void *inline_data_addr(struct inode *inode, struct page *page) { __le32 *addr = get_dnode_addr(inode, page); @@ -4658,8 +4664,8 @@ static inline bool f2fs_low_mem_mode(struct f2fs_sb_info *sbi) static inline bool f2fs_may_compress(struct inode *inode) { if (IS_SWAPFILE(inode) || f2fs_is_pinned_file(inode) || - f2fs_is_atomic_file(inode) || f2fs_has_inline_data(inode) || - f2fs_is_mmap_file(inode)) + f2fs_is_nocow_file(inode) || f2fs_is_atomic_file(inode) || + f2fs_has_inline_data(inode) || f2fs_is_mmap_file(inode)) return false; return S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode); } diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 92d7c62eba29..580609223799 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -1998,6 +1998,20 @@ static int f2fs_setflags_common(struct inode *inode, u32 iflags, u32 mask) if (IS_NOQUOTA(inode)) return -EPERM; + if ((iflags ^ masked_flags) & F2FS_NOCOW_FL) { + if (iflags & F2FS_NOCOW_FL) { + int ret; + + if (!S_ISREG(inode->i_mode)) + return -EINVAL; + if (f2fs_should_update_outplace(inode, NULL)) + return -EINVAL; + ret = f2fs_convert_inline_inode(inode); + if (ret) + return ret; + } + } + if ((iflags ^ masked_flags) & F2FS_CASEFOLD_FL) { if (!f2fs_sb_has_casefold(F2FS_I_SB(inode))) return -EOPNOTSUPP; @@ -2077,6 +2091,7 @@ static const struct { { F2FS_NOCOMP_FL, FS_NOCOMP_FL }, { F2FS_INDEX_FL, FS_INDEX_FL }, { F2FS_DIRSYNC_FL, FS_DIRSYNC_FL }, + { F2FS_NOCOW_FL, FS_NOCOW_FL }, { F2FS_PROJINHERIT_FL, FS_PROJINHERIT_FL }, { F2FS_CASEFOLD_FL, FS_CASEFOLD_FL }, }; @@ -2108,7 +2123,8 @@ static const struct { FS_NOCOMP_FL | \ FS_DIRSYNC_FL | \ FS_PROJINHERIT_FL | \ - FS_CASEFOLD_FL) + FS_CASEFOLD_FL | \ + FS_NOCOW_FL) /* Convert f2fs on-disk i_flags to FS_IOC_{GET,SET}FLAGS flags */ static inline u32 f2fs_iflags_to_fsflags(u32 iflags) @@ -2171,7 +2187,7 @@ static int f2fs_ioc_start_atomic_write(struct file *filp, bool truncate) inode_lock(inode); if (!f2fs_disable_compressed_file(inode) || - f2fs_is_pinned_file(inode)) { + f2fs_is_pinned_file(inode) || f2fs_is_nocow_file(inode)) { ret = -EINVAL; goto out; } @@ -3273,8 +3289,6 @@ int f2fs_fileattr_get(struct dentry *dentry, struct fileattr *fa) fsflags |= FS_VERITY_FL; if (f2fs_has_inline_data(inode) || f2fs_has_inline_dentry(inode)) fsflags |= FS_INLINE_DATA_FL; - if (is_inode_flag_set(inode, FI_PIN_FILE)) - fsflags |= FS_NOCOW_FL; fileattr_fill_flags(fa, fsflags & F2FS_GETTABLE_FS_FL); -- 2.40.1 _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [f2fs-dev] [PATCH 1/3] f2fs: zone: introduce first_zoned_segno in f2fs_sb_info 2024-10-18 6:26 [f2fs-dev] [PATCH 1/3] f2fs: zone: introduce first_zoned_segno in f2fs_sb_info Chao Yu via Linux-f2fs-devel 2024-10-18 6:26 ` [f2fs-dev] [PATCH 2/3] f2fs: zone: allow IPU for regular file in regular block device Chao Yu via Linux-f2fs-devel 2024-10-18 6:26 ` [f2fs-dev] [PATCH 3/3] f2fs: support NOCoW flag Chao Yu via Linux-f2fs-devel @ 2024-10-28 17:40 ` patchwork-bot+f2fs--- via Linux-f2fs-devel 2 siblings, 0 replies; 6+ messages in thread From: patchwork-bot+f2fs--- via Linux-f2fs-devel @ 2024-10-28 17:40 UTC (permalink / raw) To: Chao Yu; +Cc: jaegeuk, linux-kernel, linux-f2fs-devel Hello: This series was applied to jaegeuk/f2fs.git (dev) by Jaegeuk Kim <jaegeuk@kernel.org>: On Fri, 18 Oct 2024 14:26:36 +0800 you wrote: > first_zoned_segno() returns a fixed value, let's cache it in > structure f2fs_sb_info to avoid redundant calculation. > > Signed-off-by: Chao Yu <chao@kernel.org> > --- > fs/f2fs/f2fs.h | 1 + > fs/f2fs/segment.c | 4 ++-- > fs/f2fs/segment.h | 10 ---------- > fs/f2fs/super.c | 13 +++++++++++++ > 4 files changed, 16 insertions(+), 12 deletions(-) Here is the summary with links: - [f2fs-dev,1/3] f2fs: zone: introduce first_zoned_segno in f2fs_sb_info https://git.kernel.org/jaegeuk/f2fs/c/08060c0b1414 - [f2fs-dev,2/3] f2fs: zone: allow IPU for regular file in regular block device (no matching commit) - [f2fs-dev,3/3] f2fs: support NOCoW flag (no matching commit) You are awesome, thank you! -- Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-10-28 17:40 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2024-10-18 6:26 [f2fs-dev] [PATCH 1/3] f2fs: zone: introduce first_zoned_segno in f2fs_sb_info Chao Yu via Linux-f2fs-devel 2024-10-18 6:26 ` [f2fs-dev] [PATCH 2/3] f2fs: zone: allow IPU for regular file in regular block device Chao Yu via Linux-f2fs-devel 2024-10-21 23:18 ` Jaegeuk Kim via Linux-f2fs-devel 2024-10-22 1:58 ` Chao Yu via Linux-f2fs-devel 2024-10-18 6:26 ` [f2fs-dev] [PATCH 3/3] f2fs: support NOCoW flag Chao Yu via Linux-f2fs-devel 2024-10-28 17:40 ` [f2fs-dev] [PATCH 1/3] f2fs: zone: introduce first_zoned_segno in f2fs_sb_info patchwork-bot+f2fs--- via Linux-f2fs-devel
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).