Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

journal_try_to_free_buffers(9) [centos man page]

JOURNAL_TRY_TO_FREE_(9) 				     The Linux Journalling API					   JOURNAL_TRY_TO_FREE_(9)

NAME
journal_try_to_free_buffers - try to free page buffers. SYNOPSIS
int journal_try_to_free_buffers(journal_t * journal, struct page * page, gfp_t gfp_mask); ARGUMENTS
journal journal for operation page to try and free gfp_mask we use the mask to detect how hard should we try to release buffers. If __GFP_WAIT and __GFP_FS is set, we wait for commit code to release the buffers. DESCRIPTION
For all the buffers on this page, if they are fully written out ordered data, move them onto BUF_CLEAN so try_to_free_buffers can reap them. This function returns non-zero if we wish try_to_free_buffers to be called. We do this if the page is releasable by try_to_free_buffers. We also do it if the page has locked or dirty buffers and the caller wants us to perform sync or async writeout. This complicates JBD locking somewhat. We aren't protected by the BKL here. We wish to remove the buffer from its committing or running transaction's ->t_datalist via __journal_unfile_buffer. This may *change* the value of transaction_t->t_datalist, so anyone who looks at t_datalist needs to lock against this function. Even worse, someone may be doing a journal_dirty_data on this buffer. So we need to lock against that. journal_dirty_data will come out of the lock with the buffer dirty, which makes it ineligible for release here. Who else is affected by this? hmm... Really the only contender is do_get_write_access - it could be looking at the buffer while journal_try_to_free_buffer is changing its state. But that cannot happen because we never reallocate freed data as metadata while the data is part of a transaction. Yes? Return 0 on failure, 1 on success AUTHORS
Roger Gammans <rgammans@computer-surgery.co.uk> Author. Stephen Tweedie <sct@redhat.com> Author. COPYRIGHT
Kernel Hackers Manual 3.10 June 2014 JOURNAL_TRY_TO_FREE_(9)

Check Out this Related Man Page

STRUCT 
JOURNAL_S(9) The Linux Journalling API STRUCT JOURNAL_S(9) NAME
struct_journal_s - this is the concrete type associated with journal_t. SYNOPSIS
struct journal_s { unsigned long j_flags; int j_errno; struct buffer_head * j_sb_buffer; journal_superblock_t * j_superblock; int j_format_version; spinlock_t j_state_lock; int j_barrier_count; struct mutex j_barrier; transaction_t * j_running_transaction; transaction_t * j_committing_transaction; transaction_t * j_checkpoint_transactions; wait_queue_head_t j_wait_transaction_locked; wait_queue_head_t j_wait_logspace; wait_queue_head_t j_wait_done_commit; wait_queue_head_t j_wait_checkpoint; wait_queue_head_t j_wait_commit; wait_queue_head_t j_wait_updates; struct mutex j_checkpoint_mutex; unsigned int j_head; unsigned int j_tail; unsigned int j_free; unsigned int j_first; unsigned int j_last; struct block_device * j_dev; int j_blocksize; unsigned int j_blk_offset; struct block_device * j_fs_dev; unsigned int j_maxlen; spinlock_t j_list_lock; struct inode * j_inode; tid_t j_tail_sequence; tid_t j_transaction_sequence; tid_t j_commit_sequence; tid_t j_commit_request; __u8 j_uuid[16]; struct task_struct * j_task; int j_max_transaction_buffers; unsigned long j_commit_interval; struct timer_list j_commit_timer; spinlock_t j_revoke_lock; struct jbd_revoke_table_s * j_revoke; struct jbd_revoke_table_s * j_revoke_table[2]; struct buffer_head ** j_wbuf; int j_wbufsize; pid_t j_last_sync_writer; u64 j_average_commit_time; void * j_private; }; MEMBERS
j_flags General journaling state flags j_errno Is there an outstanding uncleared error on the journal (from a prior abort)? j_sb_buffer First part of superblock buffer j_superblock Second part of superblock buffer j_format_version Version of the superblock format j_state_lock Protect the various scalars in the journal j_barrier_count Number of processes waiting to create a barrier lock j_barrier The barrier lock itself j_running_transaction The current running transaction.. j_committing_transaction the transaction we are pushing to disk j_checkpoint_transactions a linked circular list of all transactions waiting for checkpointing j_wait_transaction_locked Wait queue for waiting for a locked transaction to start committing, or for a barrier lock to be released j_wait_logspace Wait queue for waiting for checkpointing to complete j_wait_done_commit Wait queue for waiting for commit to complete j_wait_checkpoint Wait queue to trigger checkpointing j_wait_commit Wait queue to trigger commit j_wait_updates Wait queue to wait for updates to complete j_checkpoint_mutex Mutex for locking against concurrent checkpoints j_head Journal head - identifies the first unused block in the journal j_tail Journal tail - identifies the oldest still-used block in the journal. j_free Journal free - how many free blocks are there in the journal? j_first The block number of the first usable block j_last The block number one beyond the last usable block j_dev Device where we store the journal j_blocksize blocksize for the location where we store the journal. j_blk_offset starting block offset for into the device where we store the journal j_fs_dev Device which holds the client fs. For internal journal this will be equal to j_dev j_maxlen Total maximum capacity of the journal region on disk. j_list_lock Protects the buffer lists and internal buffer state. j_inode Optional inode where we store the journal. If present, all journal block numbers are mapped into this inode via bmap. j_tail_sequence Sequence number of the oldest transaction in the log j_transaction_sequence Sequence number of the next transaction to grant j_commit_sequence Sequence number of the most recently committed transaction j_commit_request Sequence number of the most recent transaction wanting commit j_uuid[16] Uuid of client object. j_task Pointer to the current commit thread for this journal j_max_transaction_buffers Maximum number of metadata buffers to allow in a single compound commit transaction j_commit_interval What is the maximum transaction lifetime before we begin a commit? j_commit_timer The timer used to wakeup the commit thread j_revoke_lock Protect the revoke table j_revoke The revoke table - maintains the list of revoked blocks in the current transaction. j_revoke_table[2] alternate revoke tables for j_revoke j_wbuf array of buffer_heads for journal_commit_transaction j_wbufsize maximum number of buffer_heads allowed in j_wbuf, the number that will fit in j_blocksize j_last_sync_writer most recent pid which did a synchronous write j_average_commit_time the average amount of time in nanoseconds it takes to commit a transaction to the disk. j_private An opaque pointer to fs-private information. AUTHORS
Roger Gammans <rgammans@computer-surgery.co.uk> Author. Stephen Tweedie <sct@redhat.com> Author. COPYRIGHT
Kernel Hackers Manual 2.6. July 2010 STRUCT JOURNAL_S(9)
Man Page