summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2012-06-05 09:36:36 +0200
committerStefan Metzmacher <metze@samba.org>2012-06-06 10:18:37 +0200
commitdc962c195e24a6323295a596fe864d3bc245b66b (patch)
tree6f9d4d8b2166e83eb841e7e9011af0f234744812
parentd1d790418230bed0f79942bd1f0838312bb8390c (diff)
downloadsamba-dc962c195e24a6323295a596fe864d3bc245b66b.tar.gz
samba-dc962c195e24a6323295a596fe864d3bc245b66b.tar.bz2
samba-dc962c195e24a6323295a596fe864d3bc245b66b.zip
s3:smbd: add change_notify_fsp_has_changes()
metze
-rw-r--r--source3/smbd/notify.c17
-rw-r--r--source3/smbd/proto.h1
2 files changed, 18 insertions, 0 deletions
diff --git a/source3/smbd/notify.c b/source3/smbd/notify.c
index 0401b65a6a..a55be9b938 100644
--- a/source3/smbd/notify.c
+++ b/source3/smbd/notify.c
@@ -39,6 +39,23 @@ struct notify_change_request {
static void notify_fsp(files_struct *fsp, uint32 action, const char *name);
+bool change_notify_fsp_has_changes(struct files_struct *fsp)
+{
+ if (fsp == NULL) {
+ return false;
+ }
+
+ if (fsp->notify == NULL) {
+ return false;
+ }
+
+ if (fsp->notify->num_changes == 0) {
+ return false;
+ }
+
+ return true;
+}
+
/*
* For NTCancel, we need to find the notify_change_request indexed by
* mid. Separate list here.
diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h
index e9365661be..03a09cd27e 100644
--- a/source3/smbd/proto.h
+++ b/source3/smbd/proto.h
@@ -496,6 +496,7 @@ void reply_negprot(struct smb_request *req);
/* The following definitions come from smbd/notify.c */
+bool change_notify_fsp_has_changes(struct files_struct *fsp);
void change_notify_reply(struct smb_request *req,
NTSTATUS error_code,
uint32_t max_param,