~ubuntu-branches/ubuntu/saucy/fuse-umfuse-ext2/saucy

« back to all changes in this revision

Viewing changes to fuse-ext2/op_utimens.c

  • Committer: Package Import Robot
  • Author(s): Ludovico Gardenghi, Filippo Giunchedi, Ludovico Gardenghi
  • Date: 2012-06-24 20:58:20 UTC
  • mfrom: (1.1.3)
  • Revision ID: package-import@ubuntu.com-20120624205820-d9avp9pa6zgiyac7
Tags: 0.4-1
[ Filippo Giunchedi ]
* Add DM-Upload-Allowed field

[ Ludovico Gardenghi ]
* New upstream release
  + Source code completely changed, now it's a fork of fuse-ext2 by
    Alper Akcan
  + Update copyright file accordingly
  + Resolve old codebase issues (Closes: #562177, #670622)
* Update to S-V 3.9.3
* Switch to machine-readable copyright file
* Update mail address for Ludovico Gardenghi
* Add compatibility symlinks (old version used fuseext2, this one uses
  fuse-ext2)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 * Copyright (c) 2008-2010 Alper Akcan <alper.akcan@gmail.com>
 
3
 * Copyright (c) 2009-2010 Renzo Davoli <renzo@cs.unibo.it>
 
4
 *
 
5
 * This program is free software; you can redistribute it and/or modify
 
6
 * it under the terms of the GNU General Public License as published by
 
7
 * the Free Software Foundation; either version 2 of the License, or
 
8
 * (at your option) any later version.
 
9
 *
 
10
 * This program is distributed in the hope that it will be useful,
 
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 * GNU General Public License for more details.
 
14
 *
 
15
 * You should have received a copy of the GNU General Public License
 
16
 * along with this program (in the main directory of the fuse-ext2
 
17
 * distribution in the file COPYING); if not, write to the Free Software
 
18
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
19
 */
 
20
 
 
21
#include "fuse-ext2.h"
 
22
 
 
23
int op_utimens (const char *path, const struct timespec tv[2])
 
24
{
 
25
        int rt;
 
26
        errcode_t rc;
 
27
        ext2_ino_t ino;
 
28
        struct ext2_vnode *vnode;
 
29
        struct ext2_inode *inode;
 
30
        ext2_filsys e2fs;
 
31
        FUSE_EXT2_LOCK;
 
32
        e2fs    = current_ext2fs();
 
33
 
 
34
        debugf("enter");
 
35
        debugf("path = %s", path);
 
36
        
 
37
        rt = do_readvnode(e2fs, path, &ino, &vnode, DONT_OPEN_FILE);
 
38
        if (rt) {
 
39
                debugf("do_readvnode(%s, &ino, &vnode); failed", path);
 
40
                FUSE_EXT2_UNLOCK;
 
41
                return rt;
 
42
        }
 
43
        inode = vnode2inode(vnode);
 
44
        
 
45
        inode->i_atime = tv[0].tv_sec;
 
46
        inode->i_mtime = tv[0].tv_sec;
 
47
 
 
48
        rc=vnode_put(vnode,1);
 
49
        if (rc) {
 
50
                debugf("vnode_put(vnode,1); failed");
 
51
                FUSE_EXT2_UNLOCK;
 
52
                return -EIO;
 
53
        }
 
54
 
 
55
        debugf("leave");
 
56
        FUSE_EXT2_UNLOCK;
 
57
        return 0;
 
58
}