Ignore:
Timestamp:
Jun 13, 2013, 6:37:19 AM (7 years ago)
Author:
Bruno Cornec
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.
File:
1 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) {
Note: See TracChangeset for help on using the changeset viewer.