From: Volker Lendecke Date: Sun, 19 Oct 2025 09:33:03 +0000 (+0200) Subject: vfs_commit: Reduce indentation with early returns X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=265badba8a0e36ea3372cbf31d424a9083df7416;p=thirdparty%2Fsamba.git vfs_commit: Reduce indentation with early returns Signed-off-by: Volker Lendecke Reviewed-by: Anoop C S --- diff --git a/source3/modules/vfs_commit.c b/source3/modules/vfs_commit.c index a5d334c81bc..55d82abb10d 100644 --- a/source3/modules/vfs_commit.c +++ b/source3/modules/vfs_commit.c @@ -105,18 +105,17 @@ static int commit_all( struct vfs_handle_struct * handle, files_struct * fsp) { - struct commit_info *c; + struct commit_info *c = VFS_FETCH_FSP_EXTENSION(handle, fsp); - if ((c = (struct commit_info *)VFS_FETCH_FSP_EXTENSION(handle, fsp))) { - if (c->dbytes) { - DEBUG(module_debug, - ("%s: flushing %zu dirty bytes\n", - MODULE, c->dbytes)); + if ((c == NULL) || (c->dbytes == 0)) { + return 0; + } - return commit_do(c, fsp_get_io_fd(fsp)); - } - } - return 0; + DEBUG(module_debug, + ("%s: flushing %zu dirty bytes\n", + MODULE, c->dbytes)); + + return commit_do(c, fsp_get_io_fd(fsp)); } static int commit(