erofs: always use iget5_locked
As Christoph said [1] [2], "Just use the slightly more complicated 32-bit version everywhere so that you have a single actually tested code path. And then remove this helper. " [1] https://lore.kernel.org/r/20190829102426.GE20598@infradead.org/ [2] https://lore.kernel.org/r/20190902125320.GA16726@infradead.org/ Reported-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Gao Xiang <gaoxiang25@huawei.com> Link: https://lore.kernel.org/r/20190904020912.63925-25-gaoxiang25@huawei.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
fe7c242357
commit
4231138fe0
|
@ -243,7 +243,6 @@ out_unlock:
|
||||||
* erofs nid is 64bits, but i_ino is 'unsigned long', therefore
|
* erofs nid is 64bits, but i_ino is 'unsigned long', therefore
|
||||||
* we should do more for 32-bit platform to find the right inode.
|
* we should do more for 32-bit platform to find the right inode.
|
||||||
*/
|
*/
|
||||||
#if BITS_PER_LONG == 32
|
|
||||||
static int erofs_ilookup_test_actor(struct inode *inode, void *opaque)
|
static int erofs_ilookup_test_actor(struct inode *inode, void *opaque)
|
||||||
{
|
{
|
||||||
const erofs_nid_t nid = *(erofs_nid_t *)opaque;
|
const erofs_nid_t nid = *(erofs_nid_t *)opaque;
|
||||||
|
@ -258,20 +257,14 @@ static int erofs_iget_set_actor(struct inode *inode, void *opaque)
|
||||||
inode->i_ino = erofs_inode_hash(nid);
|
inode->i_ino = erofs_inode_hash(nid);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static inline struct inode *erofs_iget_locked(struct super_block *sb,
|
static inline struct inode *erofs_iget_locked(struct super_block *sb,
|
||||||
erofs_nid_t nid)
|
erofs_nid_t nid)
|
||||||
{
|
{
|
||||||
const unsigned long hashval = erofs_inode_hash(nid);
|
const unsigned long hashval = erofs_inode_hash(nid);
|
||||||
|
|
||||||
#if BITS_PER_LONG >= 64
|
|
||||||
/* it is safe to use iget_locked for >= 64-bit platform */
|
|
||||||
return iget_locked(sb, hashval);
|
|
||||||
#else
|
|
||||||
return iget5_locked(sb, hashval, erofs_ilookup_test_actor,
|
return iget5_locked(sb, hashval, erofs_ilookup_test_actor,
|
||||||
erofs_iget_set_actor, &nid);
|
erofs_iget_set_actor, &nid);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct inode *erofs_iget(struct super_block *sb,
|
struct inode *erofs_iget(struct super_block *sb,
|
||||||
|
|
Loading…
Reference in New Issue