summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
6eee13c)
- Use just the 32-bit numbers in the file_extras union.
- Re-ordered the items in the file_struct to avoid padding
on systems with 64-bit pointers.
- Got rid of the "dir" union in the file_struct, making the
two items into "extras": F_DEPTH() for the receiving side,
and F_ROOTDIR() for the sending side.
- Added PTR_EXTRA_LEN define.
- Got rid of F_HL_IDEV() define.
* where dev_t is a struct.
*/
* where dev_t is a struct.
*/
-struct idev {
- int64 ino;
- int64 dev;
-};
-
struct idev_node {
int64 key;
void *data;
struct idev_node {
int64 key;
void *data;
#define GID_NONE ((gid_t)-1)
union file_extras {
#define GID_NONE ((gid_t)-1)
union file_extras {
- uid_t uid; /* The user ID number */
- uid_t gid; /* The group ID number or GID_NONE */
- struct idev *idev; /* The hard-link info during matching */
- int32 num; /* A signed number */
- uint32 unum; /* An unsigned number */
+ int32 num;
+ uint32 unum;
- time_t modtime; /* When the item was last modified */
const char *dirname; /* The dir info inside the transfer */
const char *dirname; /* The dir info inside the transfer */
- union {
- const char *root; /* Sender-side dir info outside transfer */
- int32 depth; /* Receiver-side directory depth info */
- } dir;
+ time_t modtime; /* When the item was last modified */
uint32 len32; /* Lowest 32 bits of the file's length */
unsigned short mode; /* The item's type and permissions */
unsigned short flags; /* The FLAG_* bits for this item */
uint32 len32; /* Lowest 32 bits of the file's length */
unsigned short mode; /* The item's type and permissions */
unsigned short flags; /* The FLAG_* bits for this item */
#define FILE_STRUCT_LEN (offsetof(struct file_struct, basename))
#define EXTRA_LEN (sizeof (union file_extras))
#define FILE_STRUCT_LEN (offsetof(struct file_struct, basename))
#define EXTRA_LEN (sizeof (union file_extras))
+#define PTR_EXTRA_LEN ((sizeof (char *) + EXTRA_LEN - 1) / EXTRA_LEN)
#define SUM_EXTRA_CNT ((MD4_SUM_LENGTH + EXTRA_LEN - 1) / EXTRA_LEN)
#define REQ_EXTRA(f,ndx) ((union file_extras*)(f) - (ndx))
#define SUM_EXTRA_CNT ((MD4_SUM_LENGTH + EXTRA_LEN - 1) / EXTRA_LEN)
#define REQ_EXTRA(f,ndx) ((union file_extras*)(f) - (ndx))
/* If there is a symlink string, it is always right after the basename */
#define F_SYMLINK(f) ((f)->basename + strlen((f)->basename) + 1)
/* If there is a symlink string, it is always right after the basename */
#define F_SYMLINK(f) ((f)->basename + strlen((f)->basename) + 1)
+/* The sending side always has this available: */
+#define F_ROOTDIR(f) (*(const char**)REQ_EXTRA(f, PTR_EXTRA_LEN))
+
+/* The receiving side always has this available: */
+#define F_DEPTH(f) REQ_EXTRA(f, 1)->num
+
/* When the associated option is on, all entries will have these present: */
/* When the associated option is on, all entries will have these present: */
-#define F_UID(f) REQ_EXTRA(f, preserve_uid)->uid
-#define F_GID(f) REQ_EXTRA(f, preserve_gid)->gid
+#define F_UID(f) REQ_EXTRA(f, preserve_uid)->unum
+#define F_GID(f) REQ_EXTRA(f, preserve_gid)->unum
/* These items are per-entry optional and mutally exclusive: */
/* These items are per-entry optional and mutally exclusive: */
-#define F_HL_IDEV(f) OPT_EXTRA(f, LEN64_BUMP(f))->idev
#define F_HL_GNUM(f) OPT_EXTRA(f, LEN64_BUMP(f))->num
#define F_HL_PREV(f) OPT_EXTRA(f, LEN64_BUMP(f))->num
#define F_HL_GNUM(f) OPT_EXTRA(f, LEN64_BUMP(f))->num
#define F_HL_PREV(f) OPT_EXTRA(f, LEN64_BUMP(f))->num