17 |
|
|
18 |
#include "priv.h" |
#include "priv.h" |
19 |
#include "fs_S.h" |
#include "fs_S.h" |
20 |
#include "ourfs_notify_U.h" |
#include "fs_notify_U.h" |
21 |
|
|
22 |
kern_return_t |
kern_return_t |
23 |
diskfs_S_file_notice_changes (struct protid *cred, mach_port_t notify) |
diskfs_S_file_notice_changes (struct protid *cred, mach_port_t notify) |
31 |
|
|
32 |
np = cred->po->np; |
np = cred->po->np; |
33 |
mutex_lock (&np->lock); |
mutex_lock (&np->lock); |
34 |
err = nowait_file_changed (notify, FILE_CHANGED_NULL, 0, 0); |
err = file_changed (notify, np->filemod_tick, FILE_CHANGED_NULL, 0, 0); |
35 |
if (err) |
if (err) |
36 |
{ |
{ |
37 |
mutex_unlock (&np->lock); |
mutex_unlock (&np->lock); |
51 |
{ |
{ |
52 |
error_t err; |
error_t err; |
53 |
struct modreq **preq; |
struct modreq **preq; |
54 |
|
|
55 |
|
dp->filemod_tick++; |
56 |
preq = &dp->filemod_reqs; |
preq = &dp->filemod_reqs; |
57 |
while (*preq) |
while (*preq) |
58 |
{ |
{ |
59 |
struct modreq *req = *preq; |
struct modreq *req = *preq; |
60 |
err = nowait_file_changed (req->port, type, start, end); |
err = file_changed (req->port, dp->filemod_tick, type, start, end); |
61 |
if (err) |
if (err && err != MACH_SEND_TIMED_OUT) |
62 |
{ /* remove notify port */ |
{ |
63 |
|
/* Remove notify port. */ |
64 |
*preq = req->next; |
*preq = req->next; |
65 |
mach_port_deallocate (mach_task_self (), req->port); |
mach_port_deallocate (mach_task_self (), req->port); |
66 |
free (req); |
free (req); |