|
| static void | sig_handler (int signo) |
| static void | RQST_RESET (struct cnid_dbd_rqst *r) |
| static void | delay (int sec) |
| static int | tsock_getfd (const char *host, const char *port) |
| static int | write_vec (int fd, struct iovec *iov, ssize_t towrite, int vecs) |
| | Write "towrite" bytes using writev on non-blocking fd.
|
| static int | init_tsock (CNID_bdb_private *db) |
| static int | send_packet (CNID_bdb_private *db, struct cnid_dbd_rqst *rqst) |
| static void | dbd_initstamp (struct cnid_dbd_rqst *rqst) |
| static int | dbd_reply_stamp (struct cnid_dbd_rply *rply) |
| static int | dbd_rpc (CNID_bdb_private *db, struct cnid_dbd_rqst *rqst, struct cnid_dbd_rply *rply) |
| | send a request and get reply
|
| static int | transmit_locked (CNID_bdb_private *db, struct cnid_dbd_rqst *rqst, struct cnid_dbd_rply *rply) |
| | Inner transmit body, signal handlers must already be installed.
|
| static int | transmit (CNID_bdb_private *db, struct cnid_dbd_rqst *rqst, struct cnid_dbd_rply *rply) |
| static struct _cnid_db * | cnid_dbd_new (struct vol *vol) |
| struct _cnid_db * | cnid_dbd_open (struct cnid_open_args *args) |
| void | cnid_dbd_close (struct _cnid_db *cdb) |
| static int | cnid_dbd_stamp (CNID_bdb_private *db) |
| cnid_t | cnid_dbd_add (struct _cnid_db *cdb, const struct stat *st, cnid_t did, const char *name, size_t len, cnid_t hint) |
| cnid_t | cnid_dbd_get (struct _cnid_db *cdb, cnid_t did, const char *name, size_t len) |
| char * | cnid_dbd_resolve (struct _cnid_db *cdb, cnid_t *id, void *buffer, size_t len) |
| int | cnid_dbd_getstamp (struct _cnid_db *cdb, void *buffer, const size_t len) |
| cnid_t | cnid_dbd_lookup (struct _cnid_db *cdb, const struct stat *st, cnid_t did, const char *name, size_t len) |
| int | cnid_dbd_find (struct _cnid_db *cdb, const char *name, size_t namelen, void *buffer, size_t buflen, bool *more_available) |
| | Backend implementation of cnid_find() for the DBD daemon backend.
|
| int | cnid_dbd_update (struct _cnid_db *cdb, cnid_t id, const struct stat *st, cnid_t did, const char *name, size_t len) |
| cnid_t | cnid_dbd_rebuild_add (struct _cnid_db *cdb, const struct stat *st, cnid_t did, const char *name, size_t len, cnid_t hint) |
| int | cnid_dbd_delete (struct _cnid_db *cdb, const cnid_t id) |
| int | cnid_dbd_wipe (struct _cnid_db *cdb) |
| int cnid_dbd_find |
( |
struct _cnid_db * | cdb, |
|
|
const char * | name, |
|
|
size_t | namelen, |
|
|
void * | buffer, |
|
|
size_t | buflen, |
|
|
bool * | more_available ) |
Backend implementation of cnid_find() for the DBD daemon backend.
Parameter validation is performed once in the wrapper at libatalk/cnid/cnid.c. This function trusts that cdb, name, namelen, buffer and buflen are sane and focuses on driving the paginated SEARCH RPC to cnid_dbd.
The single cleanup path (goto out) ensures signal-handler restoration and more_available write-back happen in exactly one place — every error arm goes through it. *more_available is set to true if the result set was truncated by the daemon offset cap, the wall-clock deadline, signal-induced abort, or the buffer-fit guard; written only on success (the wrapper has already pre-zeroed it for error paths).