Use *at() functions for native filesystem commits

This is just an efficiency optimization.  We're getting fairly close
to all of the hot code paths using `*at()`.

Note that we end up maintaining a half-duplicate code path set here,
because we still need to support commits from an arbitrary GFile *,
which in a possible common case is an OSTree commit.

I think it's worth it though.
This commit is contained in:
Colin Walters committed 2015-01-06 22:43:14 -05:00
1 parent cf8d6848b3
commit 026c5c60d3
4 files changed
+250 -34

No files matched your search

+3 -13
View File
@@ -1810,19 +1810,9 @@ query_info_for_bare_content_object (OstreeRepo *self,
}
else if (S_ISLNK (stbuf.st_mode))
{
char targetbuf[PATH_MAX+1];
ssize_t len;
do
len = readlinkat (self->objects_dir_fd, loose_path_buf, targetbuf, sizeof (targetbuf) - 1);
while (G_UNLIKELY (len == -1 && errno == EINTR));
if (len == -1)
{
gs_set_error_from_errno (error, errno);
goto out;
}
targetbuf[len] = '\0';
g_file_info_set_symlink_target (ret_info, targetbuf);
if (!ot_readlinkat_gfile_info (self->objects_dir_fd, loose_path_buf,
ret_info, cancellable, error))
goto out;
}
else
{