summaryrefslogtreecommitdiff
path: root/source3/librpc/ndr
diff options
context:
space:
mode:
authorSteven Danneman <steven.danneman@isilon.com>2009-02-20 13:23:53 -0800
committerSteven Danneman <steven.danneman@isilon.com>2009-02-20 14:10:30 -0800
commitb329ea1cf35cfe151ac026eefc8ff82b2dfd711c (patch)
tree486f0d6d63c189e42b4bcac004ff0f20e39a4026 /source3/librpc/ndr
parent1a0aed36c0fc3815c832be1086a3a66256426414 (diff)
downloadsamba-b329ea1cf35cfe151ac026eefc8ff82b2dfd711c.tar.gz
samba-b329ea1cf35cfe151ac026eefc8ff82b2dfd711c.tar.bz2
samba-b329ea1cf35cfe151ac026eefc8ff82b2dfd711c.zip
s3: Modifications to generic notify structures to allow implementation of OneFS notify.
The OneFS kernel based change notify system takes an fd of the directory to watch in it's initialization syscall. Since we already have this directory open, this commit plumbs that fd down to the VFS layer via the notify_entry struct. We also need to know if the watch is taken out on a snapshot directory. The full file_id struct is also passed down to make this determination. The file_id marshalling wrappers are hand written here, but should eventually be auto-generated by moving the struct file_id into the idl.
Diffstat (limited to 'source3/librpc/ndr')
-rw-r--r--source3/librpc/ndr/util.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/source3/librpc/ndr/util.c b/source3/librpc/ndr/util.c
index 5afc4f4f5a..8fac5eadd4 100644
--- a/source3/librpc/ndr/util.c
+++ b/source3/librpc/ndr/util.c
@@ -155,6 +155,45 @@ void ndr_print_server_id(struct ndr_print *ndr, const char *name, const struct s
ndr->depth--;
}
+enum ndr_err_code ndr_push_file_id(struct ndr_push *ndr, int ndr_flags, const struct file_id *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS,
+ (uint64_t)r->devid));
+ NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS,
+ (uint64_t)r->inode));
+ NDR_CHECK(ndr_push_udlong(ndr, NDR_SCALARS,
+ (uint64_t)r->extid));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+enum ndr_err_code ndr_pull_file_id(struct ndr_pull *ndr, int ndr_flags, struct file_id *r)
+{
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->devid));
+ NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->inode));
+ NDR_CHECK(ndr_pull_udlong(ndr, NDR_SCALARS, &r->extid));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+void ndr_print_file_id(struct ndr_print *ndr, const char *name, const struct file_id *r)
+{
+ ndr_print_struct(ndr, name, "file_id");
+ ndr->depth++;
+ ndr_print_udlong(ndr, "devid", (uint64_t)r->devid);
+ ndr_print_udlong(ndr, "inode", (uint64_t)r->inode);
+ ndr_print_udlong(ndr, "extid", (uint64_t)r->extid);
+ ndr->depth--;
+}
+
_PUBLIC_ void ndr_print_bool(struct ndr_print *ndr, const char *name, const bool b)
{
ndr->print(ndr, "%-25s: %s", name, b?"true":"false");