#include <stdint.h>#include <atalk/cnid.h>#include <atalk/globals.h>#include <atalk/server_child.h>Go to the source code of this file.
Data Structures | |
| struct | ipc_cache_hint_payload |
Macros | |
| #define | IPC_HEADERLEN 14 |
| #define | IPC_MAXMSGSIZE 90 |
| #define | IPC_DISCOLDSESSION 0 |
| #define | IPC_GETSESSION 1 |
| #define | IPC_STATE 2 |
| #define | IPC_VOLUMES 3 |
| #define | IPC_LOGINDONE 4 |
| #define | IPC_CACHE_HINT 5 |
| #define | IPC_SESSIONTOKEN 6 |
| #define | CACHE_HINT_REFRESH 0 |
| #define | CACHE_HINT_DELETE 1 |
| #define | CACHE_HINT_DELETE_CHILDREN 2 |
| #define | HINT_BUF_SIZE 128 |
| #define | HINT_FLUSH_INTERVAL_MS 50 |
Functions | |
| int | ipc_server_read (server_child_t *children, int fd) |
| Read a IPC message from a child. | |
| int | ipc_child_write (AFPObj *obj, uint16_t command, size_t len, void *token) |
| int | ipc_child_state (AFPObj *obj, uint16_t state) |
| int | ipc_send_cache_hint (const AFPObj *obj, uint16_t vid, cnid_t cnid, uint8_t event) |
| Send a dircache invalidation hint from child to parent. | |
| unsigned long long | ipc_get_hints_sent (void) |
| unsigned long long | ipc_get_hints_dropped (void) |
| void | hint_flush_pending (server_child_t *children) |
| Flush all buffered hints to sibling children. | |
| int | hint_buf_count (void) |
| Return current number of buffered hints. | |
| #define CACHE_HINT_DELETE 1 |
direct dir_remove() by CNID
| #define CACHE_HINT_DELETE_CHILDREN 2 |
dircache_remove_children() + remove/refresh parent
| #define CACHE_HINT_REFRESH 0 |
ostat + dir_modify(DCMOD_STAT)
| #define HINT_BUF_SIZE 128 |
| #define HINT_FLUSH_INTERVAL_MS 50 |
| #define IPC_CACHE_HINT 5 |
Cross-process dircache invalidation hint
| #define IPC_DISCOLDSESSION 0 |
| #define IPC_GETSESSION 1 |
| #define IPC_HEADERLEN 14 |
| #define IPC_LOGINDONE 4 |
| #define IPC_MAXMSGSIZE 90 |
| #define IPC_SESSIONTOKEN 6 |
pass opaque reconnect token
| #define IPC_STATE 2 |
pass AFP session state
| #define IPC_VOLUMES 3 |
pass list of open volumes
|
extern |
Return current number of buffered hints.
Used by main event loop to decide poll timeout:
|
extern |
Flush all buffered hints to sibling children.
Called from the parent main event loop when:
Iterates the child table directly:
Performs priority sorting, PIPE_BUF-safe chunked writes.
While this function writes to child pipes, new IPC messages from children accumulate in the kernel socket buffer and are read on the next poll() iteration.
|
extern |
|
extern |
|
extern |
|
extern |
Send a dircache invalidation hint from child to parent.
Called directly from AFP command handlers that modify dircache state. Independent of the external FCE system — always active when IPC is available.
Uses a direct non-blocking write() to the IPC socketpair instead of ipc_child_write()/writet() — this ensures the AFP command handler is never blocked waiting for IPC buffer space. If the kernel socket buffer is full (parent not draining fast enough), the hint is silently dropped. Hints are best-effort optimizations, and the dircache validation mechanism & graceful fail-on-use detection makes drops safe.
The 22-byte message (14-byte IPC header + 8-byte payload) is well under the kernel socket buffer size, so partial writes cannot occur when space is available.
| [in] | obj | AFPObj with ipc_fd |
| [in] | vid | Volume ID (network byte order, matches vol->v_vid) |
| [in] | cnid | CNID of affected file/dir (network byte order) |
| [in] | event | Hint type: CACHE_HINT_REFRESH, CACHE_HINT_DELETE, or CACHE_HINT_DELETE_CHILDREN |
|
extern |
Read a IPC message from a child.
This is using an fd with non-blocking IO, so EAGAIN is not an error
| [in,out] | children | pointer to our structure with all childs |
| [in] | fd | IPC socket with child |