diff options
author | Andreas Baumann <abaumann@yahoo.com> | 2012-04-24 11:54:58 +0200 |
---|---|---|
committer | Andreas Baumann <abaumann@yahoo.com> | 2012-04-24 11:54:58 +0200 |
commit | 6dbfae4e2bafac8dabab003814fbe58de0c8a594 (patch) | |
tree | f382fb77292f866656e436ceb0eb260608ba65e4 /pgfuse.c | |
parent | 455b71bbe074599b9d6a2915050f2784df8a117d (diff) | |
download | pgfuse-6dbfae4e2bafac8dabab003814fbe58de0c8a594.tar.gz pgfuse-6dbfae4e2bafac8dabab003814fbe58de0c8a594.tar.bz2 |
removed 'path' in schema, translating path now iteratively to id via
the 'parent_id'
Diffstat (limited to 'pgfuse.c')
-rw-r--r-- | pgfuse.c | 33 |
1 files changed, 2 insertions, 31 deletions
@@ -720,43 +720,14 @@ static int pgfuse_fsync( const char *path, int isdatasync, struct fuse_file_info static int pgfuse_release( const char *path, struct fuse_file_info *fi ) { PgFuseData *data = (PgFuseData *)fuse_get_context( )->private_data; - int id; - int res; - PgMeta meta; - PGconn *conn; + /* nothing to do given the simple transaction model */ + if( data->verbose ) { syslog( LOG_INFO, "Releasing '%s' on '%s', thread #%u", path, data->mountpoint, THREAD_ID ); } - ACQUIRE( conn ); - PSQL_BEGIN( conn ); - - if( fi->fh == 0 ) { - PSQL_ROLLBACK( conn ); RELEASE( conn ); - return -EBADF; - } - - if( data->read_only ) { - PSQL_ROLLBACK( conn ); RELEASE( conn ); - return 0; - } - - id = psql_get_meta( conn, path, &meta ); - if( id < 0 ) { - PSQL_ROLLBACK( conn ); RELEASE( conn ); - return id; - } - - res = psql_write_meta( conn, id, path, meta ); - if( res < 0 ) { - PSQL_ROLLBACK( conn ); RELEASE( conn ); - return res; - } - - PSQL_COMMIT( conn ); RELEASE( conn ); - return 0; } |