Blame vdo/kernel/dataKVIO.h

Packit Service 310c69
/*
Packit Service 310c69
 * Copyright (c) 2020 Red Hat, Inc.
Packit Service 310c69
 *
Packit Service 310c69
 * This program is free software; you can redistribute it and/or
Packit Service 310c69
 * modify it under the terms of the GNU General Public License
Packit Service 310c69
 * as published by the Free Software Foundation; either version 2
Packit Service 310c69
 * of the License, or (at your option) any later version.
Packit Service 310c69
 * 
Packit Service 310c69
 * This program is distributed in the hope that it will be useful,
Packit Service 310c69
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 310c69
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit Service 310c69
 * GNU General Public License for more details.
Packit Service 310c69
 * 
Packit Service 310c69
 * You should have received a copy of the GNU General Public License
Packit Service 310c69
 * along with this program; if not, write to the Free Software
Packit Service 310c69
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
Packit Service 310c69
 * 02110-1301, USA. 
Packit Service 310c69
 *
Packit Service 310c69
 * $Id: //eng/vdo-releases/aluminum/src/c++/vdo/kernel/dataKVIO.h#5 $
Packit Service 310c69
 */
Packit Service 310c69
Packit Service 310c69
#ifndef DATA_KVIO_H
Packit Service 310c69
#define DATA_KVIO_H
Packit Service 310c69
Packit Service 310c69
#include "dataVIO.h"
Packit Service 310c69
#include "kvio.h"
Packit Service 310c69
#include "uds-block.h"
Packit Service 310c69
Packit Service 310c69
typedef struct {
Packit Service 310c69
  /*
Packit Service 310c69
   * The BIO which was received from the device mapper to initiate an I/O
Packit Service 310c69
   * request. This field will be non-NULL only until the request is
Packit Service 310c69
   * acknowledged.
Packit Service 310c69
   */
Packit Service 310c69
  BIO           *bio;
Packit Service 310c69
  // Cached copies of fields from the bio which will need to be reset after
Packit Service 310c69
  // we're done.
Packit Service 310c69
  void          *private;
Packit Service 310c69
  void          *endIO;
Packit Service 310c69
  // This is a copy of the bi_rw field of the BIO which sadly is not just
Packit Service 310c69
  // a boolean read-write flag, but also includes other flag bits.
Packit Service 310c69
  unsigned long  rw;
Packit Service 310c69
} ExternalIORequest;
Packit Service 310c69
Packit Service 310c69
/* Dedupe support */
Packit Service 310c69
struct dedupeContext {
Packit Service 310c69
  UdsRequest          udsRequest;
Packit Service 310c69
  struct list_head    pendingList;
Packit Service 310c69
  Jiffies             submissionTime;
Packit Service 310c69
  Atomic32            requestState;
Packit Service 310c69
  int                 status;
Packit Service 310c69
  bool                isPending;
Packit Service 310c69
  /** Hash of the associated VIO (NULL if not calculated) */
Packit Service 310c69
  const UdsChunkName *chunkName;
Packit Service 310c69
};
Packit Service 310c69
Packit Service 310c69
typedef struct {
Packit Service 310c69
  /**
Packit Service 310c69
   * A pointer to a block that holds the data from the last read operation.
Packit Service 310c69
   **/
Packit Service 310c69
  char                *data;
Packit Service 310c69
  /**
Packit Service 310c69
   * Temporary storage for doing reads from the underlying device.
Packit Service 310c69
   **/
Packit Service 310c69
  char                *buffer;
Packit Service 310c69
  /**
Packit Service 310c69
   * A bio structure wrapping the buffer.
Packit Service 310c69
   **/
Packit Service 310c69
  BIO                 *bio;
Packit Service 310c69
  /**
Packit Service 310c69
   * Callback to invoke after completing the read I/O operation.
Packit Service 310c69
   **/
Packit Service 310c69
  DataKVIOCallback     callback;
Packit Service 310c69
  /**
Packit Service 310c69
   * Mapping state passed to kvdoReadBlock(), used to determine whether
Packit Service 310c69
   * the data must be uncompressed.
Packit Service 310c69
   **/
Packit Service 310c69
  BlockMappingState    mappingState;
Packit Service 310c69
  /**
Packit Service 310c69
   * The result code of the read attempt.
Packit Service 310c69
   **/
Packit Service 310c69
  int                  status;
Packit Service 310c69
} ReadBlock;
Packit Service 310c69
Packit Service 310c69
struct dataKVIO {
Packit Service 310c69
  /* The embedded base code's DataVIO */
Packit Service 310c69
  DataVIO            dataVIO;
Packit Service 310c69
  /* The embedded KVIO */
Packit Service 310c69
  KVIO               kvio;
Packit Service 310c69
  /* The BIO from the request which is being serviced by this KVIO. */
Packit Service 310c69
  ExternalIORequest  externalIORequest;
Packit Service 310c69
  /* Dedupe */
Packit Service 310c69
  DedupeContext      dedupeContext;
Packit Service 310c69
  /* Read cache */
Packit Service 310c69
  ReadBlock          readBlock;
Packit Service 310c69
  /* partial block support */
Packit Service 310c69
  BlockSize          offset;
Packit Service 310c69
  bool               isPartial;
Packit Service 310c69
  /* discard support */
Packit Service 310c69
  bool               hasDiscardPermit;
Packit Service 310c69
  DiscardSize        remainingDiscard;
Packit Service 310c69
  /**
Packit Service 310c69
   * A copy of user data written, so we can do additional processing
Packit Service 310c69
   * (dedupe, compression) after acknowledging the I/O operation and
Packit Service 310c69
   * thus losing access to the original data.
Packit Service 310c69
   *
Packit Service 310c69
   * Also used as buffer space for read-modify-write cycles when
Packit Service 310c69
   * emulating smaller-than-blockSize I/O operations.
Packit Service 310c69
   **/
Packit Service 310c69
  char              *dataBlock;
Packit Service 310c69
  /** A bio structure describing the #dataBlock buffer. */
Packit Service 310c69
  BIO               *dataBlockBio;
Packit Service 310c69
  /** A block used as output during compression or uncompression. */
Packit Service 310c69
  char              *scratchBlock;
Packit Service 310c69
};
Packit Service 310c69
Packit Service 310c69
/**
Packit Service 310c69
 * Convert a KVIO to a DataKVIO.
Packit Service 310c69
 *
Packit Service 310c69
 * @param kvio  The KVIO to convert
Packit Service 310c69
 *
Packit Service 310c69
 * @return The KVIO as a DataKVIO
Packit Service 310c69
 **/
Packit Service 310c69
static inline DataKVIO *kvioAsDataKVIO(KVIO *kvio)
Packit Service 310c69
{
Packit Service 310c69
  ASSERT_LOG_ONLY(isData(kvio), "KVIO is a DataKVIO");
Packit Service 310c69
  return container_of(kvio, DataKVIO, kvio);
Packit Service 310c69
}
Packit Service 310c69
Packit Service 310c69
/**
Packit Service 310c69
 * Convert a DataKVIO to a KVIO.
Packit Service 310c69
 *
Packit Service 310c69
 * @param dataKVIO  The DataKVIO to convert
Packit Service 310c69
 *
Packit Service 310c69
 * @return The DataKVIO as a KVIO
Packit Service 310c69
 **/
Packit Service 310c69
static inline KVIO *dataKVIOAsKVIO(DataKVIO *dataKVIO)
Packit Service 310c69
{
Packit Service 310c69
  return &dataKVIO->kvio;
Packit Service 310c69
}
Packit Service 310c69
Packit Service 310c69
/**
Packit Service 310c69
 * Returns a pointer to the DataKVIO wrapping a DataVIO.
Packit Service 310c69
 *
Packit Service 310c69
 * @param dataVIO  the DataVIO
Packit Service 310c69
 *
Packit Service 310c69
 * @return the DataKVIO
Packit Service 310c69
 **/
Packit Service 310c69
static inline DataKVIO *dataVIOAsDataKVIO(DataVIO *dataVIO)
Packit Service 310c69
{
Packit Service 310c69
  return container_of(dataVIO, DataKVIO, dataVIO);
Packit Service 310c69
}
Packit Service 310c69
Packit Service 310c69
/**
Packit Service 310c69
 * Returns a pointer to the KVIO associated with a DataVIO.
Packit Service 310c69
 *
Packit Service 310c69
 * @param dataVIO  the DataVIO
Packit Service 310c69
 *
Packit Service 310c69
 * @return the KVIO
Packit Service 310c69
 **/
Packit Service 310c69
static inline KVIO *dataVIOAsKVIO(DataVIO *dataVIO)
Packit Service 310c69
{
Packit Service 310c69
  return dataKVIOAsKVIO(dataVIOAsDataKVIO(dataVIO));
Packit Service 310c69
}
Packit Service 310c69
Packit Service 310c69
/**
Packit Service 310c69
 * Returns a pointer to the DataKVIO wrapping a work item.
Packit Service 310c69
 *
Packit Service 310c69
 * @param item  the work item
Packit Service 310c69
 *
Packit Service 310c69
 * @return the DataKVIO
Packit Service 310c69
 **/
Packit Service 310c69
static inline DataKVIO *workItemAsDataKVIO(KvdoWorkItem *item)
Packit Service 310c69
{
Packit Service 310c69
  return kvioAsDataKVIO(workItemAsKVIO(item));
Packit Service 310c69
}
Packit Service 310c69
Packit Service 310c69
/**
Packit Service 310c69
 * Get the WorkItem from a DataKVIO.
Packit Service 310c69
 *
Packit Service 310c69
 * @param dataKVIO  The DataKVIO
Packit Service 310c69
 *
Packit Service 310c69
 * @return the DataKVIO's work item
Packit Service 310c69
 **/
Packit Service 310c69
static inline KvdoWorkItem *workItemFromDataKVIO(DataKVIO *dataKVIO)
Packit Service 310c69
{
Packit Service 310c69
  return &dataKVIOAsKVIO(dataKVIO)->enqueueable.workItem;
Packit Service 310c69
}
Packit Service 310c69
Packit Service 310c69
/**
Packit Service 310c69
 * Get the BIO from a DataKVIO.
Packit Service 310c69
 *
Packit Service 310c69
 * @param dataKVIO  The DataKVIO from which to get the BIO
Packit Service 310c69
 *
Packit Service 310c69
 * @return The DataKVIO's BIO
Packit Service 310c69
 **/
Packit Service 310c69
static inline BIO *getBIOFromDataKVIO(DataKVIO *dataKVIO)
Packit Service 310c69
{
Packit Service 310c69
  return dataKVIOAsKVIO(dataKVIO)->bio;
Packit Service 310c69
}
Packit Service 310c69
Packit Service 310c69
/**
Packit Service 310c69
 * Get the KernelLayer from a DataKVIO.
Packit Service 310c69
 *
Packit Service 310c69
 * @param dataKVIO  The DataKVIO from which to get the KernelLayer
Packit Service 310c69
 *
Packit Service 310c69
 * @return The DataKVIO's KernelLayer
Packit Service 310c69
 **/
Packit Service 310c69
static inline KernelLayer *getLayerFromDataKVIO(DataKVIO *dataKVIO)
Packit Service 310c69
{
Packit Service 310c69
  return dataKVIOAsKVIO(dataKVIO)->layer;
Packit Service 310c69
}
Packit Service 310c69
Packit Service 310c69
/**
Packit Service 310c69
 * Set up and enqueue a DataKVIO's work item to be processed in the base code
Packit Service 310c69
 * context.
Packit Service 310c69
 *
Packit Service 310c69
 * @param dataKVIO       The DataKVIO with the work item to be run
Packit Service 310c69
 * @param work           The function pointer to execute
Packit Service 310c69
 * @param statsFunction  A function pointer to record for stats, or NULL
Packit Service 310c69
 * @param action         Action code, mapping to a relative priority
Packit Service 310c69
 **/
Packit Service 310c69
static inline void enqueueDataKVIO(DataKVIO         *dataKVIO,
Packit Service 310c69
                                   KvdoWorkFunction  work,
Packit Service 310c69
                                   void             *statsFunction,
Packit Service 310c69
                                   unsigned int      action)
Packit Service 310c69
{
Packit Service 310c69
  enqueueKVIO(dataKVIOAsKVIO(dataKVIO), work, statsFunction, action);
Packit Service 310c69
}
Packit Service 310c69
Packit Service 310c69
/**
Packit Service 310c69
 * Enqueue a DataKVIO on a work queue.
Packit Service 310c69
 *
Packit Service 310c69
 * @param queue     The queue
Packit Service 310c69
 * @param dataKVIO  The DataKVIO
Packit Service 310c69
 **/
Packit Service 310c69
static inline void enqueueDataKVIOWork(KvdoWorkQueue *queue,
Packit Service 310c69
                                       DataKVIO      *dataKVIO)
Packit Service 310c69
{
Packit Service 310c69
  enqueueKVIOWork(queue, dataKVIOAsKVIO(dataKVIO));
Packit Service 310c69
}
Packit Service 310c69
Packit Service 310c69
/**
Packit Service 310c69
 * Add a trace record for the current source location.
Packit Service 310c69
 *
Packit Service 310c69
 * @param dataKVIO  The DataKVIO structure to be updated
Packit Service 310c69
 * @param location  The source-location descriptor to be recorded
Packit Service 310c69
 **/
Packit Service 310c69
static inline void dataKVIOAddTraceRecord(DataKVIO      *dataKVIO,
Packit Service 310c69
                                          TraceLocation  location)
Packit Service 310c69
{
Packit Service 310c69
  dataVIOAddTraceRecord(&dataKVIO->dataVIO, location);
Packit Service 310c69
}
Packit Service 310c69
Packit Service 310c69
/**
Packit Service 310c69
 * Set up and enqueue a DataKVIO on the CPU queue.
Packit Service 310c69
 *
Packit Service 310c69
 * @param dataKVIO       The DataKVIO to set up
Packit Service 310c69
 * @param work           The function pointer to execute
Packit Service 310c69
 * @param statsFunction  A function pointer to record for stats, or NULL
Packit Service 310c69
 * @param action         Action code, mapping to a relative priority
Packit Service 310c69
 **/
Packit Service 310c69
static inline void launchDataKVIOOnCPUQueue(DataKVIO         *dataKVIO,
Packit Service 310c69
                                            KvdoWorkFunction  work,
Packit Service 310c69
                                            void             *statsFunction,
Packit Service 310c69
                                            unsigned int      action)
Packit Service 310c69
{
Packit Service 310c69
  KVIO *kvio = dataKVIOAsKVIO(dataKVIO);
Packit Service 310c69
  launchKVIO(kvio, work, statsFunction, action, kvio->layer->cpuQueue);
Packit Service 310c69
}
Packit Service 310c69
Packit Service 310c69
/**
Packit Service 310c69
 * Set up and enqueue a DataKVIO on the BIO Ack queue.
Packit Service 310c69
 *
Packit Service 310c69
 * @param dataKVIO       The DataKVIO to set up
Packit Service 310c69
 * @param work           The function pointer to execute
Packit Service 310c69
 * @param statsFunction  A function pointer to record for stats, or NULL
Packit Service 310c69
 * @param action         Action code, mapping to a relative priority
Packit Service 310c69
 **/
Packit Service 310c69
static inline void launchDataKVIOOnBIOAckQueue(DataKVIO         *dataKVIO,
Packit Service 310c69
                                               KvdoWorkFunction  work,
Packit Service 310c69
                                               void             *statsFunction,
Packit Service 310c69
                                               unsigned int      action)
Packit Service 310c69
{
Packit Service 310c69
  KVIO *kvio = dataKVIOAsKVIO(dataKVIO);
Packit Service 310c69
  launchKVIO(kvio, work, statsFunction, action, kvio->layer->bioAckQueue);
Packit Service 310c69
}
Packit Service 310c69
Packit Service 310c69
/**
Packit Service 310c69
 * Move a DataKVIO back to the base threads.
Packit Service 310c69
 *
Packit Service 310c69
 * @param dataKVIO The DataKVIO to enqueue
Packit Service 310c69
 **/
Packit Service 310c69
static inline void kvdoEnqueueDataVIOCallback(DataKVIO *dataKVIO)
Packit Service 310c69
{
Packit Service 310c69
  kvdoEnqueueVIOCallback(dataKVIOAsKVIO(dataKVIO));
Packit Service 310c69
}
Packit Service 310c69
Packit Service 310c69
/**
Packit Service 310c69
 * Check whether the external request bio had FUA set.
Packit Service 310c69
 *
Packit Service 310c69
 * @param dataKVIO  The DataKVIO to check
Packit Service 310c69
 *
Packit Service 310c69
 * @return true if the external request bio had FUA set
Packit Service 310c69
 **/
Packit Service 310c69
static inline bool requestorSetFUA(DataKVIO *dataKVIO)
Packit Service 310c69
{
Packit Service 310c69
  return ((dataKVIO->externalIORequest.rw & REQ_FUA) == REQ_FUA);
Packit Service 310c69
}
Packit Service 310c69
Packit Service 310c69
/**
Packit Service 310c69
 * Associate a KVIO with a BIO passed in from the block layer, and start
Packit Service 310c69
 * processing the KVIO.
Packit Service 310c69
 *
Packit Service 310c69
 * If setting up a KVIO fails, a message is logged, and the limiter permits
Packit Service 310c69
 * (request and maybe discard) released, but the caller is responsible for
Packit Service 310c69
 * disposing of the bio.
Packit Service 310c69
 *
Packit Service 310c69
 * @param layer                 The physical layer
Packit Service 310c69
 * @param bio                   The bio for which to create KVIO
Packit Service 310c69
 * @param arrivalTime           The time (in jiffies) when the external request
Packit Service 310c69
 *                              entered the device mapbio function
Packit Service 310c69
 * @param hasDiscardPermit      Whether we got a permit from the discardLimiter
Packit Service 310c69
 *                              of the kernel layer
Packit Service 310c69
 *
Packit Service 310c69
 * @return VDO_SUCCESS or a system error code
Packit Service 310c69
 **/
Packit Service 310c69
int kvdoLaunchDataKVIOFromBio(KernelLayer *layer,
Packit Service 310c69
                              BIO         *bio,
Packit Service 310c69
                              Jiffies      arrivalTime,
Packit Service 310c69
                              bool         hasDiscardPermit)
Packit Service 310c69
  __attribute__((warn_unused_result));
Packit Service 310c69
Packit Service 310c69
/**
Packit Service 310c69
 * Return a batch of DataKVIOs to the pool.
Packit Service 310c69
 *
Packit Service 310c69
 * 

Implements BatchProcessorCallback.

Packit Service 310c69
 *
Packit Service 310c69
 * @param batch    The batch processor
Packit Service 310c69
 * @param closure  The kernal layer
Packit Service 310c69
 **/
Packit Service 310c69
void returnDataKVIOBatchToPool(BatchProcessor *batch, void *closure);
Packit Service 310c69
Packit Service 310c69
/**
Packit Service 310c69
 * Implements DataVIOZeroer.
Packit Service 310c69
 *
Packit Service 310c69
 * @param dataVIO  The DataVIO to zero
Packit Service 310c69
 **/
Packit Service 310c69
void kvdoZeroDataVIO(DataVIO *dataVIO);
Packit Service 310c69
Packit Service 310c69
/**
Packit Service 310c69
 * Implements DataCopier.
Packit Service 310c69
 *
Packit Service 310c69
 * @param source       The DataVIO to copy from
Packit Service 310c69
 * @param destination  The DataVIO to copy to
Packit Service 310c69
 **/
Packit Service 310c69
void kvdoCopyDataVIO(DataVIO *source, DataVIO *destination);
Packit Service 310c69
Packit Service 310c69
/**
Packit Service 310c69
 * Fetch the data for a block from storage. The fetched data will be
Packit Service 310c69
 * uncompressed when the callback is called, and the result of the read
Packit Service 310c69
 * operation will be stored in the ReadBlock's status field. On success,
Packit Service 310c69
 * the data will be in the ReadBlock's data pointer.
Packit Service 310c69
 *
Packit Service 310c69
 * @param dataVIO       The DataVIO to read a block in for
Packit Service 310c69
 * @param location      The physical block number to read from
Packit Service 310c69
 * @param mappingState  The mapping state of the block to read
Packit Service 310c69
 * @param action        The bio queue action
Packit Service 310c69
 * @param callback      The function to call when the read is done
Packit Service 310c69
 **/
Packit Service 310c69
void kvdoReadBlock(DataVIO             *dataVIO,
Packit Service 310c69
                   PhysicalBlockNumber  location,
Packit Service 310c69
                   BlockMappingState    mappingState,
Packit Service 310c69
                   BioQAction           action,
Packit Service 310c69
                   DataKVIOCallback     callback);
Packit Service 310c69
Packit Service 310c69
/**
Packit Service 310c69
 * Implements DataReader.
Packit Service 310c69
 *
Packit Service 310c69
 * @param dataVIO  The DataVIO to read
Packit Service 310c69
 **/
Packit Service 310c69
void kvdoReadDataVIO(DataVIO *dataVIO);
Packit Service 310c69
Packit Service 310c69
/**
Packit Service 310c69
 * Implements DataWriter.
Packit Service 310c69
 *
Packit Service 310c69
 * @param dataVIO  The DataVIO to write
Packit Service 310c69
 **/
Packit Service 310c69
void kvdoWriteDataVIO(DataVIO *dataVIO);
Packit Service 310c69
Packit Service 310c69
/**
Packit Service 310c69
 * Implements DataModifier.
Packit Service 310c69
 *
Packit Service 310c69
 * @param dataVIO  The DataVIO to modify
Packit Service 310c69
 **/
Packit Service 310c69
void kvdoModifyWriteDataVIO(DataVIO *dataVIO);
Packit Service 310c69
Packit Service 310c69
/**
Packit Service 310c69
 * Implements DataHasher.
Packit Service 310c69
 *
Packit Service 310c69
 * @param dataVIO  The DataVIO to hash
Packit Service 310c69
 **/
Packit Service 310c69
void kvdoHashDataVIO(DataVIO *dataVIO);
Packit Service 310c69
Packit Service 310c69
/**
Packit Service 310c69
 * Implements DuplicationChecker.
Packit Service 310c69
 *
Packit Service 310c69
 * @param dataVIO  The DataVIO containing the block to check
Packit Service 310c69
 **/
Packit Service 310c69
void kvdoCheckForDuplication(DataVIO *dataVIO);
Packit Service 310c69
Packit Service 310c69
/**
Packit Service 310c69
 * Implements DataAcknowledger.
Packit Service 310c69
 *
Packit Service 310c69
 * @param dataVIO  The DataVIO to acknowledge
Packit Service 310c69
 **/
Packit Service 310c69
void kvdoAcknowledgeDataVIO(DataVIO *dataVIO);
Packit Service 310c69
Packit Service 310c69
/**
Packit Service 310c69
 * Implements DataCompressor.
Packit Service 310c69
 *
Packit Service 310c69
 * @param dataVIO  The DataVIO to compress
Packit Service 310c69
 **/
Packit Service 310c69
void kvdoCompressDataVIO(DataVIO *dataVIO);
Packit Service 310c69
Packit Service 310c69
/**
Packit Service 310c69
 * Implements AlbireoUpdater.
Packit Service 310c69
 *
Packit Service 310c69
 * @param dataVIO  The DataVIO which needs to change the entry for its data
Packit Service 310c69
 **/
Packit Service 310c69
void kvdoUpdateDedupeAdvice(DataVIO *dataVIO);
Packit Service 310c69
Packit Service 310c69
/**
Packit Service 310c69
 * Allocate a buffer pool of DataKVIOs.
Packit Service 310c69
 *
Packit Service 310c69
 * @param [in]  layer          The layer in which the DataKVIOs will operate
Packit Service 310c69
 * @param [in]  poolSize       The number of DataKVIOs in the pool
Packit Service 310c69
 * @param [out] bufferPoolPtr  A pointer to hold the new buffer pool
Packit Service 310c69
 *
Packit Service 310c69
 * @return VDO_SUCCESS or an error
Packit Service 310c69
 **/
Packit Service 310c69
int makeDataKVIOBufferPool(KernelLayer  *layer,
Packit Service 310c69
                           uint32_t      poolSize,
Packit Service 310c69
                           BufferPool  **bufferPoolPtr)
Packit Service 310c69
  __attribute__((warn_unused_result));
Packit Service 310c69
Packit Service 310c69
/**
Packit Service 310c69
 * Get the state needed to generate UDS metadata from the DataKVIO
Packit Service 310c69
 * associated with a DedupeContext.
Packit Service 310c69
 *
Packit Service 310c69
 * @param context  The DedupeContext
Packit Service 310c69
 *
Packit Service 310c69
 * @return the advice to store in the UDS index
Packit Service 310c69
 **/
Packit Service 310c69
DataLocation getDedupeAdvice(const DedupeContext *context)
Packit Service 310c69
  __attribute__((warn_unused_result));
Packit Service 310c69
Packit Service 310c69
/**
Packit Service 310c69
 * Set the result of a dedupe query for the DataKVIO associated with a
Packit Service 310c69
 * DedupeContext.
Packit Service 310c69
 *
Packit Service 310c69
 * @param context  The context receiving advice
Packit Service 310c69
 * @param advice   A data location at which the chunk named in the context
Packit Service 310c69
 *                 might be stored (will be NULL if no advice was found)
Packit Service 310c69
 **/
Packit Service 310c69
void setDedupeAdvice(DedupeContext *context, const DataLocation *advice);
Packit Service 310c69
Packit Service 310c69
#endif /* DATA_KVIO_H */