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 2013/07/29 13:31:26 UTC
svn commit: r1508001 - in /subversion/branches/fsx: ./
subversion/include/private/svn_subr_private.h
subversion/libsvn_fs_base/lock.c subversion/libsvn_subr/spillbuf.c
subversion/libsvn_subr/stream.c subversion/tests/libsvn_subr/spillbuf-test.c
Author: stefan2
Date: Mon Jul 29 11:31:25 2013
New Revision: 1508001
URL: http://svn.apache.org/r1508001
Log:
On the fsx branch: Merge the svn_stream__from_spillbuf API change (r1430673)
from /branches/fsfs-format7. Fixed libsvn_fs_base/lock.c to make it compile.
Modified:
subversion/branches/fsx/ (props changed)
subversion/branches/fsx/subversion/include/private/svn_subr_private.h
subversion/branches/fsx/subversion/libsvn_fs_base/lock.c
subversion/branches/fsx/subversion/libsvn_subr/spillbuf.c
subversion/branches/fsx/subversion/libsvn_subr/stream.c
subversion/branches/fsx/subversion/tests/libsvn_subr/spillbuf-test.c
Propchange: subversion/branches/fsx/
------------------------------------------------------------------------------
Merged /subversion/branches/fsfs-format7:r1430673
Modified: subversion/branches/fsx/subversion/include/private/svn_subr_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsx/subversion/include/private/svn_subr_private.h?rev=1508001&r1=1508000&r2=1508001&view=diff
==============================================================================
--- subversion/branches/fsx/subversion/include/private/svn_subr_private.h (original)
+++ subversion/branches/fsx/subversion/include/private/svn_subr_private.h Mon Jul 29 11:31:25 2013
@@ -195,8 +195,7 @@ svn_spillbuf__reader_write(svn_spillbuf_
but implements the same basic sematics of a spillbuf for the underlying
storage. */
svn_stream_t *
-svn_stream__from_spillbuf(apr_size_t blocksize,
- apr_size_t maxsize,
+svn_stream__from_spillbuf(svn_spillbuf_t *buf,
apr_pool_t *result_pool);
/** @} */
Modified: subversion/branches/fsx/subversion/libsvn_fs_base/lock.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsx/subversion/libsvn_fs_base/lock.c?rev=1508001&r1=1508000&r2=1508001&view=diff
==============================================================================
--- subversion/branches/fsx/subversion/libsvn_fs_base/lock.c (original)
+++ subversion/branches/fsx/subversion/libsvn_fs_base/lock.c Mon Jul 29 11:31:25 2013
@@ -465,8 +465,9 @@ svn_fs_base__get_locks(svn_fs_t *fs,
args.path = svn_fs__canonicalize_abspath(path, pool);
args.depth = depth;
/* Enough for 100+ locks if the comments are small. */
- args.stream = svn_stream__from_spillbuf(4 * 1024 /* blocksize */,
- 64 * 1024 /* maxsize */,
+ args.stream = svn_stream__from_spillbuf(svn_spillbuf__create(4 * 1024 /* blocksize */,
+ 64 * 1024 /* maxsize */,
+ pool),
pool);
SVN_ERR(svn_fs_base__retry_txn(fs, txn_body_get_locks, &args, FALSE, pool));
Modified: subversion/branches/fsx/subversion/libsvn_subr/spillbuf.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsx/subversion/libsvn_subr/spillbuf.c?rev=1508001&r1=1508000&r2=1508001&view=diff
==============================================================================
--- subversion/branches/fsx/subversion/libsvn_subr/spillbuf.c (original)
+++ subversion/branches/fsx/subversion/libsvn_subr/spillbuf.c Mon Jul 29 11:31:25 2013
@@ -78,7 +78,7 @@ struct svn_spillbuf_t {
struct svn_spillbuf_reader_t {
/* Embed the spill-buffer within the reader. */
- struct svn_spillbuf_t buf;
+ struct svn_spillbuf_t *buf;
/* When we read content from the underlying spillbuf, these fields store
the ptr/len pair. The ptr will be incremented as we "read" out of this
@@ -440,11 +440,7 @@ svn_spillbuf__reader_create(apr_size_t b
apr_pool_t *result_pool)
{
svn_spillbuf_reader_t *sbr = apr_pcalloc(result_pool, sizeof(*sbr));
-
- /* See svn_spillbuf__create() */
- sbr->buf.pool = result_pool;
- sbr->buf.blocksize = blocksize;
- sbr->buf.maxsize = maxsize;
+ sbr->buf = svn_spillbuf__create(blocksize, maxsize, result_pool);
return sbr;
}
@@ -488,7 +484,7 @@ svn_spillbuf__reader_read(apr_size_t *am
if (reader->sb_len == 0)
{
SVN_ERR(svn_spillbuf__read(&reader->sb_ptr, &reader->sb_len,
- &reader->buf,
+ reader->buf,
scratch_pool));
/* We've run out of content, so return with whatever has
@@ -547,7 +543,8 @@ svn_spillbuf__reader_write(svn_spillbuf_
if (reader->sb_len > 0)
{
if (reader->save_ptr == NULL)
- reader->save_ptr = apr_palloc(reader->buf.pool, reader->buf.blocksize);
+ reader->save_ptr = apr_palloc(reader->buf->pool,
+ reader->buf->blocksize);
memcpy(reader->save_ptr, reader->sb_ptr, reader->sb_len);
reader->save_len = reader->sb_len;
@@ -557,7 +554,7 @@ svn_spillbuf__reader_write(svn_spillbuf_
reader->sb_len = 0;
}
- return svn_error_trace(svn_spillbuf__write(&reader->buf, data, len,
+ return svn_error_trace(svn_spillbuf__write(reader->buf, data, len,
scratch_pool));
}
@@ -596,14 +593,14 @@ write_handler_spillbuf(void *baton, cons
svn_stream_t *
-svn_stream__from_spillbuf(apr_size_t blocksize,
- apr_size_t maxsize,
+svn_stream__from_spillbuf(svn_spillbuf_t *buf,
apr_pool_t *result_pool)
{
svn_stream_t *stream;
struct spillbuf_baton *sb = apr_palloc(result_pool, sizeof(*sb));
- sb->reader = svn_spillbuf__reader_create(blocksize, maxsize, result_pool);
+ sb->reader = apr_pcalloc(result_pool, sizeof(*sb->reader));
+ sb->reader->buf = buf;
sb->scratch_pool = svn_pool_create(result_pool);
stream = svn_stream_create(sb, result_pool);
Modified: subversion/branches/fsx/subversion/libsvn_subr/stream.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsx/subversion/libsvn_subr/stream.c?rev=1508001&r1=1508000&r2=1508001&view=diff
==============================================================================
--- subversion/branches/fsx/subversion/libsvn_subr/stream.c (original)
+++ subversion/branches/fsx/subversion/libsvn_subr/stream.c Mon Jul 29 11:31:25 2013
@@ -1657,7 +1657,7 @@ svn_string_from_stream(svn_string_t **re
}
-/* These are somewhat arbirary, if we ever get good empirical data as to
+/* These are somewhat arbitrary, if we ever get good empirical data as to
actually valid values, feel free to update them. */
#define BUFFER_BLOCK_SIZE 1024
#define BUFFER_MAX_SIZE 100000
@@ -1665,7 +1665,9 @@ svn_string_from_stream(svn_string_t **re
svn_stream_t *
svn_stream_buffered(apr_pool_t *result_pool)
{
- return svn_stream__from_spillbuf(BUFFER_BLOCK_SIZE, BUFFER_MAX_SIZE,
+ return svn_stream__from_spillbuf(svn_spillbuf__create(BUFFER_BLOCK_SIZE,
+ BUFFER_MAX_SIZE,
+ result_pool),
result_pool);
}
Modified: subversion/branches/fsx/subversion/tests/libsvn_subr/spillbuf-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsx/subversion/tests/libsvn_subr/spillbuf-test.c?rev=1508001&r1=1508000&r2=1508001&view=diff
==============================================================================
--- subversion/branches/fsx/subversion/tests/libsvn_subr/spillbuf-test.c (original)
+++ subversion/branches/fsx/subversion/tests/libsvn_subr/spillbuf-test.c Mon Jul 29 11:31:25 2013
@@ -274,9 +274,10 @@ test_spillbuf_reader(apr_pool_t *pool)
static svn_error_t *
test_spillbuf_stream(apr_pool_t *pool)
{
- svn_stream_t *stream = svn_stream__from_spillbuf(8 /* blocksize */,
- 15 /* maxsize */,
- pool);
+ svn_spillbuf_t *buf = svn_spillbuf__create(8 /* blocksize */,
+ 15 /* maxsize */,
+ pool);
+ svn_stream_t *stream = svn_stream__from_spillbuf(buf, pool);
char readbuf[256];
apr_size_t readlen;
apr_size_t writelen;