JOURNAL_TRY_TO_FREE_BUFFERS

Section: (9)
Updated: 17 July 2003
Index Return to Main Contents

 

NAME

journal_try_to_free_buffers - try to free page buffers.  

SYNOPSIS

int journal_try_to_free_buffers (journal_t * journal, struct page * page, int unused_gfp_mask);  

ARGUMENTS

journal
journal for operation
page
to try and free
unused_gfp_mask
-- undescribed --
 

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?  

ABOUT THIS DOCUMENT

This documentation is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

For more details see the file COPYING in the source distribution of Linux.

If you have comments on the formatting of this manpage, then please contact Michael Still (mikal@stillhq.com).

This documentation was generated with kernel version 2.5.75.


 

Index

NAME
SYNOPSIS
ARGUMENTS
DESCRIPTION
ABOUT THIS DOCUMENT

This document was created by man2html, using the manual pages.
Time: 03:31:01 GMT, July 17, 2003