Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
log.h File Reference
#include <linux/list.h>
#include <linux/spinlock.h>
#include <linux/writeback.h>
#include "incore.h"

Go to the source code of this file.

Functions

unsigned int gfs2_struct2blk (struct gfs2_sbd *sdp, unsigned int nstruct, unsigned int ssize)
 
int gfs2_log_reserve (struct gfs2_sbd *sdp, unsigned int blks)
 
void gfs2_log_flush (struct gfs2_sbd *sdp, struct gfs2_glock *gl)
 
void gfs2_log_commit (struct gfs2_sbd *sdp, struct gfs2_trans *trans)
 
void gfs2_remove_from_ail (struct gfs2_bufdata *bd)
 
void gfs2_ail1_flush (struct gfs2_sbd *sdp, struct writeback_control *wbc)
 
void gfs2_log_shutdown (struct gfs2_sbd *sdp)
 
void gfs2_meta_syncfs (struct gfs2_sbd *sdp)
 
int gfs2_logd (void *data)
 

Function Documentation

void gfs2_ail1_flush ( struct gfs2_sbd sdp,
struct writeback_control wbc 
)

gfs2_ail1_flush - start writeback of some ail1 entries : The super block : The writeback control structure

Writes back some ail1 entries, according to the limits in the writeback control structure

Definition at line 144 of file log.c.

void gfs2_log_commit ( struct gfs2_sbd sdp,
struct gfs2_trans tr 
)

gfs2_log_commit - Commit a transaction to the log : the filesystem : the transaction

We wake up gfs2_logd if the number of pinned blocks exceed thresh1 or the total number of used blocks (pinned blocks plus AIL blocks) is greater than thresh2.

At mount time thresh1 is 1/3rd of journal size, thresh2 is 2/3rd of journal size.

Returns: errno

Definition at line 712 of file log.c.

void gfs2_log_flush ( struct gfs2_sbd sdp,
struct gfs2_glock gl 
)

gfs2_log_flush - flush incore transaction(s) : the filesystem : The glock structure to flush. If NULL, flush the whole incore log

Definition at line 605 of file log.c.

int gfs2_log_reserve ( struct gfs2_sbd sdp,
unsigned int  blks 
)

gfs2_log_reserve - Make a log reservation : The GFS2 superblock : The number of blocks to reserve

Note that we never give out the last few blocks of the journal. Thats due to the fact that there is a small number of header blocks associated with each log flush. The exact number can't be known until flush time, so we ensure that we have just enough free blocks at all times to avoid running out during a log flush.

We no longer flush the log here, instead we wake up logd to do that for us. To avoid the thundering herd and to ensure that we deal fairly with queued waiters, we use an exclusive wait. This means that when we get woken with enough journal space to get our reservation, we need to wake the next waiter on the list.

Returns: errno

Definition at line 318 of file log.c.

void gfs2_log_shutdown ( struct gfs2_sbd sdp)

gfs2_log_shutdown - write a shutdown header into a journal : the filesystem

Definition at line 729 of file log.c.

int gfs2_logd ( void data)

gfs2_logd - Update log tail as Active Items get flushed to in-place blocks : Pointer to GFS2 superblock

Also, periodically check to make sure that we're using the most recent journal index.

Definition at line 793 of file log.c.

void gfs2_meta_syncfs ( struct gfs2_sbd sdp)

gfs2_meta_syncfs - sync all the buffers in a filesystem : the filesystem

Definition at line 762 of file log.c.

void gfs2_remove_from_ail ( struct gfs2_bufdata bd)

gfs2_remove_from_ail - Remove an entry from the ail lists, updating counters : The associated mapping (maybe NULL) : The gfs2_bufdata to remove

The ail lock must be held when calling this function

Definition at line 74 of file log.c.

unsigned int gfs2_struct2blk ( struct gfs2_sbd sdp,
unsigned int  nstruct,
unsigned int  ssize 
)

gfs2_struct2blk - compute stuff : the filesystem : the number of structures : the size of the structures

Compute the number of log descriptor blocks needed to hold a certain number of structures of a certain size.

Returns: the number of blocks needed (minimum is always 1)

Definition at line 47 of file log.c.