'Basic validation of request and mount check.
This function will be called before attempting to acquire a
replication semaphore lock, so contains only quick checks.'

def initialize_request(self):

    self.request.environ['eventlet.minimum_write_chunk_size'] = 0
    (self.device, self.partition, self.policy) = request_helpers.get_name_and_placement(self.request, 2, 2, False)
    self.frag_index = self.node_index = None
    if self.request.headers.get('X-Backend-Ssync-Frag-Index'):
        try:
            self.frag_index = int(self.request.headers['X-Backend-Ssync-Frag-Index'])
        except ValueError:
            raise swob.HTTPBadRequest(('Invalid    X-Backend-Ssync-Frag-Index    %r' % self.request.headers['X-Backend-Ssync-Frag-Index']))
    if self.request.headers.get('X-Backend-Ssync-Node-Index'):
        try:
            self.node_index = int(self.request.headers['X-Backend-Ssync-Node-Index'])
        except ValueError:
            raise swob.HTTPBadRequest(('Invalid    X-Backend-Ssync-Node-Index    %r' % self.request.headers['X-Backend-Ssync-Node-Index']))
        if (self.node_index != self.frag_index):
            raise swob.HTTPBadRequest(('Frag-Index    (%s)    !=    Node-Index    (%s)' % (self.frag_index, self.node_index)))
    utils.validate_device_partition(self.device, self.partition)
    self.diskfile_mgr = self.app._diskfile_router[self.policy]
    if (not self.diskfile_mgr.get_dev_path(self.device)):
        raise swob.HTTPInsufficientStorage(drive=self.device)
    self.fp = self.request.environ['wsgi.input']
