Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ext4: switch to ->iterate_shared()

Note that we need relax_dir() equivalent for directories
locked shared.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Al Viro ae05327a 9717a91b

+9 -2
+2 -2
fs/ext4/dir.c
··· 266 266 ctx->pos += ext4_rec_len_from_disk(de->rec_len, 267 267 sb->s_blocksize); 268 268 } 269 - if ((ctx->pos < inode->i_size) && !dir_relax(inode)) 269 + if ((ctx->pos < inode->i_size) && !dir_relax_shared(inode)) 270 270 goto done; 271 271 brelse(bh); 272 272 bh = NULL; ··· 644 644 const struct file_operations ext4_dir_operations = { 645 645 .llseek = ext4_dir_llseek, 646 646 .read = generic_read_dir, 647 - .iterate = ext4_readdir, 647 + .iterate_shared = ext4_readdir, 648 648 .unlocked_ioctl = ext4_ioctl, 649 649 #ifdef CONFIG_COMPAT 650 650 .compat_ioctl = ext4_compat_ioctl,
+7
include/linux/fs.h
··· 3134 3134 return !IS_DEADDIR(inode); 3135 3135 } 3136 3136 3137 + static inline bool dir_relax_shared(struct inode *inode) 3138 + { 3139 + inode_unlock_shared(inode); 3140 + inode_lock_shared(inode); 3141 + return !IS_DEADDIR(inode); 3142 + } 3143 + 3137 3144 extern bool path_noexec(const struct path *path); 3138 3145 extern void inode_nohighmem(struct inode *inode); 3139 3146