extern int sanitize_paths;
extern struct stats stats;
extern struct file_list *the_file_list;
+extern alloc_pool_t hlink_pool;
extern char curr_dir[MAXPATHLEN];
* that the sender doesn't need to remember in its file list. The data
* will survive just long enough to be used by send_file_entry(). */
static dev_t tmp_rdev;
+#ifdef SUPPORT_HARD_LINKS
static struct idev tmp_idev;
+#endif
static char tmp_sum[MD4_SUM_LENGTH];
static char empty_sum[MD4_SUM_LENGTH];
-static int flist_count_offset;
+static int flist_count_offset; /* for --delete --progress */
static void clean_flist(struct file_list *flist, int strip_root, int no_dups);
static void output_flist(struct file_list *flist);
{
if (verbose > 4) {
rprintf(FINFO, "FILE_STRUCT_LEN=%d, EXTRA_LEN=%d\n",
- FILE_STRUCT_LEN, EXTRA_LEN);
+ (int)FILE_STRUCT_LEN, (int)EXTRA_LEN);
}
checksum_len = protocol_version < 21 ? 2 : MD4_SUM_LENGTH;
}
flags |= XMIT_SAME_DEV;
} else
dev = tmp_idev.dev;
- flags |= XMIT_HAS_IDEV_DATA;
+ flags |= XMIT_HLINKED;
}
#endif
#ifdef SUPPORT_HARD_LINKS
if (preserve_hard_links) {
if (protocol_version < 28 && S_ISREG(mode))
- flags |= XMIT_HAS_IDEV_DATA;
- if (flags & XMIT_HAS_IDEV_DATA)
+ flags |= XMIT_HLINKED;
+ if (flags & XMIT_HLINKED)
extra_len += EXTRA_LEN;
}
#endif
bp += basename_len + linkname_len; /* skip space for symlink too */
#ifdef SUPPORT_HARD_LINKS
- if (flags & XMIT_HAS_IDEV_DATA)
+ if (flags & XMIT_HLINKED)
file->flags |= FLAG_HLINKED;
#endif
file->modtime = modtime;
#endif
#ifdef SUPPORT_HARD_LINKS
- if (preserve_hard_links && flags & XMIT_HAS_IDEV_DATA) {
- struct idev *idevp = pool_talloc(flist->hlink_pool, struct idev,
+ if (preserve_hard_links && flags & XMIT_HLINKED) {
+ struct idev *idevp = pool_talloc(hlink_pool, struct idev,
1, "inode_table");
F_HL_IDEV(file) = idevp;
if (protocol_version < 26) {
* file list in memory without sending it over the wire. Also, get_dirlist()
* might call this with f set to -2, which also indicates that local filter
* rules should be ignored. */
-static void send_directory(int f, struct file_list *flist,
- char *fbuf, int len)
+static void send_directory(int f, struct file_list *flist, char *fbuf, int len)
{
struct dirent *di;
unsigned remainder;
start_write = stats.total_written;
gettimeofday(&start_tv, NULL);
- flist = flist_new(0, "send_file_list");
+ flist = flist_new("send_file_list");
io_start_buffering_out();
if (filesfrom_fd >= 0) {
start_read = stats.total_read;
- flist = flist_new(WITH_HLINK, "recv_file_list");
+ flist = flist_new("recv_file_list");
while ((flags = read_byte(f)) != 0) {
}
/* Allocate a new file list. */
-struct file_list *flist_new(int with_hlink, char *msg)
+struct file_list *flist_new(char *msg)
{
struct file_list *flist;
if (!(flist->file_pool = pool_create(FILE_EXTENT, 0, out_of_memory, POOL_INTERN)))
out_of_memory(msg);
-#ifdef SUPPORT_HARD_LINKS
- if (with_hlink && preserve_hard_links) {
- if (!(flist->hlink_pool = pool_create(HLINK_EXTENT,
- sizeof (struct idev), out_of_memory, POOL_INTERN)))
- out_of_memory(msg);
- }
-#endif
-
return flist;
}
void flist_free(struct file_list *flist)
{
pool_destroy(flist->file_pool);
- pool_destroy(flist->hlink_pool);
free(flist->files);
free(flist);
}
* of the dirname string, and also indicates that "dirname" is a MAXPATHLEN
* buffer (the functions we call will append names onto the end, but the old
* dir value will be restored on exit). */
-struct file_list *get_dirlist(char *dirname, int dlen,
- int ignore_filter_rules)
+struct file_list *get_dirlist(char *dirname, int dlen, int ignore_filter_rules)
{
struct file_list *dirlist;
char dirbuf[MAXPATHLEN];
dirname = dirbuf;
}
- dirlist = flist_new(WITHOUT_HLINK, "get_dirlist");
+ dirlist = flist_new("get_dirlist");
recurse = 0;
xfer_dirs = 1;