]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: reduce indentation in file_find_dif()
authorRalph Boehme <slow@samba.org>
Thu, 19 Nov 2020 10:10:35 +0000 (11:10 +0100)
committerRalph Boehme <slow@samba.org>
Wed, 16 Dec 2020 09:08:30 +0000 (09:08 +0000)
No change in behaviour.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/files.c

index 7a7a772f5b56d7ad3f6f80d85d02d0b2f6cb2e67..49538c01cf3024d098f3dccce12de0864e6859cf 100644 (file)
@@ -746,30 +746,32 @@ files_struct *file_find_dif(struct smbd_server_connection *sconn,
                 * We can have a fsp->fh->fd == -1 here as it could be a stat
                 * open.
                 */
-               if (file_id_equal(&fsp->file_id, &id) &&
-                   fh_get_gen_id(fsp->fh) == gen_id )
+               if (!file_id_equal(&fsp->file_id, &id)) {
+                       continue;
+               }
+               if (fh_get_gen_id(fsp->fh) != gen_id) {
+                       continue;
+               }
+               if (count > 10) {
+                       DLIST_PROMOTE(sconn->files, fsp);
+               }
+               /* Paranoia check. */
+               if ((fsp_get_pathref_fd(fsp) == -1) &&
+                   (fsp->oplock_type != NO_OPLOCK &&
+                    fsp->oplock_type != LEASE_OPLOCK))
                {
-                       if (count > 10) {
-                               DLIST_PROMOTE(sconn->files, fsp);
-                       }
-                       /* Paranoia check. */
-                       if ((fsp_get_pathref_fd(fsp) == -1) &&
-                           (fsp->oplock_type != NO_OPLOCK &&
-                            fsp->oplock_type != LEASE_OPLOCK))
-                       {
-                               struct file_id_buf idbuf;
-
-                               DBG_ERR("file %s file_id = "
-                                       "%s, gen = %u oplock_type = %u is a "
-                                       "stat open with oplock type !\n",
-                                       fsp_str_dbg(fsp),
-                                       file_id_str_buf(fsp->file_id, &idbuf),
-                                       (unsigned int)fh_get_gen_id(fsp->fh),
-                                       (unsigned int)fsp->oplock_type);
-                               smb_panic("file_find_dif");
-                       }
-                       return fsp;
+                       struct file_id_buf idbuf;
+
+                       DBG_ERR("file %s file_id = "
+                               "%s, gen = %u oplock_type = %u is a "
+                               "stat open with oplock type !\n",
+                               fsp_str_dbg(fsp),
+                               file_id_str_buf(fsp->file_id, &idbuf),
+                               (unsigned int)fh_get_gen_id(fsp->fh),
+                               (unsigned int)fsp->oplock_type);
+                       smb_panic("file_find_dif");
                }
+               return fsp;
        }
 
        return NULL;