• Home
  • Raw
  • Download

Lines Matching +full:rc +full:- +full:map +full:- +full:name

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Copyright (C) International Business Machines Corp., 2000-2004
18 * allocation map inode" (aka fileset inode):
21 * allocation map inode" (aka aggregate inode) where each inode
23 * on-disk inode in uniform way at both aggregate and fileset level;
33 * mntvfs -> fileset ipimap+ -> aggregate ipbmap -> aggregate ipaimap;
34 * fileset vfs -> vp(1) <-> ... <-> vp(n) <->vproot;
58 * NAME: jfs_mount(sb)
62 * PARAMETER: sb - super block
64 * RETURN: -EBUSY - device already mounted or open for write
65 * -EBUSY - cvrdvp already mounted;
66 * -EBUSY - mount table full
67 * -ENOTDIR- cvrdvp not directory on a device mount
68 * -ENXIO - device open failure
72 int rc = 0; /* Return code */ in jfs_mount() local
83 if ((rc = chkSuper(sb))) { in jfs_mount()
90 rc = -EIO; in jfs_mount()
93 sbi->ipaimap = ipaimap; in jfs_mount()
98 * initialize aggregate inode allocation map in jfs_mount()
100 if ((rc = diMount(ipaimap))) { in jfs_mount()
101 jfs_err("jfs_mount: diMount(ipaimap) failed w/rc = %d", rc); in jfs_mount()
106 * open aggregate block allocation map in jfs_mount()
110 rc = -EIO; in jfs_mount()
116 sbi->ipbmap = ipbmap; in jfs_mount()
119 * initialize aggregate block allocation map in jfs_mount()
121 if ((rc = dbMount(ipbmap))) { in jfs_mount()
122 jfs_err("jfs_mount: dbMount failed w/rc = %d", rc); in jfs_mount()
127 * open the secondary aggregate inode allocation map in jfs_mount()
129 * This is a duplicate of the aggregate inode allocation map. in jfs_mount()
137 if ((sbi->mntflag & JFS_BAD_SAIT) == 0) { in jfs_mount()
141 rc = -EIO; in jfs_mount()
144 sbi->ipaimap2 = ipaimap2; in jfs_mount()
149 * initialize secondary aggregate inode allocation map in jfs_mount()
151 if ((rc = diMount(ipaimap2))) { in jfs_mount()
152 jfs_err("jfs_mount: diMount(ipaimap2) failed, rc = %d", in jfs_mount()
153 rc); in jfs_mount()
158 sbi->ipaimap2 = NULL; in jfs_mount()
164 * open fileset inode allocation map (aka fileset inode) in jfs_mount()
169 /* open fileset secondary inode allocation map */ in jfs_mount()
170 rc = -EIO; in jfs_mount()
175 /* map further access of per fileset inodes by the fileset inode */ in jfs_mount()
176 sbi->ipimap = ipimap; in jfs_mount()
178 /* initialize fileset inode allocation map */ in jfs_mount()
179 if ((rc = diMount(ipimap))) { in jfs_mount()
180 jfs_err("jfs_mount: diMount failed w/rc = %d", rc); in jfs_mount()
189 errout41: /* close fileset inode allocation map inode */ in jfs_mount()
194 /* close secondary aggregate inode allocation map */ in jfs_mount()
202 /* close aggregate block allocation map */ in jfs_mount()
206 errout22: /* close aggregate inode allocation map */ in jfs_mount()
216 if (rc) in jfs_mount()
217 jfs_err("Mount JFS Failure: %d", rc); in jfs_mount()
219 return rc; in jfs_mount()
223 * NAME: jfs_mount_rw(sb, remount)
225 * FUNCTION: Completes read-write mount, or remounts read-only volume
226 * as read-write
231 int rc; in jfs_mount_rw() local
234 * If we are re-mounting a previously read-only volume, we want to in jfs_mount_rw()
235 * re-read the inode and block maps, since fsck.jfs may have updated in jfs_mount_rw()
239 if (chkSuper(sb) || (sbi->state != FM_CLEAN)) in jfs_mount_rw()
240 return -EINVAL; in jfs_mount_rw()
242 truncate_inode_pages(sbi->ipimap->i_mapping, 0); in jfs_mount_rw()
243 truncate_inode_pages(sbi->ipbmap->i_mapping, 0); in jfs_mount_rw()
244 diUnmount(sbi->ipimap, 1); in jfs_mount_rw()
245 if ((rc = diMount(sbi->ipimap))) { in jfs_mount_rw()
247 return rc; in jfs_mount_rw()
250 dbUnmount(sbi->ipbmap, 1); in jfs_mount_rw()
251 if ((rc = dbMount(sbi->ipbmap))) { in jfs_mount_rw()
253 return rc; in jfs_mount_rw()
260 if ((rc = lmLogOpen(sb))) in jfs_mount_rw()
261 return rc; in jfs_mount_rw()
266 if ((rc = updateSuper(sb, FM_MOUNT))) { in jfs_mount_rw()
267 jfs_err("jfs_mount: updateSuper failed w/rc = %d", rc); in jfs_mount_rw()
269 return rc; in jfs_mount_rw()
277 return rc; in jfs_mount_rw()
292 int rc = 0; in chkSuper() local
302 if ((rc = readSuper(sb, &bh))) in chkSuper()
303 return rc; in chkSuper()
304 j_sb = (struct jfs_superblock *)bh->b_data; in chkSuper()
310 if (strncmp(j_sb->s_magic, JFS_MAGIC, 4) || in chkSuper()
311 le32_to_cpu(j_sb->s_version) > JFS_VERSION) { in chkSuper()
312 rc = -EINVAL; in chkSuper()
316 bsize = le32_to_cpu(j_sb->s_bsize); in chkSuper()
320 rc = -EINVAL; in chkSuper()
326 le32_to_cpu(j_sb->s_flag), le32_to_cpu(j_sb->s_state), in chkSuper()
327 (unsigned long long) le64_to_cpu(j_sb->s_size)); in chkSuper()
330 if ((j_sb->s_flag & cpu_to_le32(JFS_BAD_SAIT)) != in chkSuper()
333 AIM_bytesize = lengthPXD(&(j_sb->s_aim2)) * bsize; in chkSuper()
335 AIT_bytesize = lengthPXD(&(j_sb->s_ait2)) * bsize; in chkSuper()
336 AIM_byte_addr = addressPXD(&(j_sb->s_aim2)) * bsize; in chkSuper()
337 AIT_byte_addr = addressPXD(&(j_sb->s_ait2)) * bsize; in chkSuper()
338 byte_addr_diff0 = AIT_byte_addr - AIM_byte_addr; in chkSuper()
339 fsckwsp_addr = addressPXD(&(j_sb->s_fsckpxd)) * bsize; in chkSuper()
340 byte_addr_diff1 = fsckwsp_addr - AIT_byte_addr; in chkSuper()
345 j_sb->s_flag |= cpu_to_le32(JFS_BAD_SAIT); in chkSuper()
348 if ((j_sb->s_flag & cpu_to_le32(JFS_GROUPCOMMIT)) != in chkSuper()
350 j_sb->s_flag |= cpu_to_le32(JFS_GROUPCOMMIT); in chkSuper()
353 if (j_sb->s_state != cpu_to_le32(FM_CLEAN) && in chkSuper()
356 rc = -EINVAL; in chkSuper()
360 sbi->state = le32_to_cpu(j_sb->s_state); in chkSuper()
361 sbi->mntflag = le32_to_cpu(j_sb->s_flag); in chkSuper()
367 sbi->bsize = bsize; in chkSuper()
368 sbi->l2bsize = le16_to_cpu(j_sb->s_l2bsize); in chkSuper()
371 if (sbi->l2bsize != ilog2((u32)bsize) || in chkSuper()
372 j_sb->pad != 0 || in chkSuper()
373 le32_to_cpu(j_sb->s_state) > FM_STATE_MAX) { in chkSuper()
374 rc = -EINVAL; in chkSuper()
383 sbi->nbperpage = PSIZE >> sbi->l2bsize; in chkSuper()
384 sbi->l2nbperpage = L2PSIZE - sbi->l2bsize; in chkSuper()
385 sbi->l2niperblk = sbi->l2bsize - L2DISIZE; in chkSuper()
386 if (sbi->mntflag & JFS_INLINELOG) in chkSuper()
387 sbi->logpxd = j_sb->s_logpxd; in chkSuper()
389 sbi->logdev = new_decode_dev(le32_to_cpu(j_sb->s_logdev)); in chkSuper()
390 uuid_copy(&sbi->uuid, &j_sb->s_uuid); in chkSuper()
391 uuid_copy(&sbi->loguuid, &j_sb->s_loguuid); in chkSuper()
393 sbi->fsckpxd = j_sb->s_fsckpxd; in chkSuper()
394 sbi->ait2 = j_sb->s_ait2; in chkSuper()
398 return rc; in chkSuper()
405 * update synchronously superblock if it is mounted read-write.
412 int rc; in updateSuper() local
414 if (sbi->flag & JFS_NOINTEGRITY) { in updateSuper()
416 sbi->p_state = state; in updateSuper()
419 sbi->p_state = sbi->state; in updateSuper()
422 state = sbi->p_state; in updateSuper()
425 } else if (sbi->state == FM_DIRTY) in updateSuper()
428 if ((rc = readSuper(sb, &bh))) in updateSuper()
429 return rc; in updateSuper()
431 j_sb = (struct jfs_superblock *)bh->b_data; in updateSuper()
433 j_sb->s_state = cpu_to_le32(state); in updateSuper()
434 sbi->state = state; in updateSuper()
438 j_sb->s_logdev = cpu_to_le32(new_encode_dev(sbi->log->bdev->bd_dev)); in updateSuper()
439 j_sb->s_logserial = cpu_to_le32(sbi->log->serial); in updateSuper()
445 if (j_sb->s_flag & cpu_to_le32(JFS_DASD_ENABLED)) in updateSuper()
446 j_sb->s_flag |= cpu_to_le32(JFS_DASD_PRIME); in updateSuper()
465 *bpp = sb_bread(sb, SUPER1_OFF >> sb->s_blocksize_bits); in readSuper()
470 *bpp = sb_bread(sb, SUPER2_OFF >> sb->s_blocksize_bits); in readSuper()
474 return -EIO; in readSuper()
490 * to update block allocation map at aggregate level.
494 struct jfs_log *log = JFS_SBI(sb)->log; in logMOUNT()
501 lrd.aggregate = cpu_to_le32(new_encode_dev(sb->s_bdev->bd_dev)); in logMOUNT()