Ignore:
Timestamp:
Feb 2, 2011, 11:29:17 PM (11 years ago)
Author:
jordan
Message:

(trunk libT) #3973 "JIT verification verifies fresh downloaded torrents" -- improvement to r11813.

r11813 fixed the timestamp issue by fsync()ing files before close()ing them in tr_close_file(). This causes a little overhead as even read-only files cause a sync as their atimes are modified. Instead, we should call fsync() further back in the call chain in tr_fdFileClose() so that we can know to only sync torrent files that were opened with write access.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/fdlimit.c

    r11816 r11817  
    309309    fcntl( fd, F_NOCACHE, 1 );
    310310#endif
    311     tr_fsync( fd );
    312311    close( fd );
    313312}
     
    527526
    528527    if(( o = fileset_lookup( get_fileset( s ), tr_torrentId( tor ), i )))
     528    {
     529        /* flush writable files so that their mtimes will be
     530         * up-to-date when this function returns to the caller... */
     531        if( o->is_writable )
     532            tr_fsync( o->fd );
     533
    529534        cached_file_close( o );
     535    }
    530536}
    531537
Note: See TracChangeset for help on using the changeset viewer.