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

new helper: inode_fake_hash()

open-coded in a quite a few places...

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

Al Viro 5bef9151 e950564b

+15 -10
+1 -1
fs/hfs/inode.c
··· 541 541 HFS_I(inode)->rsrc_inode = dir; 542 542 HFS_I(dir)->rsrc_inode = inode; 543 543 igrab(dir); 544 - hlist_add_fake(&inode->i_hash); 544 + inode_fake_hash(inode); 545 545 mark_inode_dirty(inode); 546 546 dont_mount(dentry); 547 547 out:
+1 -7
fs/jfs/jfs_imap.c
··· 491 491 /* release the page */ 492 492 release_metapage(mp); 493 493 494 - /* 495 - * __mark_inode_dirty expects inodes to be hashed. Since we don't 496 - * want special inodes in the fileset inode space, we make them 497 - * appear hashed, but do not put on any lists. hlist_del() 498 - * will work fine and require no locking. 499 - */ 500 - hlist_add_fake(&ip->i_hash); 494 + inode_fake_hash(ip); 501 495 502 496 return (ip); 503 497 }
+1 -1
fs/jfs/super.c
··· 581 581 inode->i_ino = 0; 582 582 inode->i_size = i_size_read(sb->s_bdev->bd_inode); 583 583 inode->i_mapping->a_ops = &jfs_metapage_aops; 584 - hlist_add_fake(&inode->i_hash); 584 + inode_fake_hash(inode); 585 585 mapping_set_gfp_mask(inode->i_mapping, GFP_NOFS); 586 586 587 587 sbi->direct_inode = inode;
+1 -1
fs/xfs/xfs_iops.c
··· 1253 1253 1254 1254 inode_sb_list_add(inode); 1255 1255 /* make the inode look hashed for the writeback code */ 1256 - hlist_add_fake(&inode->i_hash); 1256 + inode_fake_hash(inode); 1257 1257 1258 1258 inode->i_uid = xfs_uid_to_kuid(ip->i_d.di_uid); 1259 1259 inode->i_gid = xfs_gid_to_kgid(ip->i_d.di_gid);
+11
include/linux/fs.h
··· 685 685 } 686 686 687 687 /* 688 + * __mark_inode_dirty expects inodes to be hashed. Since we don't 689 + * want special inodes in the fileset inode space, we make them 690 + * appear hashed, but do not put on any lists. hlist_del() 691 + * will work fine and require no locking. 692 + */ 693 + static inline void inode_fake_hash(struct inode *inode) 694 + { 695 + hlist_add_fake(&inode->i_hash); 696 + } 697 + 698 + /* 688 699 * inode->i_mutex nesting subclasses for the lock validator: 689 700 * 690 701 * 0: the object of the current VFS operation