core: use open(..., O_NOATIME) for reading loose objects

More efficient, and atime shouldn't matter for these.
This commit is contained in:
Colin Walters 2012-09-24 07:36:42 -04:00
parent 7aa620109e
commit 26e487bacf
2 changed files with 4 additions and 4 deletions

View File

@ -516,7 +516,7 @@ ostree_content_file_parse (GFile *content_path,
ot_lobj GFileInfo *ret_file_info = NULL; ot_lobj GFileInfo *ret_file_info = NULL;
ot_lvariant GVariant *ret_xattrs = NULL; ot_lvariant GVariant *ret_xattrs = NULL;
file_input = (GInputStream*)g_file_read (content_path, cancellable, error); file_input = (GInputStream*)gs_file_read_noatime (content_path, cancellable, error);
if (!file_input) if (!file_input)
goto out; goto out;

View File

@ -2576,7 +2576,7 @@ ostree_repo_load_file (OstreeRepo *self,
if (out_input) if (out_input)
{ {
ret_input = (GInputStream*)g_file_read (archive_content_path, cancellable, error); ret_input = (GInputStream*)gs_file_read_noatime (archive_content_path, cancellable, error);
if (!ret_input) if (!ret_input)
goto out; goto out;
} }
@ -2590,7 +2590,7 @@ ostree_repo_load_file (OstreeRepo *self,
ot_lobj GInputStream *uncomp_input = NULL; ot_lobj GInputStream *uncomp_input = NULL;
guint64 uncompressed_len; guint64 uncompressed_len;
file_in = (GInputStream*)g_file_read (loose_path, cancellable, error); file_in = (GInputStream*)gs_file_read_noatime (loose_path, cancellable, error);
if (!file_in) if (!file_in)
goto out; goto out;
@ -2621,7 +2621,7 @@ ostree_repo_load_file (OstreeRepo *self,
if (out_input && g_file_info_get_file_type (ret_file_info) == G_FILE_TYPE_REGULAR) if (out_input && g_file_info_get_file_type (ret_file_info) == G_FILE_TYPE_REGULAR)
{ {
ret_input = (GInputStream*) g_file_read (loose_path, cancellable, error); ret_input = (GInputStream*) gs_file_read_noatime (loose_path, cancellable, error);
if (!ret_input) if (!ret_input)
{ {
g_prefix_error (error, "Error opening loose file object %s: ", ot_gfile_get_path_cached (loose_path)); g_prefix_error (error, "Error opening loose file object %s: ", ot_gfile_get_path_cached (loose_path));