]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
gfs2: Minor delete_work_func cleanup
authorAndreas Gruenbacher <agruenba@redhat.com>
Thu, 22 Aug 2024 17:33:51 +0000 (19:33 +0200)
committerAndreas Gruenbacher <agruenba@redhat.com>
Tue, 5 Nov 2024 11:39:28 +0000 (12:39 +0100)
Move those definitions into the the scope in which they are used.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
fs/gfs2/glock.c

index c095ff2efe1d4762609750ba21fbfebae4a7e66f..9ec305b8d4d438c48c71133441615fa0d21a6d02 100644 (file)
@@ -1028,8 +1028,6 @@ static void delete_work_func(struct work_struct *work)
        struct delayed_work *dwork = to_delayed_work(work);
        struct gfs2_glock *gl = container_of(dwork, struct gfs2_glock, gl_delete);
        struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
-       struct inode *inode;
-       u64 no_addr = gl->gl_name.ln_number;
 
        if (test_and_clear_bit(GLF_TRY_TO_EVICT, &gl->gl_flags)) {
                /*
@@ -1059,6 +1057,9 @@ static void delete_work_func(struct work_struct *work)
        }
 
        if (test_and_clear_bit(GLF_VERIFY_DELETE, &gl->gl_flags)) {
+               u64 no_addr = gl->gl_name.ln_number;
+               struct inode *inode;
+
                inode = gfs2_lookup_by_inum(sdp, no_addr, gl->gl_no_formal_ino,
                                            GFS2_BLKST_UNLINKED);
                if (IS_ERR(inode)) {