{"thread":{"id":"27363","subject":"[PATCH] git_open_noatime(): drop unused parameter","startedAt":"2011-05-15T19:16:29Z","lastAt":"2011-05-15T19:21:01Z","messageCount":2,"participants":["Junio C Hamano","Shawn Pearce"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"167905","messageId":"7voc33pyeq.fsf@alter.siamese.dyndns.org","threadId":"27363","inReplyTo":null,"subject":"[PATCH] git_open_noatime(): drop unused parameter","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-05-15T19:16:29Z","receivedAt":"2011-05-15T19:16:29Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Since commit c793430 (Limit file descriptors used by packs, 2011-02-28),\nthe extra parameter added in f2e872aa (Work around EMFILE when there are\ntoo many pack files, 2010-11-01) is not used anymore.\n\nRemove it.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n sha1_file.c |   15 +++++++--------\n 1 files changed, 7 insertions(+), 8 deletions(-)\n\ndiff --git a/sha1_file.c b/sha1_file.c\nindex ee06d99..1a7e410 100644\n--- a/sha1_file.c\n+++ b/sha1_file.c\n@@ -31,8 +31,6 @@ static inline uintmax_t sz_fmt(size_t s) { return s; }\n \n const unsigned char null_sha1[20];\n \n-static int git_open_noatime(const char *name, struct packed_git *p);\n-\n /*\n  * This is meant to hold a *small* number of objects that you would\n  * want read_sha1_file() to be able to return, but yet you do not want\n@@ -227,6 +225,7 @@ struct alternate_object_database *alt_odb_list;\n static struct alternate_object_database **alt_odb_tail;\n \n static void read_info_alternates(const char * alternates, int depth);\n+static int git_open_noatime(const char *name);\n \n /*\n  * Prepare alternate object database registry.\n@@ -360,7 +359,7 @@ static void read_info_alternates(const char * relative_base, int depth)\n \tint fd;\n \n \tsprintf(path, \"%s/%s\", relative_base, alt_file_name);\n-\tfd = git_open_noatime(path, NULL);\n+\tfd = git_open_noatime(path);\n \tif (fd < 0)\n \t\treturn;\n \tif (fstat(fd, &st) || (st.st_size == 0)) {\n@@ -475,7 +474,7 @@ static int check_packed_git_idx(const char *path,  struct packed_git *p)\n \tstruct pack_idx_header *hdr;\n \tsize_t idx_size;\n \tuint32_t version, nr, i, *index;\n-\tint fd = git_open_noatime(path, p);\n+\tint fd = git_open_noatime(path);\n \tstruct stat st;\n \n \tif (fd < 0)\n@@ -757,7 +756,7 @@ static int open_packed_git_1(struct packed_git *p)\n \twhile (pack_max_fds <= pack_open_fds && unuse_one_window(NULL, -1))\n \t\t; /* nothing */\n \n-\tp->pack_fd = git_open_noatime(p->pack_name, p);\n+\tp->pack_fd = git_open_noatime(p->pack_name);\n \tif (p->pack_fd < 0 || fstat(p->pack_fd, &st))\n \t\treturn -1;\n \tpack_open_fds++;\n@@ -1145,7 +1144,7 @@ int check_sha1_signature(const unsigned char *sha1, void *map, unsigned long siz\n \treturn hashcmp(sha1, real_sha1) ? -1 : 0;\n }\n \n-static int git_open_noatime(const char *name, struct packed_git *p)\n+static int git_open_noatime(const char *name)\n {\n \tstatic int sha1_file_open_flag = O_NOATIME;\n \n@@ -1170,7 +1169,7 @@ static int open_sha1_file(const unsigned char *sha1)\n \tchar *name = sha1_file_name(sha1);\n \tstruct alternate_object_database *alt;\n \n-\tfd = git_open_noatime(name, NULL);\n+\tfd = git_open_noatime(name);\n \tif (fd >= 0)\n \t\treturn fd;\n \n@@ -1179,7 +1178,7 @@ static int open_sha1_file(const unsigned char *sha1)\n \tfor (alt = alt_odb_list; alt; alt = alt->next) {\n \t\tname = alt->name;\n \t\tfill_sha1_path(name, sha1);\n-\t\tfd = git_open_noatime(alt->base, NULL);\n+\t\tfd = git_open_noatime(alt->base);\n \t\tif (fd >= 0)\n \t\t\treturn fd;\n \t}\n-- \n1.7.5.1.334.gdfd07\n"},{"id":"167906","messageId":"BANLkTikWPzje0oXPqSRAtpWZ2g6vn5NyVQ@mail.gmail.com","threadId":"27363","inReplyTo":"7voc33pyeq.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] git_open_noatime(): drop unused parameter","fromName":"Shawn Pearce","fromEmail":"spearce@spearce.org","sentAt":"2011-05-15T19:21:01Z","receivedAt":"2011-05-15T19:21:01Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"On Sun, May 15, 2011 at 12:16, Junio C Hamano <gitster@pobox.com> wrote:\n> Since commit c793430 (Limit file descriptors used by packs, 2011-02-28),\n> the extra parameter added in f2e872aa (Work around EMFILE when there are\n> too many pack files, 2010-11-01) is not used anymore.\n>\n> Remove it.\n>\n> Signed-off-by: Junio C Hamano <gitster@pobox.com>\n\nThanks for cleaning this up.\n\nAcked-by: Shawn O. Pearce <spearce@spearce.org>\n\n-- \nShawn.\n"}]}