devcache.c revision 25e8c5aa2b496d9026e958ac731a610167574f59
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * CDDL HEADER START
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * The contents of this file are subject to the terms of the
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * Common Development and Distribution License (the "License").
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * You may not use this file except in compliance with the License.
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * See the License for the specific language governing permissions
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * and limitations under the License.
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * When distributing Covered Code, include this CDDL HEADER in each
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * If applicable, add the following below this CDDL HEADER, with the
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * fields enclosed by brackets "[]" replaced with your own identifying
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * information: Portions Copyright [yyyy] [name of copyright owner]
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * CDDL HEADER END
25e8c5aa2b496d9026e958ac731a610167574f59vikram * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * Use is subject to license terms.
83c4dfe9546fd839e7a52bca7e9920da918f916ejg#pragma ident "%Z%%M% %I% %E% SMI"
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * This facility provides interfaces to clients to register,
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * read and update cache data in persisted backing store files,
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * usually in /etc/devices. The data persisted through this
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * mechanism should be stateless data, functioning in the sense
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * of a cache. Writes are performed by a background daemon
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * thread, permitting a client to schedule an update without
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * blocking, then continue updating the data state in
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * parallel. The data is only locked by the daemon thread
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * to pack the data in preparation for the write.
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * Data persisted through this mechanism should be capable
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * of being regenerated through normal system operation,
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * for example attaching all disk devices would cause all
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * devids to be registered for those devices. By caching
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * a devid-device tuple, the system can operate in a
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * more optimal way, directly attaching the device mapped
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * to a devid, rather than burdensomely driving attach of
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * the entire device tree to discover a single device.
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * Note that a client should only need to include
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * <sys/devcache.h> for the supported interfaces.
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * The data per client is entirely within the control of
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * the client. When reading, data unpacked from the backing
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * store should be inserted in the list. The pointer to
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * the list can be retreived via nvf_list(). When writing,
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * the data on the list is to be packed and returned to the
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * nvpdaemon as an nvlist.
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * Obvious restrictions are imposed by the limits of the
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * nvlist format. The data cannot be read or written
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * piecemeal, and large amounts of data aren't recommended.
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * However, nvlists do allow that data be named and typed
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * and can be size-of-int invariant, and the cached data
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * can be versioned conveniently.
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * The registration involves two steps: a handle is
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * allocated by calling the registration function.
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * This sets up the data referenced by the handle and
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * initializes the lock. Following registration, the
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * client must initialize the data list. The list
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * interfaces require that the list element with offset
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * to the node link be provided. The format of the
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * list element is under the control of the client.
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * Locking: the address of the data list r/w lock provided
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * can be accessed with nvf_lock(). The lock must be held
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * as reader when traversing the list or checking state,
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * such as nvf_is_dirty(). The lock must be held as
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * writer when updating the list or marking it dirty.
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * The lock must not be held when waking the daemon.
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * The data r/w lock is held as writer when the pack,
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * unpack and free list handlers are called. The
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * lock should not be dropped and must be still held
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * upon return. The client should also hold the lock
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * as reader when checking if the list is dirty, and
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * as writer when marking the list dirty or initiating
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * The asynchronous nature of updates allows for the
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * possibility that the data may continue to be updated
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * once the daemon has been notified that an update is
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * desired. The data only needs to be locked against
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * updates when packing the data into the form to be
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * written. When the write of the packed data has
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * completed, the daemon will automatically reschedule
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * an update if the data was marked dirty after the
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * point at which it was packed. Before beginning an
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * update, the daemon attempts to lock the data as
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * writer; if the writer lock is already held, it
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * backs off and retries later. The model is to give
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * priority to the kernel processes generating the
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * data, and that the nature of the data is that
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * it does not change often, can be re-generated when
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * needed, so updates should not happen often and
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * can be delayed until the data stops changing.
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * The client may update the list or mark it dirty
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * any time it is able to acquire the lock as
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * writer first.
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * A failed write will be retried after some delay,
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * in the hope that the cause of the error will be
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * transient, for example a filesystem with no space
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * available. An update on a read-only filesystem
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * is failed silently and not retried; this would be
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * the case when booted off install media.
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * There is no unregister mechanism as of yet, as it
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * hasn't been needed so far.
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * Global list of files registered and updated by the nvpflush
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * daemon, protected by the nvf_cache_mutex. While an
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * update is taking place, a file is temporarily moved to
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * the dirty list to avoid locking the primary list for
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * the duration of the update.
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * Allow some delay from an update of the data before flushing
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * to permit simultaneous updates of multiple changes.
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * Changes in the data are expected to be bursty, ie
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * reconfig or hot-plug of a new adapter.
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * kfio_report_error (default 0)
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * Set to 1 to enable some error messages related to low-level
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * kernel file i/o operations.
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * nvpflush_delay (default 10)
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * The number of seconds after data is marked dirty before the
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * flush daemon is triggered to flush the data. A longer period
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * of time permits more data updates per write. Note that
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * every update resets the timer so no repository write will
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * occur while data is being updated continuously.
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * nvpdaemon_idle_time (default 60)
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * The number of seconds the daemon will sleep idle before exiting.
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * Tunables
83c4dfe9546fd839e7a52bca7e9920da918f916ejgint kfio_report_error = 0; /* kernel file i/o operations */
83c4dfe9546fd839e7a52bca7e9920da918f916ejgstatic int nvpflush_timer_busy = 0;
83c4dfe9546fd839e7a52bca7e9920da918f916ejgstatic int nvpflush_daemon_active = 0;
83c4dfe9546fd839e7a52bca7e9920da918f916ejgstatic int do_nvpflush = 0;
83c4dfe9546fd839e7a52bca7e9920da918f916ejgstatic int nvpbusy = 0;
83c4dfe9546fd839e7a52bca7e9920da918f916ejgstatic void nvpflush_daemon(void);
83c4dfe9546fd839e7a52bca7e9920da918f916ejg#endif /* DEBUG */
83c4dfe9546fd839e7a52bca7e9920da918f916ejgextern void mdi_read_devices_files(void);
83c4dfe9546fd839e7a52bca7e9920da918f916ejgextern void mdi_clean_vhcache(void);
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * Initialize the overall cache file management
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * Read cache files
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * The files read here should be restricted to those
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * that may be required to mount root.
25e8c5aa2b496d9026e958ac731a610167574f59vikram * The retire store should be the first file read as it
25e8c5aa2b496d9026e958ac731a610167574f59vikram * may need to offline devices. kfio_disable_read is not
25e8c5aa2b496d9026e958ac731a610167574f59vikram * used for retire. For the rationale see the tunable
25e8c5aa2b496d9026e958ac731a610167574f59vikram * ddi_retire_store_bypass and comments in:
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * Register a cache file to be managed and updated by the nvpflush daemon.
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * All operations are performed through the returned handle.
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * There is no unregister mechanism for now.
83c4dfe9546fd839e7a52bca7e9920da918f916ejg/*PRINTFLIKE1*/
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * Some operations clients may use to manage the data
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * to be persisted in a cache file.
83c4dfe9546fd839e7a52bca7e9920da918f916ejg while (n-- > 0)
83c4dfe9546fd839e7a52bca7e9920da918f916ejg n = kobj_read_file(file, (char *)&hdr, sizeof (hdr), offset);
83c4dfe9546fd839e7a52bca7e9920da918f916ejg if (n != sizeof (hdr)) {
83c4dfe9546fd839e7a52bca7e9920da918f916ejg if (n < 0) {
83c4dfe9546fd839e7a52bca7e9920da918f916ejg } else if (n == 0) {
83c4dfe9546fd839e7a52bca7e9920da918f916ejg KFDEBUG2((CE_CONT, "nvpf_magic: 0x%x\n", hdr.nvpf_magic));
83c4dfe9546fd839e7a52bca7e9920da918f916ejg KFDEBUG2((CE_CONT, "nvpf_version: %d\n", hdr.nvpf_version));
83c4dfe9546fd839e7a52bca7e9920da918f916ejg KFDEBUG2((CE_CONT, "nvpf_chksum: 0x%x\n", hdr.nvpf_chksum));
83c4dfe9546fd839e7a52bca7e9920da918f916ejg hdr.nvpf_version != NVPF_HDR_VERSION || hdrsum != cksum) {
83c4dfe9546fd839e7a52bca7e9920da918f916ejg "(actual 0x%x, expected 0x%x)\n",
83c4dfe9546fd839e7a52bca7e9920da918f916ejg if (n < 0) {
83c4dfe9546fd839e7a52bca7e9920da918f916ejg if (rval > 0) {
83c4dfe9546fd839e7a52bca7e9920da918f916ejg nvf_error("%s: checksum error (actual 0x%x, expected 0x%x)\n",
83c4dfe9546fd839e7a52bca7e9920da918f916ejg if (rval != 0) {
83c4dfe9546fd839e7a52bca7e9920da918f916ejg return (0);
83c4dfe9546fd839e7a52bca7e9920da918f916ejg if (rval != 0) {
83c4dfe9546fd839e7a52bca7e9920da918f916ejg return (0);
83c4dfe9546fd839e7a52bca7e9920da918f916ejg if (rval != 0) {
83c4dfe9546fd839e7a52bca7e9920da918f916ejgkfread(kfile_t *fp, char *buf, ssize_t bufsiz, ssize_t *ret_n)
83c4dfe9546fd839e7a52bca7e9920da918f916ejg err = vn_rdwr(UIO_READ, fp->kf_vp, buf, bufsiz, fp->kf_fpos,
83c4dfe9546fd839e7a52bca7e9920da918f916ejg if (err != 0) {
83c4dfe9546fd839e7a52bca7e9920da918f916ejg KFDEBUG1((CE_CONT, "%s: read %ld bytes ok %ld bufsiz, %ld resid\n",
83c4dfe9546fd839e7a52bca7e9920da918f916ejg return (0);
83c4dfe9546fd839e7a52bca7e9920da918f916ejgkfwrite(kfile_t *fp, char *buf, ssize_t bufsiz, ssize_t *ret_n)
83c4dfe9546fd839e7a52bca7e9920da918f916ejg for (;;) {
83c4dfe9546fd839e7a52bca7e9920da918f916ejg err = vn_rdwr(UIO_WRITE, fp->kf_vp, buf, len, fp->kf_fpos,
83c4dfe9546fd839e7a52bca7e9920da918f916ejg KFDEBUG1((CE_CONT, "%s: wrote %ld bytes ok\n", fp->kf_fname, n));
83c4dfe9546fd839e7a52bca7e9920da918f916ejg return (0);
83c4dfe9546fd839e7a52bca7e9920da918f916ejg if (rval != 0) {
83c4dfe9546fd839e7a52bca7e9920da918f916ejg rval = VOP_CLOSE(fp->kf_vp, fp->kf_vnflags, 1, (offset_t)0, kcred);
83c4dfe9546fd839e7a52bca7e9920da918f916ejg if (rval != 0) {
83c4dfe9546fd839e7a52bca7e9920da918f916ejg KFDEBUG((CE_CONT, "renaming %s to %s\n", oldname, newname));
83c4dfe9546fd839e7a52bca7e9920da918f916ejg if ((rval = vn_rename(oldname, newname, UIO_SYSSPACE)) != 0) {
83c4dfe9546fd839e7a52bca7e9920da918f916ejg err = nvlist_pack(nvl, &nvbuf, &buflen, NV_ENCODE_NATIVE, 0);
83c4dfe9546fd839e7a52bca7e9920da918f916ejg if (err != 0) {
83c4dfe9546fd839e7a52bca7e9920da918f916ejg buf = kmem_alloc(sizeof (nvpf_hdr_t) + buflen, KM_SLEEP);
83c4dfe9546fd839e7a52bca7e9920da918f916ejg ((nvpf_hdr_t *)buf)->nvpf_chksum = nvp_cksum((uchar_t *)nvbuf, buflen);
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * To make it unlikely we suffer data loss, write
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * data to the new temporary file. Once successful
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * complete the transaction by renaming the new file
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * to replace the previous.
83c4dfe9546fd839e7a52bca7e9920da918f916ejg if (n != buflen) {
83c4dfe9546fd839e7a52bca7e9920da918f916ejg "%s: partial write %ld of %ld bytes\n",
83c4dfe9546fd839e7a52bca7e9920da918f916ejg if (err != 0) {
83c4dfe9546fd839e7a52bca7e9920da918f916ejg if (err == 0) {
83c4dfe9546fd839e7a52bca7e9920da918f916ejg if ((err = fwrite_nvlist(nvfd->nvf_cache_path, nvl)) == 0)
83c4dfe9546fd839e7a52bca7e9920da918f916ejgstatic void
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * Read a file in the nvlist format
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * EIO - i/o error during read
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * ENOENT - file not found
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * EINVAL - file contents corrupted
83c4dfe9546fd839e7a52bca7e9920da918f916ejg if (rval != 0) {
83c4dfe9546fd839e7a52bca7e9920da918f916ejg "nvpair_value_nvlist error %s %d\n",
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * unpack nvlist for this device and
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * add elements to data list.
83c4dfe9546fd839e7a52bca7e9920da918f916ejg if (rv != 0) {
83c4dfe9546fd839e7a52bca7e9920da918f916ejg "%s: %s invalid list element\n",
83c4dfe9546fd839e7a52bca7e9920da918f916ejg return (0);
83c4dfe9546fd839e7a52bca7e9920da918f916ejg return (0);
83c4dfe9546fd839e7a52bca7e9920da918f916ejg KFDEBUG((CE_CONT, "reading %s\n", nvfd->nvf_cache_path));
83c4dfe9546fd839e7a52bca7e9920da918f916ejg switch (rval) {
83c4dfe9546fd839e7a52bca7e9920da918f916ejgstatic void
83c4dfe9546fd839e7a52bca7e9920da918f916ejg/*ARGSUSED*/
83c4dfe9546fd839e7a52bca7e9920da918f916ejgstatic void
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * After marking a list as dirty, wake the nvpflush daemon
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * to perform the update.
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * If the system isn't up yet
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * don't even think about starting a flush.
83c4dfe9546fd839e7a52bca7e9920da918f916ejg NVPDAEMON_DEBUG((CE_CONT, "starting nvpdaemon thread\n"));
83c4dfe9546fd839e7a52bca7e9920da918f916ejg nvpflush_id = timeout(nvpflush_timeout, NULL, nticks + 4);
83c4dfe9546fd839e7a52bca7e9920da918f916ejg "%s nvlist construction failed\n", nvfd->nvf_cache_path);
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * The file may need to be flushed again if the cached
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * data was touched while writing the earlier contents.
83c4dfe9546fd839e7a52bca7e9920da918f916ejgstatic void
83c4dfe9546fd839e7a52bca7e9920da918f916ejg CALLB_CPR_INIT(&cprinfo, &nvpflush_lock, callb_generic_cpr, "nvp");
83c4dfe9546fd839e7a52bca7e9920da918f916ejg for (;;) {
83c4dfe9546fd839e7a52bca7e9920da918f916ejg while (do_nvpflush == 0) {
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * Note that CALLB_CPR_EXIT calls mutex_exit()
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * on the lock passed in to CALLB_CPR_INIT,
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * so the lock must be held when invoking it.
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * Try flushing what's dirty, reschedule if there's
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * a failure or data gets marked as dirty again.
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * First move each file marked dirty to the dirty
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * list to avoid locking the list across the write.
83c4dfe9546fd839e7a52bca7e9920da918f916ejg "nvpdaemon: not dirty %s\n",
83c4dfe9546fd839e7a52bca7e9920da918f916ejg * Now go through the dirty list
83c4dfe9546fd839e7a52bca7e9920da918f916ejg "nvpdaemon: flush %s\n",
83c4dfe9546fd839e7a52bca7e9920da918f916ejg "nvpdaemon: %s dirty again\n",
83c4dfe9546fd839e7a52bca7e9920da918f916ejg "nvpdaemon: not dirty %s\n",