2
* Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved.
2
* Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved.
4
4
* This program is free software; you can redistribute it and/or modify it
5
5
* under the terms of version 2 of the GNU General Public License as
6
6
* published by the Free Software Foundation.
8
8
* This program is distributed in the hope that it would be useful, but
9
9
* WITHOUT ANY WARRANTY; without even the implied warranty of
10
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
12
* Further, this software is distributed without any warranty that it is
13
13
* free of the rightful claim of any third person regarding infringement
14
14
* or the like. Any license provided herein, whether implied or
15
15
* otherwise, applies only to this software file. Patent licenses, if
16
16
* any, provided herein do not apply to combinations of this program with
17
17
* other software, or any other product whatsoever.
19
19
* You should have received a copy of the GNU General Public License along
20
20
* with this program; if not, write the Free Software Foundation, Inc., 59
21
21
* Temple Place - Suite 330, Boston MA 02111-1307, USA.
23
23
* Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
24
24
* Mountain View, CA 94043, or:
28
* For further information regarding this notice, see:
28
* For further information regarding this notice, see:
30
30
* http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
121
121
int agi_dirty = 0;
123
bp = libxfs_readbuf(mp->m_dev, XFS_AG_DADDR(mp, agno, XFS_AGI_DADDR),
124
mp->m_sb.sb_sectsize/BBSIZE, 0);
126
do_error("cannot read agi block %lld for ag %u\n",
127
XFS_AG_DADDR(mp, agno, XFS_AGI_DADDR), agno);
123
bp = libxfs_readbuf(mp->m_dev,
124
XFS_AG_DADDR(mp, agno, XFS_AGI_DADDR(mp)),
125
mp->m_sb.sb_sectsize/BBSIZE, 0);
127
do_error(_("cannot read agi block %lld for ag %u\n"),
128
XFS_AG_DADDR(mp, agno, XFS_AGI_DADDR(mp)), agno);
131
130
agip = XFS_BUF_TO_AGI(bp);
135
134
for (i = 0; i < XFS_AGI_UNLINKED_BUCKETS; i++) {
136
135
if (INT_GET(agip->agi_unlinked[i], ARCH_CONVERT) != NULLAGINO) {
137
err += walk_unlinked_list(mp, agno,
138
INT_GET(agip->agi_unlinked[i], ARCH_CONVERT));
136
err += walk_unlinked_list(mp, agno, INT_GET(
137
agip->agi_unlinked[i], ARCH_CONVERT));
142
141
if (!no_modify) {
143
INT_SET(agip->agi_unlinked[i], ARCH_CONVERT, NULLAGINO);
142
INT_SET(agip->agi_unlinked[i], ARCH_CONVERT,
150
do_warn("error following ag %d unlinked list\n", agno);
150
do_warn(_("error following ag %d unlinked list\n"), agno);
152
152
ASSERT(agi_dirty == 0 || (agi_dirty && !no_modify));
165
printf("Phase 3 - for each AG...\n");
165
do_log(_("Phase 3 - for each AG...\n"));
167
printf(" - scan and clear agi unlinked lists...\n");
167
do_log(_(" - scan and clear agi unlinked lists...\n"));
169
printf(" - scan (but don't clear) agi unlinked lists...\n");
169
do_log(_(" - scan (but don't clear) agi unlinked lists...\n"));
172
172
* first, let's look at the possibly bogus inodes
182
182
/* ok, now that the tree's ok, let's take a good look */
185
" - process known inodes and perform inode discovery...\n");
185
" - process known inodes and perform inode discovery...\n"));
187
187
for (i = 0; i < mp->m_sb.sb_agcount; i++) {
188
do_log(" - agno = %d\n", i);
188
do_log(_(" - agno = %d\n"), i);
190
* turn on directory processing (inode discovery) and
190
* turn on directory processing (inode discovery) and
191
191
* attribute processing (extra_attr_check)
193
193
process_aginodes(mp, i, 1, 0, 1);