You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2010/08/17 21:44:57 UTC
svn commit: r986465 - in /subversion/branches/performance/subversion:
include/svn_io.h libsvn_diff/diff_file.c libsvn_fs_fs/fs_fs.c
libsvn_repos/reporter.c libsvn_subr/hash.c
Author: stefan2
Date: Tue Aug 17 19:44:56 2010
New Revision: 986465
URL: http://svn.apache.org/viewvc?rev=986465&view=rev
Log:
Deprecate svn_io_file_read_full and replace it with svn_io_file_read_full2
in (hopefully) all places it was used.
* subversion/include/svn_io.h
(svn_io_file_read_full2): move in front of svn_io_file_read_full
(svn_io_file_read_full): deprecate
* subversion/libsvn_diff/diff_file.c
(read_chunk, map_or_read_file): use the newer API
* subversion/libsvn_fs_fs/fs_fs.c
(create_rep_state_body, get_contents, read_handler_recover): dito
* subversion/libsvn_repos/reporter.c
(read_string): dito
* subversion/libsvn_subr/hash.c
(svn_hash_read): dito
Modified:
subversion/branches/performance/subversion/include/svn_io.h
subversion/branches/performance/subversion/libsvn_diff/diff_file.c
subversion/branches/performance/subversion/libsvn_fs_fs/fs_fs.c
subversion/branches/performance/subversion/libsvn_repos/reporter.c
subversion/branches/performance/subversion/libsvn_subr/hash.c
Modified: subversion/branches/performance/subversion/include/svn_io.h
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/include/svn_io.h?rev=986465&r1=986464&r2=986465&view=diff
==============================================================================
--- subversion/branches/performance/subversion/include/svn_io.h (original)
+++ subversion/branches/performance/subversion/include/svn_io.h Tue Aug 17 19:44:56 2010
@@ -1831,27 +1831,31 @@ svn_io_file_read(apr_file_t *file,
apr_pool_t *pool);
-/** Wrapper for apr_file_read_full(). */
-svn_error_t *
-svn_io_file_read_full(apr_file_t *file,
- void *buf,
- apr_size_t nbytes,
- apr_size_t *bytes_read,
- apr_pool_t *pool);
-
-
-/** Wrapper for apr_file_read_full().
+/** Wrapper for apr_file_read_full().
* If eof_is_ok is set, no svn_error_t error object
* will be created upon EOF.
* @since New in 1.7
*/
svn_error_t *
svn_io_file_read_full2(apr_file_t *file,
- void *buf,
- apr_size_t nbytes,
- apr_size_t *bytes_read,
- svn_boolean_t eof_is_ok,
- apr_pool_t *pool);
+ void *buf,
+ apr_size_t nbytes,
+ apr_size_t *bytes_read,
+ svn_boolean_t eof_is_ok,
+ apr_pool_t *pool);
+
+
+/** Wrapper for apr_file_read_full().
+ *
+ * @deprecated Provided for backward compatibility with the 1.6 API
+ */
+SVN_DEPRECATED
+svn_error_t *
+svn_io_file_read_full(apr_file_t *file,
+ void *buf,
+ apr_size_t nbytes,
+ apr_size_t *bytes_read,
+ apr_pool_t *pool);
/** Wrapper for apr_file_seek(). */
Modified: subversion/branches/performance/subversion/libsvn_diff/diff_file.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_diff/diff_file.c?rev=986465&r1=986464&r2=986465&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_diff/diff_file.c (original)
+++ subversion/branches/performance/subversion/libsvn_diff/diff_file.c Tue Aug 17 19:44:56 2010
@@ -130,7 +130,8 @@ read_chunk(apr_file_t *file, const char
* XXX: Check.
*/
SVN_ERR(svn_io_file_seek(file, APR_SET, &offset, pool));
- return svn_io_file_read_full(file, buffer, (apr_size_t) length, NULL, pool);
+ return svn_io_file_read_full2(file, buffer, (apr_size_t) length,
+ NULL, FALSE, pool);
}
@@ -181,8 +182,8 @@ map_or_read_file(apr_file_t **file,
{
*buffer = apr_palloc(pool, (apr_size_t) finfo.size);
- SVN_ERR(svn_io_file_read_full(*file, *buffer, (apr_size_t) finfo.size,
- NULL, pool));
+ SVN_ERR(svn_io_file_read_full2(*file, *buffer, (apr_size_t) finfo.size,
+ NULL, FALSE, pool));
/* Since we have the entire contents of the file we can
* close it now.
Modified: subversion/branches/performance/subversion/libsvn_fs_fs/fs_fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_fs_fs/fs_fs.c?rev=986465&r1=986464&r2=986465&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/branches/performance/subversion/libsvn_fs_fs/fs_fs.c Tue Aug 17 19:44:56 2010
@@ -3023,7 +3023,8 @@ create_rep_state_body(struct rep_state *
return SVN_NO_ERROR;
/* We are dealing with a delta, find out what version. */
- SVN_ERR(svn_io_file_read_full(rs->apr_file, buf, sizeof(buf), NULL, pool));
+ SVN_ERR(svn_io_file_read_full2(rs->apr_file, buf, sizeof(buf),
+ NULL, FALSE, pool));
if (! ((buf[0] == 'S') && (buf[1] == 'V') && (buf[2] == 'N')))
return svn_error_create
(SVN_ERR_FS_CORRUPT, NULL,
@@ -3465,8 +3466,8 @@ get_contents(struct rep_read_baton *rb,
rs = rb->src_state;
if (((apr_off_t) copy_len) > rs->end - rs->off)
copy_len = (apr_size_t) (rs->end - rs->off);
- SVN_ERR(svn_io_file_read_full(rs->apr_file, cur, copy_len, NULL,
- rb->pool));
+ SVN_ERR(svn_io_file_read_full2(rs->apr_file, cur, copy_len, NULL,
+ FALSE, rb->pool));
rs->off += copy_len;
*len = copy_len;
return SVN_NO_ERROR;
@@ -3541,9 +3542,9 @@ get_contents(struct rep_read_baton *rb,
SVN_ERR(svn_io_file_seek(rs->apr_file, APR_SET, &rs->off,
rb->pool));
}
- SVN_ERR(svn_io_file_read_full(rs->apr_file, sbuf,
- lwindow->sview_len,
- NULL, rb->pool));
+ SVN_ERR(svn_io_file_read_full2(rs->apr_file, sbuf,
+ lwindow->sview_len,
+ NULL, FALSE, rb->pool));
rs->off += lwindow->sview_len;
}
else
@@ -6783,8 +6784,8 @@ read_handler_recover(void *baton, char *
bytes_to_read = b->remaining;
b->remaining -= bytes_to_read;
- return svn_io_file_read_full(b->file, buffer, (apr_size_t) bytes_to_read,
- len, b->pool);
+ return svn_io_file_read_full2(b->file, buffer, (apr_size_t) bytes_to_read,
+ len, FALSE, b->pool);
}
/* Part of the recovery procedure. Read the directory noderev at offset
Modified: subversion/branches/performance/subversion/libsvn_repos/reporter.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_repos/reporter.c?rev=986465&r1=986464&r2=986465&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_repos/reporter.c (original)
+++ subversion/branches/performance/subversion/libsvn_repos/reporter.c Tue Aug 17 19:44:56 2010
@@ -204,7 +204,7 @@ read_string(const char **str, apr_file_t
size = (apr_size_t)len;
buf = apr_palloc(pool, size+1);
- SVN_ERR(svn_io_file_read_full(temp, buf, size, NULL, pool));
+ SVN_ERR(svn_io_file_read_full2(temp, buf, size, NULL, FALSE, pool));
buf[len] = 0;
*str = buf;
return SVN_NO_ERROR;
Modified: subversion/branches/performance/subversion/libsvn_subr/hash.c
URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_subr/hash.c?rev=986465&r1=986464&r2=986465&view=diff
==============================================================================
--- subversion/branches/performance/subversion/libsvn_subr/hash.c (original)
+++ subversion/branches/performance/subversion/libsvn_subr/hash.c Tue Aug 17 19:44:56 2010
@@ -349,8 +349,9 @@ svn_hash_read(apr_hash_t *hash,
/* Now read that much into a buffer, + 1 byte for null terminator */
void *keybuf = apr_palloc(pool, keylen + 1);
- SVN_ERR(svn_io_file_read_full(srcfile,
- keybuf, keylen, &num_read, pool));
+ SVN_ERR(svn_io_file_read_full2(srcfile,
+ keybuf, keylen,
+ &num_read, FALSE, pool));
((char *) keybuf)[keylen] = '\0';
/* Suck up extra newline after key data */
@@ -371,9 +372,9 @@ svn_hash_read(apr_hash_t *hash,
/* Again, 1 extra byte for the null termination. */
void *valbuf = apr_palloc(pool, vallen + 1);
- SVN_ERR(svn_io_file_read_full(srcfile,
- valbuf, vallen,
- &num_read, pool));
+ SVN_ERR(svn_io_file_read_full2(srcfile,
+ valbuf, vallen,
+ &num_read, FALSE, pool));
((char *) valbuf)[vallen] = '\0';
/* Suck up extra newline after val data */