Skip to content

Commit f4e5168

Browse files
committed
git_open_noatime(): drop unused parameter
Since commit c793430 (Limit file descriptors used by packs, 2011-02-28), the extra parameter added in f2e872a (Work around EMFILE when there are too many pack files, 2010-11-01) is not used anymore. Remove it. Signed-off-by: Junio C Hamano <[email protected]> Acked-by: Shawn O. Pearce <[email protected]>
1 parent ccf5ace commit f4e5168

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

sha1_file.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ static inline uintmax_t sz_fmt(size_t s) { return s; }
3131

3232
const unsigned char null_sha1[20];
3333

34-
static int git_open_noatime(const char *name, struct packed_git *p);
35-
3634
/*
3735
* This is meant to hold a *small* number of objects that you would
3836
* want read_sha1_file() to be able to return, but yet you do not want
@@ -227,6 +225,7 @@ struct alternate_object_database *alt_odb_list;
227225
static struct alternate_object_database **alt_odb_tail;
228226

229227
static void read_info_alternates(const char * alternates, int depth);
228+
static int git_open_noatime(const char *name);
230229

231230
/*
232231
* Prepare alternate object database registry.
@@ -360,7 +359,7 @@ static void read_info_alternates(const char * relative_base, int depth)
360359
int fd;
361360

362361
sprintf(path, "%s/%s", relative_base, alt_file_name);
363-
fd = git_open_noatime(path, NULL);
362+
fd = git_open_noatime(path);
364363
if (fd < 0)
365364
return;
366365
if (fstat(fd, &st) || (st.st_size == 0)) {
@@ -475,7 +474,7 @@ static int check_packed_git_idx(const char *path, struct packed_git *p)
475474
struct pack_idx_header *hdr;
476475
size_t idx_size;
477476
uint32_t version, nr, i, *index;
478-
int fd = git_open_noatime(path, p);
477+
int fd = git_open_noatime(path);
479478
struct stat st;
480479

481480
if (fd < 0)
@@ -757,7 +756,7 @@ static int open_packed_git_1(struct packed_git *p)
757756
while (pack_max_fds <= pack_open_fds && unuse_one_window(NULL, -1))
758757
; /* nothing */
759758

760-
p->pack_fd = git_open_noatime(p->pack_name, p);
759+
p->pack_fd = git_open_noatime(p->pack_name);
761760
if (p->pack_fd < 0 || fstat(p->pack_fd, &st))
762761
return -1;
763762
pack_open_fds++;
@@ -1145,7 +1144,7 @@ int check_sha1_signature(const unsigned char *sha1, void *map, unsigned long siz
11451144
return hashcmp(sha1, real_sha1) ? -1 : 0;
11461145
}
11471146

1148-
static int git_open_noatime(const char *name, struct packed_git *p)
1147+
static int git_open_noatime(const char *name)
11491148
{
11501149
static int sha1_file_open_flag = O_NOATIME;
11511150

@@ -1170,7 +1169,7 @@ static int open_sha1_file(const unsigned char *sha1)
11701169
char *name = sha1_file_name(sha1);
11711170
struct alternate_object_database *alt;
11721171

1173-
fd = git_open_noatime(name, NULL);
1172+
fd = git_open_noatime(name);
11741173
if (fd >= 0)
11751174
return fd;
11761175

@@ -1179,7 +1178,7 @@ static int open_sha1_file(const unsigned char *sha1)
11791178
for (alt = alt_odb_list; alt; alt = alt->next) {
11801179
name = alt->name;
11811180
fill_sha1_path(name, sha1);
1182-
fd = git_open_noatime(alt->base, NULL);
1181+
fd = git_open_noatime(alt->base);
11831182
if (fd >= 0)
11841183
return fd;
11851184
}

0 commit comments

Comments
 (0)