diff options
author | David Disseldorp <ddiss@samba.org> | 2014-07-10 00:18:10 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2014-08-08 14:10:38 +0200 |
commit | 1e83435eac2cef03fccb4cf69ef5e0bfbd710410 (patch) | |
tree | e5b6e0d66d31cd223f1dda28d768b7c12a65c1be /source3/printing/pcap.c | |
parent | 9c5470be1e69af78c0c681fbb9a2d113039556f3 (diff) | |
download | samba-1e83435eac2cef03fccb4cf69ef5e0bfbd710410.tar.gz |
printing: traverse_read the printer list for share updates
The printcap update procedure involves the background printer process
obtaining the printcap information from the printing backend, writing
this to printer_list.tdb, and then notifying all smbd processes of the
new list. The processes then all attempt to simultaneously traverse
printer_list.tdb, in order to update their local share lists.
With a large number of printers, and a large number of per-client smbd
processes, this traversal results in significant lock contention, mostly
due to the fact that the traversal is unnecessarily done with an
exclusive (write) lock on the printer_list.tdb database.
This commit changes the share update code path to perform a read-only
traversal.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10652
Reported-by: Alex K <korobkin+samba@gmail.com>
Reported-by: Franz Pförtsch <franz.pfoertsch@brose.com>
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'source3/printing/pcap.c')
-rw-r--r-- | source3/printing/pcap.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source3/printing/pcap.c b/source3/printing/pcap.c index dd7ba624590..25dd4c70cde 100644 --- a/source3/printing/pcap.c +++ b/source3/printing/pcap.c @@ -229,11 +229,11 @@ void pcap_printer_fn_specific(const struct pcap_cache *pc, return; } -void pcap_printer_fn(void (*fn)(const char *, const char *, const char *, void *), void *pdata) +void pcap_printer_read_fn(void (*fn)(const char *, const char *, const char *, void *), void *pdata) { NTSTATUS status; - status = printer_list_run_fn(fn, pdata); + status = printer_list_read_run_fn(fn, pdata); if (!NT_STATUS_IS_OK(status)) { DEBUG(3, ("Failed to run fn for all printers!\n")); } |