History log of /fs/nilfs2/sufile.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
5fc7b14177b1a1c2f2511aed62a4ca870d0332e7 04-May-2011 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: use mark_buffer_dirty to mark btnode or meta data dirty

This replaces nilfs_mdt_mark_buffer_dirty and nilfs_btnode_mark_dirty
macros with mark_buffer_dirty and gets rid of nilfs_mark_buffer_dirty,
an own mark buffer dirty function.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
/fs/nilfs2/sufile.c
0ef28f9aec4dccfba33cef74412f601c1b48b658 04-May-2011 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: get rid of NILFS_I_NILFS

This replaces all references of NILFS_I_NILFS(inode)->ns_bdev with
inode->i_sb->s_bdev and unfolds remaining uses of NILFS_I_NILFS inline
function.

Before 2.6.37, referring to a nilfs object from inodes needed a
conditional judgement, and NILFS_I_NILFS was helpful to simplify it.
But now we can simply do it by going through a super block instance
like inode->i_sb->s_fs_info.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
/fs/nilfs2/sufile.c
4e33f9eab07e985282fece4121066c2db1d332ed 04-May-2011 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: implement resize ioctl

This adds resize ioctl which makes online resize possible.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
/fs/nilfs2/sufile.c
78eb64c2479e0f408b725c3c8e1cdf557857af48 04-May-2011 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: add truncation routine of segment usage file

When shrinking the filesystem, segments to be truncated must be test
if they are busy or not, and unneeded sufile block should be deleted.
This adds routines for the truncation.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
/fs/nilfs2/sufile.c
619205da5b567504310daf829dede1187fa29bbc 04-May-2011 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: add ioctl which limits range of segment to be allocated

This adds a new ioctl command which limits range of segment to be
allocated. This is intended to gather data whithin a range of the
partition before shrinking the filesystem, or to control new log
location for some purpose.

If a range is specified by the ioctl, segment allocator of nilfs tries
to allocate new segments from the range unless no free segments are
available there.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
/fs/nilfs2/sufile.c
c6e071884aca360a14c21757d760e76ec34b4894 04-Sep-2010 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: get rid of mi_nilfs back pointer to nilfs object

This removes a back pointer to nilfs object from nilfs_mdt_info
structure that is attached to metadata files.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
/fs/nilfs2/sufile.c
f1e89c86fdd0f5e59f6768146c86437934202033 04-Sep-2010 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: use iget for all metadata files

This makes use of iget5_locked to allocate or get inode for metadata
files to stop using own inode allocator.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
/fs/nilfs2/sufile.c
7a65004bbaa6a21a0438aac9c64814e46084dc3f 13-Mar-2010 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: fix various typos in comments

This fixes various typos I found in comments of nilfs2.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
/fs/nilfs2/sufile.c
f021759d74d71bacc73fc3e00d6e3d35e1f2e123 18-Nov-2009 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: clean up get/put function of a segment usage

This eliminates obsolete nilfs_get_sufile_get_segment_usage() and
nilfs_set_sufile_segment_usage() from sufile.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
/fs/nilfs2/sufile.c
071ec54dd730307ee0e703a105872b9a1c6fd2aa 18-Nov-2009 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: move routine to set segment usage into sufile

This adds nilfs_sufile_set_segment_usage() function in sufile to
replace direct access to the sufile metadata in log writer code.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
/fs/nilfs2/sufile.c
61a189e9c62359cd12b2aa3bd6ab9cffa6cf2745 18-Nov-2009 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: move routine marking segment usage dirty into sufile

This adds nilfs_sufile_mark_dirty() function in sufile to replace
nilfs_touch_segusage() function in log writer code. This is a
preparation for the further cleanup which will move out low level
sufile operations in the log writer.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
/fs/nilfs2/sufile.c
ef7d4757a5b7b07a3a0d30d3ba6b587e574b28b9 13-Nov-2009 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: simplify nilfs_sufile_get_ncleansegs function

Previously, this function took an status code to return possible error
codes. The ("nilfs2: add local variable to cache the number of clean
segments") patch removed the possibility to return errors.

So, this simplifies the function definition to make it directly return
the number of clean segments.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
/fs/nilfs2/sufile.c
aa474a220180d997caafcee372770d6ed6bf798a 12-Nov-2009 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: add local variable to cache the number of clean segments

This makes it possible for sufile to get the number of clean segments
faster.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
/fs/nilfs2/sufile.c
7b16c8a211c87d465c48ea324928f8057590b853 12-Nov-2009 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: unfold nilfs_sufile_block_get_header function

This unfolds the nilfs_sufile_block_get_header() function for
simplicity.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
/fs/nilfs2/sufile.c
8707df38478c8e0958b706f0ea1cdf99d00a9469 12-Nov-2009 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: separate read method of meta data files on super root block

Will displace nilfs_mdt_read_inode_direct function with an individual
read method: nilfs_dat_read, nilfs_sufile_read, nilfs_cpfile_read.

This provides the opportunity to initialize local variables of each
metadata file after reading the inode.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
/fs/nilfs2/sufile.c
79739565e15f2adbc482207a0800fc127c84d1a0 12-Nov-2009 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: separate constructor of metadata files

This will displace nilfs_mdt_new() constructor with individual
metadata file constructors like nilfs_dat_new(), new_sufile_new(),
nilfs_cpfile_new(), and nilfs_ifile_new().

This makes it possible for each metadata file to have own
intialization code.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
/fs/nilfs2/sufile.c
003ff182fddde09ddfb8d079bbdb02f9d2122082 11-May-2009 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: allow future expansion of metadata read out via get info ioctl

Nilfs has some ioctl commands to read out metadata from meta data
files:

- NILFS_IOCTL_GET_CPINFO for checkpoint file,
- NILFS_IOCTL_GET_SUINFO for segment usage file, and
- NILFS_IOCTL_GET_VINFO for Disk Address Transalation (DAT) file,
respectively.

Every routine on these metadata files is implemented so that it allows
future expansion of on-disk format. But, the above ioctl commands do
not support expansion even though nilfs_argv structure can handle
arbitrary size for data exchanged via ioctl.

This allows future expansion of the following structures which give
basic format of the "get information" ioctls:

- struct nilfs_cpinfo
- struct nilfs_suinfo
- struct nilfs_vinfo

So, this introduces forward compatility of such ioctl commands.

In this patch, a sanity check in nilfs_ioctl_get_info() function is
changed to accept larger data structure [1], and metadata read
routines are rewritten so that they become compatible for larger
structures; the routines will just ignore the remaining fields which
the current version of nilfs doesn't know.

[1] The ioctl function already has another upper limit (PAGE_SIZE
against a structure, which appears in nilfs_ioctl_wrap_copy
function), and this will not cause security problem.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
/fs/nilfs2/sufile.c
dda54f4b872512eba484c38631bd6ae5b5716f41 16-May-2009 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: add sufile function that can modify multiple segment usages

This is a preparation for the later cleanup patch ("nilfs2: remove
list of freeing segments").

This adds nilfs_sufile_updatev() to sufile, which can modify multiple
segment usages at a time.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
/fs/nilfs2/sufile.c
c85399c2da8b86de8f6877980294fa1a4a88a5a4 05-Apr-2009 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: fix possible mismatch of sufile counters on recovery

On-disk counters ndirtysegs and ncleansegs of sufile, can go wrong
after roll-forward recovery because
nilfs_prepare_segment_for_recovery() function marks segments dirty
without adjusting value of these counters.

This fixes the problem by adding a function to sufile which does the
operation adjusting the counters, and by letting the recovery function
use it.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
/fs/nilfs2/sufile.c
a703018f7bbec8109419318f5d51f235fdce5155 05-Apr-2009 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: segment usage file cleanups

This will simplify sufile.c by sharing common code which repeatedly
appears in routines updating a segment usage entry; a wrapper function
nilfs_sufile_update() is introduced for the purpose, and counter
modifications are integrated to a new function
nilfs_sufile_mod_counter().

This is a preparation for the successive bugfix patch ("nilfs2: fix
possible mismatch of sufile counters on recovery").

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
/fs/nilfs2/sufile.c
88072faf9a32c92f37c15065496bb6eb309aebe3 05-Apr-2009 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: fix wrong accounting and duplicate brelse in nilfs_sufile_set_error

The nilfs_sufile_set_error() function wrongly adjusts the number of
dirty segments instead of the number of clean segments. In addition,
the function calls brelse() twice for the same buffer head.

This fixes these bugs.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
/fs/nilfs2/sufile.c
3efb55b496952e0d29a9ec66d0ceaab175c4e8ca 29-Mar-2009 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: simplify handling of active state of segments fix

This fixes a bug of ("nilfs2: simplify handling of active state of
segments") patch. The patch did not take account that a base index is
increased in nilfs_sufile_get_suinfo() function if requested entries
go across block boundary on sufile.

Due to this bug, the active flag sometimes appears on wrong segments
and has induced malfunction of garbage collection.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
/fs/nilfs2/sufile.c
cece552074c591970353ad48308d65f110aeaf28 07-Apr-2009 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: simplify handling of active state of segments

will reduce some lines of segment constructor. Previously, the state was
complexly controlled through a list of segments in order to keep
consistency in meta data of usage state of segments. Instead, this
presents ``calculated'' active flags to userland cleaner program and stop
maintaining its real flag on disk.

Only by this fake flag, the cleaner cannot exactly know if each segment is
reclaimable or not. However, the recent extension of nilfs_sustat ioctl
struct (nilfs2-extend-nilfs_sustat-ioctl-struct.patch) can prevent the
cleaner from reclaiming in-use segment wrongly.

So, now I can apply this for simplification.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
/fs/nilfs2/sufile.c
1f5abe7e7dbcd83e73212c6cb135a6106cea6a0b 07-Apr-2009 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: replace BUG_ON and BUG calls triggerable from ioctl

Pekka Enberg advised me:
> It would be nice if BUG(), BUG_ON(), and panic() calls would be
> converted to proper error handling using WARN_ON() calls. The BUG()
> call in nilfs_cpfile_delete_checkpoints(), for example, looks to be
> triggerable from user-space via the ioctl() system call.

This will follow the comment and keep them to a minimum.

Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
/fs/nilfs2/sufile.c
2c2e52fc4fca251e68f90821c9ff5cb18be4df58 07-Apr-2009 Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> nilfs2: extend nilfs_sustat ioctl struct

This adds a new argument to the nilfs_sustat structure.

The extended field allows to delete volatile active state of segments,
which was needed to protect freshly-created segments from garbage
collection but has confused code dealing with segments. This
extension alleviates the mess and gives room for further
simplifications.

The volatile active flag is not persistent, so it's eliminable on this
occasion without affecting compatibility other than the ioctl change.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
/fs/nilfs2/sufile.c
6c98cd4ecb0ae35f0368c5c2190712689c2064aa 07-Apr-2009 Koji Sato <sato.koji@lab.ntt.co.jp> nilfs2: segment usage file

This adds a meta data file which stores the allocation state of segments.

[konishi.ryusuke@lab.ntt.co.jp: fix wrong counting of checkpoints and dirty segments]
Signed-off-by: Koji Sato <sato.koji@lab.ntt.co.jp>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
/fs/nilfs2/sufile.c