Displaying 20 results from an estimated 66 matches for "struct_stat".
2020 May 24
3
[PATCH] file_checksum() optimization
...st
cases throughput more than doubles.
---
checksum.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/checksum.c b/checksum.c
index 2e804c47..4aa9f4b7 100644
--- a/checksum.c
+++ b/checksum.c
@@ -294,7 +294,7 @@ void file_checksum(const char *fname, const
STRUCT_STAT *st_p, char *sum)
if (fd == -1)
return;
- buf = map_file(fd, len, MAX_MAP_SIZE, CSUM_CHUNK);
+ buf = map_file(fd, len, MAX_MAP_SIZE, CHUNK_SIZE);
switch (checksum_type) {
case CSUM_MD5: {
@@ -302,8 +302,8 @@ void file_checksum(const char *fname, const
STRUCT_STAT *st_p, char *sum)
MD5...
2010 Jun 15
3
about rsyncing of block devices
Hiya,
I can see it's a regular subject on this list.
I, like others wanted to use rsync to synchronise two block
devices (as it happens one lvm volume and one nbd device served
by qemu-img on a remote host from a qcow2 disk image so that I
can keep the old versions)
As I couldn't find any report of it being done successfully,
I'm just sharing my findings as it might benefit others.
2004 Sep 02
1
--partiall-dir not behaving like it ought too
Hi,
I have awaited the new release inorder to use the -"-partial-dir" option.
But after testing it seems that it does not behave like it says on the tin.
It will correctly move and rename the interrupted file to the declared
directory, but it will not
attempt to use it when the client attempts to rsync the file again.
I have a Solaris 8 box running as a server (Matthew), and another
2002 Jan 07
0
rsync-2.5.1 / updated syscall.c "const" patch
...name2)
{
if (dry_run) return 0;
CHECK_RO
return rename(fname1, fname2);
}
-int do_mkdir(char *fname, mode_t mode)
+int do_mkdir(const char *fname, mode_t mode)
{
if (dry_run) return 0;
CHECK_RO
@@ -138,7 +141,7 @@
int do_stat(const char *fname, STRUCT_STAT *st)
{
-#if HAVE_OFF64_T
+#ifdef HAVE_OFF64_T
return stat64(fname, st);
#else
return stat(fname, st);
@@ -148,7 +151,7 @@
#if SUPPORT_LINKS
int do_lstat(const char *fname, STRUCT_STAT *st)
{
-#if HAVE_OFF64_T
+#ifdef HAVE_OFF64_T
return lstat64(fname, st);
#el...
2004 Apr 11
1
fchmod in do_mkstemp? (patch included)
...85
+++ proto.h 10 Apr 2004 23:48:36 -0000
@@ -222,7 +222,7 @@
int do_rename(char *fname1, char *fname2);
void trim_trailing_slashes(char *name);
int do_mkdir(char *fname, mode_t mode);
-int do_mkstemp(char *template, mode_t perms);
+int do_mkstemp(char *template);
int do_stat(const char *fname, STRUCT_STAT *st);
int do_lstat(const char *fname, STRUCT_STAT *st);
int do_fstat(int fd, STRUCT_STAT *st);
Index: receiver.c
===================================================================
RCS file: /cvsroot/rsync/receiver.c,v
retrieving revision 1.75
diff -u -w -r1.75 receiver.c
--- receiver.c 23 Mar 20...
2009 Jul 27
1
supporting --fake-super on opensolaris (zfs) destination
...lib/sysxattrs.c
@@ -128,7 +128,155 @@ ssize_t sys_llistxattr(const char *path, char *list, size_t size)
#else
-#error You need to create xattr compatibility functions.
+ssize_t sys_lgetxattr(const char *path, const char *name, void *value, size_t size)
+{
+
+
+ int attrfd;
+ size_t bufpos,r;
+ STRUCT_STAT fst;
+
+ do_lstat(path,&fst);
+ if(S_ISLNK(fst.st_mode)) {
+ errno=EPERM;
+ return(-1);
+ }
+
+ attrfd = attropen(path, name, O_RDONLY);
+
+ if (attrfd<0) {
+ errno = ENOATTR;
+ return -1;
+ }
+
+
+ for(bufpos=0;bufpos<size;) {
+ r=read(attrfd,value+bufpos,512);
+ if (r==0) brea...
2020 Apr 25
1
commit b936741 breaks compilation on macos
Hi,
On systems with HAVE_SETATTRLIST, commit b936741 breaks compilation.
This is because do_setattrlist_times hasn't been converted to STRUCT_STAT
*stp.
Here's a small patch to do it.
Cheers,
Filipe
PS: I've been playing with IO_BUFFER_SIZE, MAX_MAP_SIZE and WRITE_SIZE. Any
plans to make it configurable at runtime? It seems to make a big difference
for large files on a fast link (about 5x in my case)
-------------- next part -------...
2004 Jul 11
0
[PATCH] [TRIVIAL] whitespace + variable rename
...3:57 -0000 1.86
--- receiver.c 11 Jul 2004 20:24:22 -0000
***************
*** 289,295 ****
* main routine for receiver process.
*
* Receiver process runs on the same host as the generator process. */
! int recv_files(int f_in,struct file_list *flist,char *local_name)
{
int fd1,fd2;
STRUCT_STAT st;
--- 289,295 ----
* main routine for receiver process.
*
* Receiver process runs on the same host as the generator process. */
! int recv_files(int f_in, struct file_list *flist, char *local_name)
{
int fd1,fd2;
STRUCT_STAT st;
2005 May 31
0
[Bug 2758] New: "File exists" error using options -b and --backup-dir with device files.
...st
Patch:
* only removes file if it was already a device file
--- backup.c.gen Mon Feb 21 17:57:58 2005
+++ backup.c Tue May 31 11:33:30 2005
@@ -171,7 +171,7 @@
* We will move the file to be deleted into a parallel directory tree. */
static int keep_backup(char *fname)
{
- STRUCT_STAT st;
+ STRUCT_STAT st, bufst;
struct file_struct *file;
char *buf;
int kept = 0;
@@ -190,6 +190,12 @@
/* Check to see if this is a device file, or link */
if (IS_DEVICE(file->mode)) {
if (am_root && preserve_devices) {
+...
2004 May 10
2
read error produces null-byte-filled destination file
I've run into a bug in the IO handling when reading a file. Suppose I
have a file that lives on an NFS filesystem. That filesystem is NOT
being exported with auth=0 permissions. So, if I try to access a file
as root, it successfully opens the file, but subsequent reads fail with
EACCES. This produces a destination file full of null bytes. I
noticed this with 2.5.7, but checked 2.6.2 as
2005 Jan 05
1
rsync filename heuristics
...t; +#include "rsync.h"
> +
> +extern char *compare_dest;
> +extern int verbose;
> +
> +/* Alternate methods for opening files, if local doesn't exist */
> +/* Sanity check that we are about to open regular file */
> +int do_open_regular(char *fname)
> +{
> + STRUCT_STAT st;
> +
> + if (do_stat(fname, &st) == 0 && S_ISREG(st.st_mode))
> + return do_open(fname, O_RDONLY, 0);
> +
> + return -1;
> +}
> +
> +static void split_names(char *fname, char **dirname, char **basename)
> +{
> + char *slash;
> +
> + slash = strrch...
2008 Sep 09
3
directories not correctly recognized rsync-3.0.4
Hi,
I'm running rsync-3.0.4 on my UNIX system. I've just updated from rsync-2.6.9.
I'm facing a general problem with the execution of files during a transfer process.
The situation: 2 Directories (dir1 and dir2) on one machine with a some files in dir1 which shall be translated to dir2.
rsync does not correctly recognize dir1 and dir2 as directories. It tries to transfer dir1 as a
2004 Feb 02
1
[PATCH] --one-file-system and automounter
...@@ -618,32 +618,6 @@ static void receive_file_entry(struct fi
}
-/* determine if a file in a different filesstem should be skipped
- when one_file_system is set. We bascally only want to include
- the mount points - but they can be hard to find! */
-static int skip_filesystem(char *fname, STRUCT_STAT * st)
-{
- STRUCT_STAT st2;
- char *p = strrchr(fname, '/');
-
- /* skip all but directories */
- if (!S_ISDIR(st->st_mode))
- return 1;
-
- /* if its not a subdirectory then allow */
- if (!p)
- return 0;
-
- *p = 0;
- if (link_stat(fname, &st2)) {
- *p = '/';
- return 0...
2003 Feb 16
1
rsync-exclude.patch.
...nc-2.5.6/exclude.c Sun Jan 26 13:10:23 2003
+++ rsync-2.5.6J/exclude.c Wed Jan 29 17:16:39 2003
@@ -127,6 +127,7 @@
static void report_exclude_result(char const *name,
struct exclude_struct const *ent,
+ char const *type,
STRUCT_STAT const *st)
{
/* If a trailing slash is present to match only directories,
@@ -134,10 +135,10 @@
* case we add it back in here. */
if (verbose >= 2)
- rprintf(FINFO, "%s %s %s because of pattern %s%s\n",
+ rprintf(FINF...
2008 Sep 01
0
Feature request: preallocation of directories
...__S_IFLNK
# define S_ISLNK(mode) __S_ISTYPE((mode), __S_IFLNK)
# else
# define S_ISLNK(mode) 0
# endif
#endif
#include "et/com_err.h"
#include "e2p/e2p.h"
static const char * program_name = "copy_dirstruct";
#ifdef _LFS64_LARGEFILE
#define LSTAT lstat64
#define STRUCT_STAT struct stat64
#else
#define LSTAT lstat
#define STRUCT_STAT struct stat
#endif
const char *dest_dir = "/mnt";
const char *src_dir = "/";
int blocksize = 4096;
int dest_len = 4;
int silent = 0;
dev_t xdev;
static void usage(void)
{
fprintf(stderr,
"Usage: %s [-RVf] [-+...
2004 Jan 24
2
[PATCH] --links-depth for rsync
...preserve_hard_links;
extern int preserve_perms;
extern int preserve_devices;
@@ -725,6 +726,65 @@
/* IRIX cc cares that the operands to the ternary have the same type. */
#define MALLOC(ap, i) (ap ? (void*) string_area_malloc(ap, i) : malloc(i))
+void make_file_stat(struct file_struct * file, STRUCT_STAT *st)
+{
+ file->modtime = st->st_mtime;
+ file->length = st->st_size;
+ file->mode = st->st_mode;
+ file->uid = st->st_uid;
+ file->gid = st->st_gid;
+ if (preserve_hard_links) {
+ if (protocol_version < 28 ? S_ISREG(st->st_mode)
+ : !S_ISDIR(st->st_mode...
2007 Aug 20
5
DO NOT REPLY [Bug 4899] New: When a mounted dir cannot be visited, rsync will halt there and the shell is halted, even "ctrl -c" can't quit it.
...led once the connection has been negotiated.
2 read the filter.
3 send_file_list().
4 send_files().
In step 3, rsync will examine the file one by one, to decide whether it is a
symblic, whether it is filtered, and so on. It revokes do_stat to check the
file status.
int do_stat(const char *fname, STRUCT_STAT *st)
{
#if HAVE_OFF64_T
return stat64(fname, st);
#else
return stat(fname, st);
#endif
}
It revokes system function "stat", which will halt when the mounted dir is
crashed.
The "stat" issue is not due to rsync. But if the mountd dir is filtered out,
rsync should work well....
2003 Jan 14
3
.rsync-/.rsync+ patch and --link-dest example
This is a patch to add an --rsync-exclude option to rsync-2.5.6cvs.
File names in .rsync- (or .rsync+) are excluded (or included) from the file
lists associated with the current directory and all of its subdirectories.
This has advantages over --cvs-exclude for backing up large file systems
since the .cvsignore files only apply to the current directory:
unless the .cvsignore restrictions apply
2004 May 06
2
rsync-2.6.2: NFS clients confused after an rsync
We use rsync to update an nfs server. After an update, we noticed that
a large number of clients didn't see the updated data.
It took me a while to be able to reliably reproduce this problem, but it
happens on old and new versions of rysnc. It also happens across all
the platforms we use here (sun/linux/netapp).
This shows the problem: [Note my home directory is NFS mounted]
2004 May 07
2
@ERROR: auth failed on module -- PROBLEM SOLVED!
The man page for rsync(1) states:
--password-file
This option allows you to provide a password in a
file for accessing a remote rsync server. Note that
this option is only useful when accessing an rsync
server using the built in trans- port, not when using a
remote shell as the transport. The file must not be
world readable. It should contain just the password as
a single line.