summaryrefslogtreecommitdiff
path: root/source3/modules/vfs_syncops.c
diff options
context:
space:
mode:
authorTim Prouty <tprouty@samba.org>2009-06-16 12:01:13 -0700
committerTim Prouty <tprouty@samba.org>2009-06-17 20:11:53 -0700
commit4e3656b8d1d0bf8c0c4ade01332e7384ea890810 (patch)
treeefcb240c8b0dbdd791e01dfe62a50f4cfdca47e5 /source3/modules/vfs_syncops.c
parent5cfac1a1bd59712d7a771d3631e869c5d078a0f3 (diff)
downloadsamba-4e3656b8d1d0bf8c0c4ade01332e7384ea890810.tar.gz
samba-4e3656b8d1d0bf8c0c4ade01332e7384ea890810.tar.bz2
samba-4e3656b8d1d0bf8c0c4ade01332e7384ea890810.zip
s3: Change SMB_VFS_OPEN to take an smb_filename struct
This was a little messy because of all of the vfs modules I had to touch. Most of them were pretty straight forward, but the streams modules required a little attention to handle smb_filename. Since the use of smb_filename enables the vfs modules to access the raw, over-the-wire stream, a little bit of the handling that was being done by split_ntfs_stream_name has now been shifted into the individual stream modules. It may be a little more code, but overall it gives more flexibility to the streams modules, while also allowing correct stream handling.
Diffstat (limited to 'source3/modules/vfs_syncops.c')
-rw-r--r--source3/modules/vfs_syncops.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/source3/modules/vfs_syncops.c b/source3/modules/vfs_syncops.c
index d3f7868400..562195cbda 100644
--- a/source3/modules/vfs_syncops.c
+++ b/source3/modules/vfs_syncops.c
@@ -104,6 +104,19 @@ static void syncops_name(const char *name)
}
}
+/*
+ sync two meta data changes for 1 names
+ */
+static void syncops_smb_fname(struct smb_filename *smb_fname)
+{
+ char *parent;
+ parent = parent_dir(NULL, smb_fname->base_name);
+ if (parent) {
+ syncops_sync_directory(parent);
+ talloc_free(parent);
+ }
+}
+
/*
rename needs special handling, as we may need to fsync two directories
@@ -125,6 +138,12 @@ static int syncops_rename(vfs_handle_struct *handle,
return ret; \
} while (0)
+#define SYNCOPS_NEXT_SMB_FNAME(op, fname, args) do { \
+ int ret = SMB_VFS_NEXT_ ## op args; \
+ if (ret == 0 && fname) syncops_smb_fname(fname); \
+ return ret; \
+} while (0)
+
static int syncops_symlink(vfs_handle_struct *handle,
const char *oldname, const char *newname)
{
@@ -138,9 +157,11 @@ static int syncops_link(vfs_handle_struct *handle,
}
static int syncops_open(vfs_handle_struct *handle,
- const char *fname, files_struct *fsp, int flags, mode_t mode)
+ struct smb_filename *smb_fname, files_struct *fsp,
+ int flags, mode_t mode)
{
- SYNCOPS_NEXT(OPEN, (flags&O_CREAT?fname:NULL), (handle, fname, fsp, flags, mode));
+ SYNCOPS_NEXT_SMB_FNAME(OPEN, (flags&O_CREAT?smb_fname:NULL),
+ (handle, smb_fname, fsp, flags, mode));
}
static int syncops_unlink(vfs_handle_struct *handle, const char *fname)