sha1_file: rename git_open_noatime() to git_open()
This function is meant to be used when reading from files in the object store, and the original objective was to avoid smudging atime of loose object files too often, hence its name. Because we'll be extending its role in the next commit to also arrange the file descriptors they return auto-closed in the child processes, rename it to lose "noatime" part that is too specific. Signed-off-by: Lars Schneider <larsxschneider@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Lars Schneider committed
Oct 24, 2016 at 20:02 UTC
a5436b57941d99302a4cf68373da6288c11f0340
4 files changed
+9
-9
builtin/pack-objects.c
+1
-1
@@ -720,7 +720,7 @@ static off_t write_reused_pack(struct sha1file *f)
720
if (!is_pack_valid(reuse_packfile))
721
die("packfile is invalid: %s", reuse_packfile->pack_name);
722
723
- fd = git_open_noatime(reuse_packfile->pack_name);
723
+ fd = git_open(reuse_packfile->pack_name);
724
if (fd < 0)
725
die_errno("unable to open packfile for reuse: %s",
726
reuse_packfile->pack_name);
cache.h
+1
-1
@@ -1122,7 +1122,7 @@ extern int write_sha1_file(const void *buf, unsigned long len, const char *type,
1122
extern int hash_sha1_file_literally(const void *buf, unsigned long len, const char *type, unsigned char *sha1, unsigned flags);
1123
extern int pretend_sha1_file(void *, unsigned long, enum object_type, unsigned char *);
1124
extern int force_object_loose(const unsigned char *sha1, time_t mtime);
1125
-extern int git_open_noatime(const char *name);
1125
+extern int git_open(const char *name);
1126
extern void *map_sha1_file(const unsigned char *sha1, unsigned long *size);
1127
extern int unpack_sha1_header(git_zstream *stream, unsigned char *map, unsigned long mapsize, void *buffer, unsigned long bufsiz);
1128
extern int parse_sha1_header(const char *hdr, unsigned long *sizep);
pack-bitmap.c
+1
-1
@@ -266,7 +266,7 @@ static int open_pack_bitmap_1(struct packed_git *packfile)
266
return -1;
267
268
idx_name = pack_bitmap_filename(packfile);
269
- fd = git_open_noatime(idx_name);
269
+ fd = git_open(idx_name);
270
free(idx_name);
271
272
if (fd < 0)
sha1_file.c
+6
-6
@@ -370,7 +370,7 @@ void read_info_alternates(const char * relative_base, int depth)
370
int fd;
371
372
path = xstrfmt("%s/info/alternates", relative_base);
373
- fd = git_open_noatime(path);
373
+ fd = git_open(path);
374
free(path);
375
if (fd < 0)
376
return;
@@ -663,7 +663,7 @@ static int check_packed_git_idx(const char *path, struct packed_git *p)
663
struct pack_idx_header *hdr;
664
size_t idx_size;
665
uint32_t version, nr, i, *index;
666
- int fd = git_open_noatime(path);
666
+ int fd = git_open(path);
667
struct stat st;
668
669
if (fd < 0)
@@ -1069,7 +1069,7 @@ static int open_packed_git_1(struct packed_git *p)
1069
while (pack_max_fds <= pack_open_fds && close_one_pack())
1070
; /* nothing */
1071
1072
- p->pack_fd = git_open_noatime(p->pack_name);
1072
+ p->pack_fd = git_open(p->pack_name);
1073
if (p->pack_fd < 0 || fstat(p->pack_fd, &st))
1074
return -1;
1075
pack_open_fds++;
@@ -1559,7 +1559,7 @@ int check_sha1_signature(const unsigned char *sha1, void *map,
1559
return hashcmp(sha1, real_sha1) ? -1 : 0;
1560
}
1561
1562
-int git_open_noatime(const char *name)
1562
+int git_open(const char *name)
1563
{
1564
static int sha1_file_open_flag = O_NOATIME;
1565
@@ -1605,7 +1605,7 @@ static int open_sha1_file(const unsigned char *sha1)
1605
struct alternate_object_database *alt;
1606
int most_interesting_errno;
1607
1608
- fd = git_open_noatime(sha1_file_name(sha1));
1608
+ fd = git_open(sha1_file_name(sha1));
1609
if (fd >= 0)
1610
return fd;
1611
most_interesting_errno = errno;
@@ -1613,7 +1613,7 @@ static int open_sha1_file(const unsigned char *sha1)
1613
prepare_alt_odb();
1614
for (alt = alt_odb_list; alt; alt = alt->next) {
1615
const char *path = alt_sha1_path(alt, sha1);
1616
- fd = git_open_noatime(path);
1616
+ fd = git_open(path);
1617
if (fd >= 0)
1618
return fd;
1619
if (most_interesting_errno == ENOENT)