diff options
Diffstat (limited to 'libglusterfs')
| -rw-r--r-- | libglusterfs/src/common-utils.h | 25 | ||||
| -rw-r--r-- | libglusterfs/src/glusterfs.h | 1 | 
2 files changed, 26 insertions, 0 deletions
diff --git a/libglusterfs/src/common-utils.h b/libglusterfs/src/common-utils.h index e8b5fc83591..c361405d5eb 100644 --- a/libglusterfs/src/common-utils.h +++ b/libglusterfs/src/common-utils.h @@ -130,6 +130,31 @@ enum _gf_xlator_ipc_targets {  typedef enum _gf_boolean gf_boolean_t;  typedef enum _gf_client_pid gf_client_pid_t;  typedef enum _gf_xlator_ipc_targets _gf_xlator_ipc_targets_t; + +/* The DHT file rename operation is not a straightforward rename. + * It involves creating linkto and linkfiles, and can unlink or rename the + * source file depending on the hashed and cached subvols for the source + * and target files. this makes it difficult for geo-rep to figure out that + * a rename operation has taken place. + * + * We now send a special key and the values of the source and target pargfids + * and basenames to indicate to changelog that the operation in question + * should be treated as a rename. We are explicitly filling and sending this + * as a binary value in the dictionary as the unlink op will not have the + * source file information. The lengths of the src and target basenames + * are used to calculate where to start reading the names in the structure. + * XFS allows a max of 255 chars for filenames but other file systems might + * not have such restrictions + */ +typedef struct dht_changelog_rename_info { +         uuid_t  old_pargfid; +         uuid_t  new_pargfid; +         int32_t oldname_len; +         int32_t newname_len; +         char    buffer[1]; + } dht_changelog_rename_info_t; + +  typedef int (*gf_cmp) (void *, void *);  void gf_global_variable_init(void); diff --git a/libglusterfs/src/glusterfs.h b/libglusterfs/src/glusterfs.h index d8d92ad7546..1b7041cab45 100644 --- a/libglusterfs/src/glusterfs.h +++ b/libglusterfs/src/glusterfs.h @@ -140,6 +140,7 @@  #define GLUSTERFS_VERSION_XCHG_KEY     "glusterfs.version.xchg"  #define GLUSTERFS_INTERNAL_FOP_KEY  "glusterfs-internal-fop" +#define DHT_CHANGELOG_RENAME_OP_KEY   "changelog.rename-op"  #define ZR_FILE_CONTENT_STR     "glusterfs.file."  #define ZR_FILE_CONTENT_STRLEN 15  | 
