aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/inode.c
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruenba@redhat.com>2020-01-15 05:31:38 +0100
committerAndreas Gruenbacher <agruenba@redhat.com>2020-06-05 20:19:21 +0200
commit6bdcadea75768bbd1cd8f6f13011978e1e19a53b (patch)
treecd730d2ff13c2b9f77f1473ebc2c8d8565fdd82c /fs/gfs2/inode.c
parentgfs2: Try harder to delete inodes locally (diff)
downloadlinux-dev-6bdcadea75768bbd1cd8f6f13011978e1e19a53b.tar.xz
linux-dev-6bdcadea75768bbd1cd8f6f13011978e1e19a53b.zip
gfs2: Minor gfs2_lookup_by_inum cleanup
Use a zero no_formal_ino instead of a NULL pointer to indicate that any inode generation number will qualify: a valid inode never has a zero no_formal_ino. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Diffstat (limited to 'fs/gfs2/inode.c')
-rw-r--r--fs/gfs2/inode.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index a4112906abc2..812a6ae03f6c 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -207,8 +207,15 @@ fail:
return ERR_PTR(error);
}
+/**
+ * gfs2_lookup_by_inum - look up an inode by inode number
+ * @sdp: The super block
+ * @no_addr: The inode number
+ * @no_formal_ino: The inode generation number (0 for any)
+ * @blktype: Requested block type (see gfs2_inode_lookup)
+ */
struct inode *gfs2_lookup_by_inum(struct gfs2_sbd *sdp, u64 no_addr,
- u64 *no_formal_ino, unsigned int blktype)
+ u64 no_formal_ino, unsigned int blktype)
{
struct super_block *sb = sdp->sd_vfs;
struct inode *inode;
@@ -221,7 +228,7 @@ struct inode *gfs2_lookup_by_inum(struct gfs2_sbd *sdp, u64 no_addr,
/* Two extra checks for NFS only */
if (no_formal_ino) {
error = -ESTALE;
- if (GFS2_I(inode)->i_no_formal_ino != *no_formal_ino)
+ if (GFS2_I(inode)->i_no_formal_ino != no_formal_ino)
goto fail_iput;
error = -EIO;