Changeset 3137


Ignore:
Timestamp:
Jun 13, 2013, 6:37:19 AM (6 years ago)
Author:
bruno
Message:

r5336@localhost: bruno | 2013-06-12 15:37:29 +0200

  • Change the calculation of the big size limit for a file by using the number of 512 blocks instead of the size returned by stat, thus allowing to consider some sparse file as not biggie file and such handling them through afio/star instead of fread/fwrite which makes them non sparse anymore.
Location:
branches/3.0/mondo/src/common
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/3.0/mondo/src/common/libmondo-filelist.c

    r3129 r3137  
    198198/*@ long ****************************************/
    199199    long lino = 0;
    200     long max_sane_size_for_a_file;
     200    // A big file has more than 64 MB of real content
     201    long max_sane_size_for_a_file = 64L * 1024L;
    201202    long curr_set_size;
    202203    long noof_lines;
     
    226227    assert_string_is_neither_NULL_nor_zerolength(outdir);
    227228    assert(maxsetsizeK > 0);
    228 
    229     max_sane_size_for_a_file = 64L * 1024L;
    230 // max_sane_size_for_a_file = maxsetsizeK*2;
    231 //  if (max_sane_size_for_a_file > 32*1024)
    232 //    { max_sane_size_for_a_file = 32*1024; }
    233229
    234230    log_it("filelist=%s;", filelist);
     
    274270            siz = 0;
    275271        } else {
    276             siz = (long) (buf.st_size >> 10);
     272            // blocks are 512 bytes long - cf man 2 stat - Pass to the next unit (kB => MB e.g.)
     273            // use blocks instead of size to allow sparse file correct handling as much as possible
     274            siz = (long) ((buf.st_blocks*512) >> 10);
    277275        }
    278276        if (siz > max_sane_size_for_a_file) {
  • branches/3.0/mondo/src/common/mondostructures.h

    r2769 r3137  
    192192 * A type of file in the catalog of recent archives.
    193193 */
    194 typedef enum { other,           ///< Some other kind of file.
     194typedef enum {
     195    other,                      ///< Some other kind of file.
    195196    fileset,                    ///< An afioball (fileset), optionally compressed.
    196197    biggieslice                 ///< A slice of a biggiefile, optionally compressed.
     
    202203typedef enum {
    203204    nuke = 0,                   /// Nuke mode
    204     interactive,                /// Interactive mode
     205    interactive,                    /// Interactive mode
    205206    compare,                    /// Compare mode
    206207    mbr,                        /// MBR mode
Note: See TracChangeset for help on using the changeset viewer.