Changeset 775

Show
Ignore:
Timestamp:
03/15/07 21:10:25 (2 years ago)
Author:
hachi
Message:

Add support for saving the mtime now.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/filepaths-20070306/server/lib/MogileFS/Plugin/FilePaths.pm

    r772 r775  
    4747        my $args = shift; 
    4848        return 1 unless _check_dmid($args->{dmid}); 
    49          
    5049 
    5150        # the key is the path, so we need to move that into the logical_path argument 
     
    8079        } 
    8180 
     81        my $fid = $args->{fid}; 
     82 
    8283        # and now, setup the mapping 
    83         my $nodeid = MogileFS::Plugin::FilePaths::set_file_mapping( $args->{dmid}, $parentnodeid, $filename, $args->{fid} ); 
     84        my $nodeid = MogileFS::Plugin::FilePaths::set_file_mapping( $args->{dmid}, $parentnodeid, $filename, $fid ); 
    8485        return 0 unless $nodeid; 
     86 
     87        if (my $keys = $args->{"plugin.meta.keys"}) { 
     88            my %metadata; 
     89            for (my $i = 0; $i < $keys; $i++) { 
     90                my $key = $args->{"plugin.meta.key$i"}; 
     91                my $value = $args->{"plugin.meta.value$i"}; 
     92                $metadata{$key} = $value; 
     93            } 
     94 
     95            MogileFS::Plugin::MetaData::set_metadata($fid, \%metadata); 
     96        } 
    8597 
    8698        # we're successful, let's keep the file