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/02/05 10:37:03 UTC

svn commit: r1442518 - in /subversion/branches/fsfs-format7/subversion/libsvn_fs_fs: low_level.c low_level.h

Author: stefan2
Date: Tue Feb  5 09:37:02 2013
New Revision: 1442518

URL: http://svn.apache.org/viewvc?rev=1442518&view=rev
Log:
On the fsfs-format7 branch: extend the representation header
data structure to contain the offset between representation start
and actual begin of the plain or deltified data (= header size).

* subversion/libsvn_fs_fs/low_level.h
  (svn_fs_fs__rep_header_t): add header_size member

* subversion/libsvn_fs_fs/low_level.c
  (svn_fs_fs__read_rep_header): set the new member as well

Modified:
    subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/low_level.c
    subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/low_level.h

Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/low_level.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/low_level.c?rev=1442518&r1=1442517&r2=1442518&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/low_level.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/low_level.c Tue Feb  5 09:37:02 2013
@@ -638,6 +638,7 @@ svn_fs_fs__read_rep_header(svn_fs_fs__re
   SVN_ERR(svn_stream_readline(stream, &buffer, "\n", &eol, pool));
 
   *header = apr_pcalloc(pool, sizeof(**header));
+  (*header)->header_size = buffer->len + 1;
   if (strcmp(buffer->data, REP_PLAIN) == 0)
     return SVN_NO_ERROR;
 

Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/low_level.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/low_level.h?rev=1442518&r1=1442517&r2=1442518&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/low_level.h (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/low_level.h Tue Feb  5 09:37:02 2013
@@ -113,6 +113,11 @@ typedef struct svn_fs_fs__rep_header_t
   /* if this rep is a delta against some other rep, this is the (deltified)
    * size of that base rep.  Should be 0 if there is no base rep. */
   svn_filesize_t base_length;
+
+  /* length of the textual representation of the header in the rep or pack
+   * file, including EOL.  Only valid after reading it from disk.
+   * Should be 0 otherwise. */
+  apr_size_t header_size;
 } svn_fs_fs__rep_header_t;
 
 /* Read the next line from file FILE and parse it as a text



Re: svn commit: r1442518 - in /subversion/branches/fsfs-format7/subversion/libsvn_fs_fs: low_level.c low_level.h

Posted by Branko Čibej <br...@wandisco.com>.
On 05.02.2013 12:55, Ivan Zhakov wrote:
> On Tue, Feb 5, 2013 at 3:41 PM, Bert Huijben <be...@qqmail.nl> wrote:
>>
>>> -----Original Message-----
>>> From: stefan2@apache.org [mailto:stefan2@apache.org]
>>> Sent: dinsdag 5 februari 2013 10:37
>>> To: commits@subversion.apache.org
>>> Subject: svn commit: r1442518 - in /subversion/branches/fsfs-
>>> format7/subversion/libsvn_fs_fs: low_level.c low_level.h
>>>
>>> Author: stefan2
>>> Date: Tue Feb  5 09:37:02 2013
>>> New Revision: 1442518
>>>
>>> URL: http://svn.apache.org/viewvc?rev=1442518&view=rev
>>> Log:
>>> On the fsfs-format7 branch: extend the representation header
>>> data structure to contain the offset between representation start
>>> and actual begin of the plain or deltified data (= header size).
>>> Modified: subversion/branches/fsfs-
>>> format7/subversion/libsvn_fs_fs/low_level.h
>>> URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-
>>> format7/subversion/libsvn_fs_fs/low_level.h?rev=1442518&r1=1442517&r2
>>> =1442518&view=diff
>>> ==========================================================
>>> ====================
>>> --- subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/low_level.h
>>> (original)
>>> +++ subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/low_level.h
>>> Tue Feb  5 09:37:02 2013
>>> @@ -113,6 +113,11 @@ typedef struct svn_fs_fs__rep_header_t
>>>    /* if this rep is a delta against some other rep, this is the (deltified)
>>>     * size of that base rep.  Should be 0 if there is no base rep. */
>>>    svn_filesize_t base_length;
>>> +
>>> +  /* length of the textual representation of the header in the rep or pack
>>> +   * file, including EOL.  Only valid after reading it from disk.
>>> +   * Should be 0 otherwise. */
>>> +  apr_size_t header_size;
>>>  } svn_fs_fs__rep_header_t;
>> Are you sure you want an architecture dependent size in this struct?
>>
>> I would expect an explicit 32 or  64 bit int here.
>>
> +1!

Why is that a problem? The structure can't be written directly to disk
in any case.

-- Brane

-- 
Branko Čibej
Director of Subversion | WANdisco | www.wandisco.com


Re: svn commit: r1442518 - in /subversion/branches/fsfs-format7/subversion/libsvn_fs_fs: low_level.c low_level.h

Posted by Ivan Zhakov <iv...@visualsvn.com>.
On Tue, Feb 5, 2013 at 3:41 PM, Bert Huijben <be...@qqmail.nl> wrote:
>
>
>> -----Original Message-----
>> From: stefan2@apache.org [mailto:stefan2@apache.org]
>> Sent: dinsdag 5 februari 2013 10:37
>> To: commits@subversion.apache.org
>> Subject: svn commit: r1442518 - in /subversion/branches/fsfs-
>> format7/subversion/libsvn_fs_fs: low_level.c low_level.h
>>
>> Author: stefan2
>> Date: Tue Feb  5 09:37:02 2013
>> New Revision: 1442518
>>
>> URL: http://svn.apache.org/viewvc?rev=1442518&view=rev
>> Log:
>> On the fsfs-format7 branch: extend the representation header
>> data structure to contain the offset between representation start
>> and actual begin of the plain or deltified data (= header size).
>
>> Modified: subversion/branches/fsfs-
>> format7/subversion/libsvn_fs_fs/low_level.h
>> URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-
>> format7/subversion/libsvn_fs_fs/low_level.h?rev=1442518&r1=1442517&r2
>> =1442518&view=diff
>> ==========================================================
>> ====================
>> --- subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/low_level.h
>> (original)
>> +++ subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/low_level.h
>> Tue Feb  5 09:37:02 2013
>> @@ -113,6 +113,11 @@ typedef struct svn_fs_fs__rep_header_t
>>    /* if this rep is a delta against some other rep, this is the (deltified)
>>     * size of that base rep.  Should be 0 if there is no base rep. */
>>    svn_filesize_t base_length;
>> +
>> +  /* length of the textual representation of the header in the rep or pack
>> +   * file, including EOL.  Only valid after reading it from disk.
>> +   * Should be 0 otherwise. */
>> +  apr_size_t header_size;
>>  } svn_fs_fs__rep_header_t;
>
> Are you sure you want an architecture dependent size in this struct?
>
> I would expect an explicit 32 or  64 bit int here.
>
+1!

-- 
Ivan Zhakov

Re: svn commit: r1442518 - in /subversion/branches/fsfs-format7/subversion/libsvn_fs_fs: low_level.c low_level.h

Posted by Stefan Fuhrmann <st...@wandisco.com>.
On Tue, Feb 5, 2013 at 12:41 PM, Bert Huijben <be...@qqmail.nl> wrote:

>
>
> > -----Original Message-----
> > From: stefan2@apache.org [mailto:stefan2@apache.org]
> > Sent: dinsdag 5 februari 2013 10:37
> > To: commits@subversion.apache.org
> > Subject: svn commit: r1442518 - in /subversion/branches/fsfs-
> > format7/subversion/libsvn_fs_fs: low_level.c low_level.h
> >
> > Author: stefan2
> > Date: Tue Feb  5 09:37:02 2013
> > New Revision: 1442518
> >
> > URL: http://svn.apache.org/viewvc?rev=1442518&view=rev
> > Log:
> > On the fsfs-format7 branch: extend the representation header
> > data structure to contain the offset between representation start
> > and actual begin of the plain or deltified data (= header size).
>
> > Modified: subversion/branches/fsfs-
> > format7/subversion/libsvn_fs_fs/low_level.h
> > URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-
> > format7/subversion/libsvn_fs_fs/low_level.h?rev=1442518&r1=1442517&r2
> > =1442518&view=diff
> > ==========================================================
> > ====================
> > --- subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/low_level.h
> > (original)
> > +++ subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/low_level.h
> > Tue Feb  5 09:37:02 2013
> > @@ -113,6 +113,11 @@ typedef struct svn_fs_fs__rep_header_t
> >    /* if this rep is a delta against some other rep, this is the
> (deltified)
> >     * size of that base rep.  Should be 0 if there is no base rep. */
> >    svn_filesize_t base_length;
> > +
> > +  /* length of the textual representation of the header in the rep or
> pack
> > +   * file, including EOL.  Only valid after reading it from disk.
> > +   * Should be 0 otherwise. */
> > +  apr_size_t header_size;
> >  } svn_fs_fs__rep_header_t;
>
> Are you sure you want an architecture dependent size in this struct?
>

Yes, at least for now. It is a string length
and only visible within the respective process.

I would expect an explicit 32 or  64 bit int here.
>

The actual value range is 0 .. ~100, so the type
can be changed to whatever fits best with the
usages of this value.

Once the initial work on fsfs-format7 is done,
I will go over to 32 bit windows to detect sign
and size mismatches in the new code. Right
now, I'm developing with all values being 64
bits anyway.

-- Stefan^2.

-- 
Certified & Supported Apache Subversion Downloads:
*

http://www.wandisco.com/subversion/download
*

RE: svn commit: r1442518 - in /subversion/branches/fsfs-format7/subversion/libsvn_fs_fs: low_level.c low_level.h

Posted by Bert Huijben <be...@qqmail.nl>.

> -----Original Message-----
> From: stefan2@apache.org [mailto:stefan2@apache.org]
> Sent: dinsdag 5 februari 2013 10:37
> To: commits@subversion.apache.org
> Subject: svn commit: r1442518 - in /subversion/branches/fsfs-
> format7/subversion/libsvn_fs_fs: low_level.c low_level.h
> 
> Author: stefan2
> Date: Tue Feb  5 09:37:02 2013
> New Revision: 1442518
> 
> URL: http://svn.apache.org/viewvc?rev=1442518&view=rev
> Log:
> On the fsfs-format7 branch: extend the representation header
> data structure to contain the offset between representation start
> and actual begin of the plain or deltified data (= header size).

> Modified: subversion/branches/fsfs-
> format7/subversion/libsvn_fs_fs/low_level.h
> URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-
> format7/subversion/libsvn_fs_fs/low_level.h?rev=1442518&r1=1442517&r2
> =1442518&view=diff
> ==========================================================
> ====================
> --- subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/low_level.h
> (original)
> +++ subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/low_level.h
> Tue Feb  5 09:37:02 2013
> @@ -113,6 +113,11 @@ typedef struct svn_fs_fs__rep_header_t
>    /* if this rep is a delta against some other rep, this is the (deltified)
>     * size of that base rep.  Should be 0 if there is no base rep. */
>    svn_filesize_t base_length;
> +
> +  /* length of the textual representation of the header in the rep or pack
> +   * file, including EOL.  Only valid after reading it from disk.
> +   * Should be 0 otherwise. */
> +  apr_size_t header_size;
>  } svn_fs_fs__rep_header_t;

Are you sure you want an architecture dependent size in this struct?

I would expect an explicit 32 or  64 bit int here.

	Bert