Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Functions
drbd_actlog.c File Reference
#include <linux/slab.h>
#include <linux/drbd.h>
#include "drbd_int.h"
#include "drbd_wrappers.h"

Go to the source code of this file.

Data Structures

struct  al_transaction
 
struct  al_transaction::__packed
 
struct  update_odbm_work
 
struct  update_al_work
 
struct  drbd_atodb_wait
 

Functions

int w_al_write_transaction (struct drbd_conf *, struct drbd_work *, int)
 
voiddrbd_md_get_buffer (struct drbd_conf *mdev)
 
void drbd_md_put_buffer (struct drbd_conf *mdev)
 
void wait_until_done_or_disk_failure (struct drbd_conf *mdev, struct drbd_backing_dev *bdev, unsigned int *done)
 
int drbd_md_sync_page_io (struct drbd_conf *mdev, struct drbd_backing_dev *bdev, sector_t sector, int rw)
 
void drbd_al_begin_io (struct drbd_conf *mdev, sector_t sector)
 
void drbd_al_complete_io (struct drbd_conf *mdev, sector_t sector)
 
int drbd_al_read_log (struct drbd_conf *mdev, struct drbd_backing_dev *bdev)
 
void drbd_al_apply_to_bm (struct drbd_conf *mdev)
 
void drbd_al_shrink (struct drbd_conf *mdev)
 
void drbd_advance_rs_marks (struct drbd_conf *mdev, unsigned long still_to_go)
 
void __drbd_set_in_sync (struct drbd_conf *mdev, sector_t sector, int size, const char *file, const unsigned int line)
 
int __drbd_set_out_of_sync (struct drbd_conf *mdev, sector_t sector, int size, const char *file, const unsigned int line)
 
int drbd_rs_begin_io (struct drbd_conf *mdev, sector_t sector)
 
int drbd_try_rs_begin_io (struct drbd_conf *mdev, sector_t sector)
 
void drbd_rs_complete_io (struct drbd_conf *mdev, sector_t sector)
 
void drbd_rs_cancel_all (struct drbd_conf *mdev)
 
int drbd_rs_del_all (struct drbd_conf *mdev)
 
void drbd_rs_failed_io (struct drbd_conf *mdev, sector_t sector, int size)
 

Function Documentation

void __drbd_set_in_sync ( struct drbd_conf mdev,
sector_t  sector,
int  size,
const char file,
const unsigned int  line 
)

Definition at line 806 of file drbd_actlog.c.

int __drbd_set_out_of_sync ( struct drbd_conf mdev,
sector_t  sector,
int  size,
const char file,
const unsigned int  line 
)

Definition at line 871 of file drbd_actlog.c.

void drbd_advance_rs_marks ( struct drbd_conf mdev,
unsigned long  still_to_go 
)

Definition at line 783 of file drbd_actlog.c.

void drbd_al_apply_to_bm ( struct drbd_conf mdev)

drbd_al_apply_to_bm() - Sets the bitmap to diry(1) where covered ba active AL extents : DRBD device.

Definition at line 596 of file drbd_actlog.c.

void drbd_al_begin_io ( struct drbd_conf mdev,
sector_t  sector 
)

Definition at line 250 of file drbd_actlog.c.

void drbd_al_complete_io ( struct drbd_conf mdev,
sector_t  sector 
)

Definition at line 284 of file drbd_actlog.c.

int drbd_al_read_log ( struct drbd_conf mdev,
struct drbd_backing_dev bdev 
)

drbd_al_read_log() - Restores the activity log from its on disk representation. : DRBD device. : Block device to read form.

Returns 1 on success, returns 0 when reading the log failed due to IO errors.

Definition at line 472 of file drbd_actlog.c.

void drbd_al_shrink ( struct drbd_conf mdev)

drbd_al_shrink() - Removes all active extents form the activity log : DRBD device.

Removes all active extents form the activity log, waiting until the reference count of each entry dropped to 0 first, of course.

You need to lock mdev->act_log with lc_try_lock() / lc_unlock()

Definition at line 643 of file drbd_actlog.c.

void* drbd_md_get_buffer ( struct drbd_conf mdev)

Definition at line 68 of file drbd_actlog.c.

void drbd_md_put_buffer ( struct drbd_conf mdev)

Definition at line 79 of file drbd_actlog.c.

int drbd_md_sync_page_io ( struct drbd_conf mdev,
struct drbd_backing_dev bdev,
sector_t  sector,
int  rw 
)

Definition at line 148 of file drbd_actlog.c.

int drbd_rs_begin_io ( struct drbd_conf mdev,
sector_t  sector 
)

drbd_rs_begin_io() - Gets an extent in the resync LRU cache and sets it to BME_LOCKED : DRBD device. : The sector number.

This functions sleeps on al_wait. Returns 0 on success, -EINTR if interrupted.

Definition at line 997 of file drbd_actlog.c.

void drbd_rs_cancel_all ( struct drbd_conf mdev)

drbd_rs_cancel_all() - Removes all extents from the resync LRU (even BME_LOCKED) : DRBD device.

Definition at line 1189 of file drbd_actlog.c.

void drbd_rs_complete_io ( struct drbd_conf mdev,
sector_t  sector 
)

Definition at line 1151 of file drbd_actlog.c.

int drbd_rs_del_all ( struct drbd_conf mdev)

drbd_rs_del_all() - Gracefully remove all extents from the resync LRU : DRBD device.

Returns 0 upon success, -EAGAIN if at least one reference count was not zero.

Definition at line 1210 of file drbd_actlog.c.

void drbd_rs_failed_io ( struct drbd_conf mdev,
sector_t  sector,
int  size 
)

drbd_rs_failed_io() - Record information on a failure to resync the specified blocks : DRBD device. : The sector number. : Size of failed IO operation, in byte.

Definition at line 1261 of file drbd_actlog.c.

int drbd_try_rs_begin_io ( struct drbd_conf mdev,
sector_t  sector 
)

drbd_try_rs_begin_io() - Gets an extent in the resync LRU cache, does not sleep : DRBD device. : The sector number.

Gets an extent in the resync LRU cache, sets it to BME_NO_WRITES, then tries to set it to BME_LOCKED. Returns 0 upon success, and -EAGAIN if there is still application IO going on in this area.

Definition at line 1050 of file drbd_actlog.c.

int w_al_write_transaction ( struct drbd_conf mdev,
struct drbd_work w,
int  unused 
)

Definition at line 334 of file drbd_actlog.c.

void wait_until_done_or_disk_failure ( struct drbd_conf mdev,
struct drbd_backing_dev bdev,
unsigned int done 
)

Definition at line 91 of file drbd_actlog.c.