2 * Copyright (C) 1997 Free Software Foundation, Inc.
3 * Copyright (C) 2013 Steven McDonald <steven@steven-mcdonald.id.au>
5 * ftpfs translator written by Miles Bader <miles@gnu.ai.mit.edu>
6 * Modified for trovefs by Steven McDonald <steven@steven-mcdonald.id.au>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2, or (at your option)
13 * This software is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
29 #include <hurd/ihash.h>
31 #define TROVEFS_VERSION "0.0"
33 #define TROVEFS_DEFAULT_HOSTNAME "beta.anchortrove.com"
34 #define TROVEFS_USER_AGENT "trovefs " TROVEFS_VERSION " (GNU)"
35 #define TROVEFS_REMOTE_PATH_MALLOC_SIZE 128
36 #define TROVEFS_MAX_LIST_KEYS 10000
38 struct trovefs_dir_entry
46 time_t stat_timestamp;
48 struct trovefs_dir *dir;
50 struct trovefs_dir_entry *next, **self_p;
52 struct trovefs_dir_entry *ordered_next, **ordered_self_p;
54 time_t name_timestamp;
56 hurd_ihash_locp_t inode_locp;
66 size_t num_live_entries;
68 struct trovefs_dir_entry **htable;
71 struct trovefs_dir_entry *ordered;
79 time_t stat_timestamp;
80 time_t name_timestamp;
82 time_t bulk_stat_base_stamp;
83 unsigned bulk_stat_count_first_half;
84 unsigned bulk_stat_count_second_half;
91 struct trovefs_dir_entry *dir_entry;
95 struct ccache *contents;
97 struct trovefs_dir *dir;
99 struct node *ncache_next, *ncache_prev;
104 /* Filesystem root. */
107 /* Context for S3 requests. */
108 S3BucketContext *s3_ctx;
113 struct hurd_ihash inode_mappings;
114 pthread_spinlock_t inode_mappings_lock;
118 trovefs_create (char *hostname, char *bucket, char *access_key_id, char *secret_access_key, int fsid, struct trovefs **fs);
121 trovefs_dir_create (struct trovefs *fs, struct node *node, const char *rmt_path, struct trovefs_dir **dir);
124 trovefs_dir_null_lookup (struct trovefs_dir *dir, struct node **node);
127 trovefs_create_node (struct trovefs_dir_entry *e, const char *rmt_path, struct node **node);
130 trovefs_refresh_node (struct node *node);
133 refresh_dir (struct trovefs_dir *dir, int update_stats, struct trovefs_dir_entry *preserve_entry);
136 free_entry (struct trovefs_dir_entry *e);
139 trovefs_s3_get_names (struct trovefs_dir *dir);
141 struct trovefs_dir_entry *
142 lookup (struct trovefs_dir *dir, const char *name, int add);
144 #endif // __TROVEFS_H__