the_nilfs.c (888da23c2f70ca2e9897b725322a6456285ee9c4) the_nilfs.c (365e215ce1f154e288ff0f7c9acbdf5421f57949)
1/*
2 * the_nilfs.c - the_nilfs shared structure.
3 *
4 * Copyright (C) 2005-2008 Nippon Telegraph and Telephone Corporation.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or

--- 636 unchanged lines hidden (view full) ---

645 start * sects_per_block,
646 nblocks * sects_per_block,
647 GFP_NOFS, 0);
648 return ret;
649}
650
651int nilfs_count_free_blocks(struct the_nilfs *nilfs, sector_t *nblocks)
652{
1/*
2 * the_nilfs.c - the_nilfs shared structure.
3 *
4 * Copyright (C) 2005-2008 Nippon Telegraph and Telephone Corporation.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or

--- 636 unchanged lines hidden (view full) ---

645 start * sects_per_block,
646 nblocks * sects_per_block,
647 GFP_NOFS, 0);
648 return ret;
649}
650
651int nilfs_count_free_blocks(struct the_nilfs *nilfs, sector_t *nblocks)
652{
653 struct inode *dat = nilfs_dat_inode(nilfs);
654 unsigned long ncleansegs;
655
653 unsigned long ncleansegs;
654
656 down_read(&NILFS_MDT(dat)->mi_sem); /* XXX */
655 down_read(&NILFS_MDT(nilfs->ns_dat)->mi_sem);
657 ncleansegs = nilfs_sufile_get_ncleansegs(nilfs->ns_sufile);
656 ncleansegs = nilfs_sufile_get_ncleansegs(nilfs->ns_sufile);
658 up_read(&NILFS_MDT(dat)->mi_sem); /* XXX */
657 up_read(&NILFS_MDT(nilfs->ns_dat)->mi_sem);
659 *nblocks = (sector_t)ncleansegs * nilfs->ns_blocks_per_segment;
660 return 0;
661}
662
663int nilfs_near_disk_full(struct the_nilfs *nilfs)
664{
665 unsigned long ncleansegs, nincsegs;
666

--- 96 unchanged lines hidden ---
658 *nblocks = (sector_t)ncleansegs * nilfs->ns_blocks_per_segment;
659 return 0;
660}
661
662int nilfs_near_disk_full(struct the_nilfs *nilfs)
663{
664 unsigned long ncleansegs, nincsegs;
665

--- 96 unchanged lines hidden ---