1) Fixed a memory leak and un-closed file discriptor.

2) Added a static table for file discriptors and paths which is keeped until closing.
   The s3fs_xxxx function called by FUSE is able to use a file disctiptor which is already opened by s3fs_open function.
3) The mknod is changed that it always return error, because it does not work through a network.
4) The symbolic file attribute changed to S_IFLNK | S_IRWXU | S_IRWXG | S_IRWXO.
5) Fixed the truncate function to work.
6) The mkdir and clone_directory_object functions are simplified and are changed to use the common create_directory_object function for these.
   For fixed a bug that the directory's PID/UID/mode are changed when these are  renamed.
7) The get_object_name function is changed to check a object finely. 
8) The s3fs_check_service function is changed for "301" response code.
9) Added the noxmlns option for a case of the response without xmlns field. (for the storage compatible with S3)
10) Added the nocopyapi option for the storage compatible with S3 without copy API.

* Comments 
  No.9 and No.10 are for the storage compatible with AWS S3.
  Both option are unnecessary options for AWS S3.
  In future, for the s3fs's promotion and possibility I would like to add new function.




git-svn-id: http://s3fs.googlecode.com/svn/trunk@384 df820570-a93a-0410-bd06-b72b767a4274
This commit is contained in:
ggtakec@gmail.com 2013-01-19 16:05:07 +00:00
parent 2a09e0864e
commit cc6bd2181b
3 changed files with 622 additions and 142 deletions

View File

@ -81,6 +81,13 @@ maximum number of entries in the stat cache
sets the url to use to access Amazon S3. If you want to use HTTPS, then you can set url=https://s3.amazonaws.com
.TP
\fB\-o\fR nomultipart - disable multipart uploads
.TP
\fB\-o\fR noxmlns - disable registing xml name space.
disable registing xml name space for response of ListBucketResult and ListVersionsResult etc. Default name space is looked up from "http://s3.amazonaws.com/doc/2006-03-01".
.TP
\fB\-o\fR nocopyapi - for other incomplete compatibility object storage.
For a distributed object storage which is compatibility S3 API without PUT(copy api).
If you set this option, s3fs do not use PUT with "x-amz-copy-source"(copy api). Because traffic is increased 2-3 times by this option, we do not recommend this.
.SH FUSE/MOUNT OPTIONS
.TP
Most of the generic mount options described in 'man mount' are supported (ro, rw, suid, nosuid, dev, nodev, exec, noexec, atime, noatime, sync async, dirsync). Filesystems are mounted with '-onodev,nosuid' by default, which can only be overridden by a privileged user.

File diff suppressed because it is too large Load Diff

View File

@ -47,6 +47,8 @@ static mode_t root_mode = 0;
static std::string passwd_file = "";
static bool utility_mode = 0;
unsigned long max_stat_cache_size = 10000;
bool noxmlns = false;
bool nocopyapi = false;
// if .size()==0 then local file cache is disabled
static std::string use_cache;
@ -79,6 +81,9 @@ typedef std::map<std::string, std::string> headers_t;
typedef std::map<int, int> s3fs_descriptors_t;
static s3fs_descriptors_t s3fs_descriptors;
static pthread_mutex_t s3fs_descriptors_lock;
// path -> fd
typedef std::map<std::string, int> s3fs_pathtofd_t;
static s3fs_pathtofd_t s3fs_pathtofd;
static pthread_mutex_t *mutex_buf = NULL;
@ -107,9 +112,9 @@ static int free_object_list(struct s3_object *head);
static CURL *create_head_handle(struct head_data *request);
static int list_bucket(const char *path, struct s3_object **head);
static bool is_truncated(const char *xml);
static int append_objects_from_xml(const char *xml, struct s3_object **head);
static int append_objects_from_xml(const char* path, const char *xml, struct s3_object **head);
static const char *get_next_marker(const char *xml);
static char *get_object_name(xmlDocPtr doc, xmlNodePtr node);
static char *get_object_name(xmlDocPtr doc, xmlNodePtr node, const char* path);
static int put_headers(const char *path, headers_t meta);
static int put_multipart_headers(const char *path, headers_t meta);
@ -143,3 +148,4 @@ static void* s3fs_init(struct fuse_conn_info *conn);
static void s3fs_destroy(void*);
#endif // S3FS_S3_H_