All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arvind Raghavan <raghavan.arvind@gmail.com>
To: fstests <fstests@vger.kernel.org>
Cc: Amir Goldstein <amir73il@gmail.com>,
	Jayashree Mohan <jaya@cs.utexas.edu>,
	Vijay Chidambaram <vijay@cs.utexas.edu>,
	Arvind Raghavan <raghavan.arvind@gmail.com>
Subject: [PATCH v2 1/7] src/fssum: Make sum_file_data global
Date: Sun, 21 Jun 2020 19:15:16 -0400	[thread overview]
Message-ID: <5611ae66baaf35f24090bb7441cd90c5e17727db.1592779555.git.raghavan.arvind@gmail.com> (raw)
In-Reply-To: <cover.1592779555.git.raghavan.arvind@gmail.com>

Makes deciding which function to use for summing file data happen once
in main instead of for each file.

Signed-off-by: Arvind Raghavan <raghavan.arvind@gmail.com>
Signed-off-by: Jayashree Mohan <jaya@cs.utexas.edu>
Signed-off-by: Vijay Chidambaram <vijay@cs.utexas.edu>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
---
 src/fssum.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/fssum.c b/src/fssum.c
index 3d97a70b..30f456c2 100644
--- a/src/fssum.c
+++ b/src/fssum.c
@@ -62,6 +62,7 @@ int n_excludes = 0;
 int verbose = 0;
 FILE *out_fp;
 FILE *in_fp;
+sum_file_data_t sum_file_data;
 
 enum _flags {
 	FLAG_UID,
@@ -514,8 +515,6 @@ sum(int dirfd, int level, sum_t *dircs, char *path_prefix, char *path_in)
 	int ret;
 	int fd;
 	int excl;
-	sum_file_data_t sum_file_data = flags[FLAG_STRUCTURE] ?
-			sum_file_data_strict : sum_file_data_permissive;
 	struct stat64 dir_st;
 
 	if (fstat64(dirfd, &dir_st)) {
@@ -824,6 +823,9 @@ main(int argc, char *argv[])
 			flagstring[i] -= 'a' - 'A';
 	}
 
+	sum_file_data = flags[FLAG_STRUCTURE] ?
+			sum_file_data_strict : sum_file_data_permissive;
+
 	path = argv[optind];
 	plen = strlen(path);
 	if (path[plen - 1] == '/') {
-- 
2.20.1


  reply	other threads:[~2020-06-21 23:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-21 23:14 [PATCH v2 0/7] Change fssum to support POSIX Arvind Raghavan
2020-06-21 23:15 ` Arvind Raghavan [this message]
2020-06-21 23:15 ` [PATCH v2 2/7] src/fssum: Refactoring changes for recursive traversal Arvind Raghavan
2020-06-22  6:47   ` Amir Goldstein
2020-06-21 23:16 ` [PATCH v2 3/7] src/fssum: Recursive traversal refactoring Arvind Raghavan
2020-06-22  7:42   ` Amir Goldstein
2020-06-21 23:16 ` [PATCH v2 4/7] src/fssum: Add flag -R for non-recursive mode Arvind Raghavan
2020-06-21 23:16 ` [PATCH v2 5/7] src/fssum: Add a flag for including file size in checksum Arvind Raghavan
2020-06-21 23:16 ` [PATCH v2 6/7] src/fssum: Allow single file input Arvind Raghavan
2020-06-22  6:56   ` Amir Goldstein
2020-06-21 23:17 ` [PATCH v2 7/7] src/fssum: Fix whitespace in usage Arvind Raghavan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5611ae66baaf35f24090bb7441cd90c5e17727db.1592779555.git.raghavan.arvind@gmail.com \
    --to=raghavan.arvind@gmail.com \
    --cc=amir73il@gmail.com \
    --cc=fstests@vger.kernel.org \
    --cc=jaya@cs.utexas.edu \
    --cc=vijay@cs.utexas.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.