2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-24 05:04:00 +08:00

gfs2: Check for active reservation in gfs2_release

In gfs2_release, check if the inode has an active reservation to avoid
unnecessary lock taking.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
This commit is contained in:
Andreas Gruenbacher 2020-10-21 16:37:54 +02:00
parent b2598965dc
commit 0ec9b9ea4f

View File

@ -716,10 +716,10 @@ static int gfs2_release(struct inode *inode, struct file *file)
kfree(file->private_data);
file->private_data = NULL;
if (file->f_mode & FMODE_WRITE) {
if (gfs2_rs_active(&ip->i_res))
gfs2_rs_delete(ip, &inode->i_writecount);
if (file->f_mode & FMODE_WRITE)
gfs2_qa_put(ip);
}
return 0;
}