summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
authorCsaba Henk <csaba@gluster.com>2010-05-12 19:10:47 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-05-13 12:12:08 -0700
commit2a0398dee8521704b90d3f1776a5e380bf8ac5b3 (patch)
tree394a62736967be4cfec9314e8fdc9cce54ebcd25 /libglusterfs
parent9bdda4ce0aaebb3f8109152f056d9b35229fb708 (diff)
added features/mac-compat
Signed-off-by: Csaba Henk <csaba@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 800 (Problem on OSX with NFS and CIFS exports) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=800
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/compat.c86
-rw-r--r--libglusterfs/src/compat.h30
-rw-r--r--libglusterfs/src/glusterfs.h1
3 files changed, 1 insertions, 116 deletions
diff --git a/libglusterfs/src/compat.c b/libglusterfs/src/compat.c
index 85af45f9a..891b156d3 100644
--- a/libglusterfs/src/compat.c
+++ b/libglusterfs/src/compat.c
@@ -36,92 +36,6 @@
#include "compat.h"
#include "common-utils.h"
-#ifdef GF_DARWIN_HOST_OS
-
-#define GF_FINDER_INFO_XATTR "com.apple.FinderInfo"
-#define GF_RESOURCE_FORK_XATTR "com.apple.ResourceFork"
-#define GF_FINDER_INFO_SIZE 32
-
-static const char gf_finder_info_content[GF_FINDER_INFO_SIZE] = {
- 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
-};
-
-
-int32_t
-gf_darwin_compat_listxattr (int len, dict_t *dict, int size)
-{
- data_t *data = NULL;
- if (len == -1)
- len = 0;
-
- data = dict_get (dict, GF_FINDER_INFO_XATTR);
- if (!data) {
- dict_set (dict, GF_FINDER_INFO_XATTR,
- bin_to_data ((void *)gf_finder_info_content,
- GF_FINDER_INFO_SIZE));
- len += strlen (GF_FINDER_INFO_XATTR);
- }
-
- data = dict_get (dict, GF_RESOURCE_FORK_XATTR);
- if (!data) {
- dict_set (dict, GF_RESOURCE_FORK_XATTR, str_to_data (""));
- len += strlen (GF_RESOURCE_FORK_XATTR);
- }
-
- return len;
-}
-
-int32_t
-gf_darwin_compat_getxattr (const char *key, dict_t *dict)
-{
- data_t *data = NULL;
-
- if (strcmp(key, GF_FINDER_INFO_XATTR) == 0) {
- data = dict_get (dict, GF_FINDER_INFO_XATTR);
- if (!data) {
- dict_set (dict, GF_FINDER_INFO_XATTR,
- bin_to_data ((void *)gf_finder_info_content,
- GF_FINDER_INFO_SIZE));
- return GF_FINDER_INFO_SIZE;
- }
- return 0;
- }
-
- if (strcmp(key, GF_RESOURCE_FORK_XATTR) == 0) {
- data = dict_get (dict, GF_RESOURCE_FORK_XATTR);
- if (!data) {
- /* Always null */
- dict_set (dict, GF_RESOURCE_FORK_XATTR,
- str_to_data (""));
- return 0;
- }
- return 0;
- }
- return -1;
-}
-
-
-int32_t
-gf_darwin_compat_setxattr (dict_t *dict)
-{
- data_t *data = NULL;
-
- data = dict_get (dict, GF_FINDER_INFO_XATTR);
- if (data)
- return 0;
- data = dict_get (dict, GF_RESOURCE_FORK_XATTR);
- if (data)
- return 0;
-
- return -1;
-}
-
-#endif /* DARWIN */
-
-
#ifdef GF_SOLARIS_HOST_OS
int
diff --git a/libglusterfs/src/compat.h b/libglusterfs/src/compat.h
index 20db203bf..d69d504cb 100644
--- a/libglusterfs/src/compat.h
+++ b/libglusterfs/src/compat.h
@@ -321,36 +321,6 @@ dirent_size (struct dirent *entry)
}
-static inline int32_t
-gf_compat_getxattr (const char *key, dict_t *dict)
-{
-#ifdef GF_DARWIN_HOST_OS
- return gf_darwin_compat_getxattr (key, dict);
-#endif
- return -1;
-}
-
-
-static inline int32_t
-gf_compat_setxattr (dict_t *dict)
-{
-#ifdef GF_DARWIN_HOST_OS
- return gf_darwin_compat_setxattr (dict);
-#endif
- return -1;
-}
-
-
-static inline int32_t
-gf_compat_listxattr (int len, dict_t *dict, int size)
-{
-#ifdef GF_DARWIN_HOST_OS
- return gf_darwin_compat_listxattr (len, dict, size);
-#endif
- return len;
-}
-
-
#ifdef HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC
/* Linux, Solaris, Cygwin */
#define ST_ATIM_NSEC(stbuf) ((stbuf)->st_atim.tv_nsec)
diff --git a/libglusterfs/src/glusterfs.h b/libglusterfs/src/glusterfs.h
index 226c358e5..f6ba4e2ef 100644
--- a/libglusterfs/src/glusterfs.h
+++ b/libglusterfs/src/glusterfs.h
@@ -210,6 +210,7 @@ struct _cmd_args {
char *run_id;
int debug_mode;
int read_only;
+ int mac_compat;
struct list_head xlator_options; /* list of xlator_option_t */
/* fuse options */