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;
57 * NAME: jfs_mount(sb)
61 * PARAMETER: sb - super block
63 * RETURN: -EBUSY - device already mounted or open for write
64 * -EBUSY - cvrdvp already mounted;
65 * -EBUSY - mount table full
66 * -ENOTDIR- cvrdvp not directory on a device mount
67 * -ENXIO - device open failure
71 int rc = 0; /* Return code */ in jfs_mount() local
82 if ((rc = chkSuper(sb))) { in jfs_mount()
89 rc = -EIO; in jfs_mount()
92 sbi->ipaimap = ipaimap; in jfs_mount()
97 * initialize aggregate inode allocation map in jfs_mount()
99 if ((rc = diMount(ipaimap))) { in jfs_mount()
100 jfs_err("jfs_mount: diMount(ipaimap) failed w/rc = %d", rc); in jfs_mount()
105 * open aggregate block allocation map in jfs_mount()
109 rc = -EIO; in jfs_mount()
115 sbi->ipbmap = ipbmap; in jfs_mount()
118 * initialize aggregate block allocation map in jfs_mount()
120 if ((rc = dbMount(ipbmap))) { in jfs_mount()
121 jfs_err("jfs_mount: dbMount failed w/rc = %d", rc); in jfs_mount()
126 * open the secondary aggregate inode allocation map in jfs_mount()
128 * This is a duplicate of the aggregate inode allocation map. in jfs_mount()
136 if ((sbi->mntflag & JFS_BAD_SAIT) == 0) { in jfs_mount()
140 rc = -EIO; in jfs_mount()
143 sbi->ipaimap2 = ipaimap2; in jfs_mount()
148 * initialize secondary aggregate inode allocation map in jfs_mount()
150 if ((rc = diMount(ipaimap2))) { in jfs_mount()
151 jfs_err("jfs_mount: diMount(ipaimap2) failed, rc = %d", in jfs_mount()
152 rc); in jfs_mount()
157 sbi->ipaimap2 = NULL; in jfs_mount()
163 * open fileset inode allocation map (aka fileset inode) in jfs_mount()
168 /* open fileset secondary inode allocation map */ in jfs_mount()
169 rc = -EIO; in jfs_mount()
174 /* map further access of per fileset inodes by the fileset inode */ in jfs_mount()
175 sbi->ipimap = ipimap; in jfs_mount()
177 /* initialize fileset inode allocation map */ in jfs_mount()
178 if ((rc = diMount(ipimap))) { in jfs_mount()
179 jfs_err("jfs_mount: diMount failed w/rc = %d", rc); in jfs_mount()
188 errout41: /* close fileset inode allocation map inode */ in jfs_mount()
193 /* close secondary aggregate inode allocation map */ in jfs_mount()
201 /* close aggregate block allocation map */ in jfs_mount()
205 errout22: /* close aggregate inode allocation map */ in jfs_mount()
215 if (rc) in jfs_mount()
216 jfs_err("Mount JFS Failure: %d", rc); in jfs_mount()
218 return rc; in jfs_mount()
222 * NAME: jfs_mount_rw(sb, remount)
224 * FUNCTION: Completes read-write mount, or remounts read-only volume
225 * as read-write
230 int rc; in jfs_mount_rw() local
233 * If we are re-mounting a previously read-only volume, we want to in jfs_mount_rw()
234 * re-read the inode and block maps, since fsck.jfs may have updated in jfs_mount_rw()
238 if (chkSuper(sb) || (sbi->state != FM_CLEAN)) in jfs_mount_rw()
239 return -EINVAL; in jfs_mount_rw()
241 truncate_inode_pages(sbi->ipimap->i_mapping, 0); in jfs_mount_rw()
242 truncate_inode_pages(sbi->ipbmap->i_mapping, 0); in jfs_mount_rw()
243 diUnmount(sbi->ipimap, 1); in jfs_mount_rw()
244 if ((rc = diMount(sbi->ipimap))) { in jfs_mount_rw()
246 return rc; in jfs_mount_rw()
249 dbUnmount(sbi->ipbmap, 1); in jfs_mount_rw()
250 if ((rc = dbMount(sbi->ipbmap))) { in jfs_mount_rw()
252 return rc; in jfs_mount_rw()
259 if ((rc = lmLogOpen(sb))) in jfs_mount_rw()
260 return rc; in jfs_mount_rw()
265 if ((rc = updateSuper(sb, FM_MOUNT))) { in jfs_mount_rw()
266 jfs_err("jfs_mount: updateSuper failed w/rc = %d", rc); in jfs_mount_rw()
268 return rc; in jfs_mount_rw()
276 return rc; in jfs_mount_rw()
291 int rc = 0; in chkSuper() local
301 if ((rc = readSuper(sb, &bh))) in chkSuper()
302 return rc; in chkSuper()
303 j_sb = (struct jfs_superblock *)bh->b_data; in chkSuper()
309 if (strncmp(j_sb->s_magic, JFS_MAGIC, 4) || in chkSuper()
310 le32_to_cpu(j_sb->s_version) > JFS_VERSION) { in chkSuper()
311 rc = -EINVAL; in chkSuper()
315 bsize = le32_to_cpu(j_sb->s_bsize); in chkSuper()
319 rc = -EINVAL; in chkSuper()
325 le32_to_cpu(j_sb->s_flag), le32_to_cpu(j_sb->s_state), in chkSuper()
326 (unsigned long long) le64_to_cpu(j_sb->s_size)); in chkSuper()
329 if ((j_sb->s_flag & cpu_to_le32(JFS_BAD_SAIT)) != in chkSuper()
332 AIM_bytesize = lengthPXD(&(j_sb->s_aim2)) * bsize; in chkSuper()
334 AIT_bytesize = lengthPXD(&(j_sb->s_ait2)) * bsize; in chkSuper()
335 AIM_byte_addr = addressPXD(&(j_sb->s_aim2)) * bsize; in chkSuper()
336 AIT_byte_addr = addressPXD(&(j_sb->s_ait2)) * bsize; in chkSuper()
337 byte_addr_diff0 = AIT_byte_addr - AIM_byte_addr; in chkSuper()
338 fsckwsp_addr = addressPXD(&(j_sb->s_fsckpxd)) * bsize; in chkSuper()
339 byte_addr_diff1 = fsckwsp_addr - AIT_byte_addr; in chkSuper()
344 j_sb->s_flag |= cpu_to_le32(JFS_BAD_SAIT); in chkSuper()
347 if ((j_sb->s_flag & cpu_to_le32(JFS_GROUPCOMMIT)) != in chkSuper()
349 j_sb->s_flag |= cpu_to_le32(JFS_GROUPCOMMIT); in chkSuper()
352 if (j_sb->s_state != cpu_to_le32(FM_CLEAN) && in chkSuper()
355 rc = -EINVAL; in chkSuper()
359 sbi->state = le32_to_cpu(j_sb->s_state); in chkSuper()
360 sbi->mntflag = le32_to_cpu(j_sb->s_flag); in chkSuper()
366 sbi->bsize = bsize; in chkSuper()
367 sbi->l2bsize = le16_to_cpu(j_sb->s_l2bsize); in chkSuper()
373 sbi->nbperpage = PSIZE >> sbi->l2bsize; in chkSuper()
374 sbi->l2nbperpage = L2PSIZE - sbi->l2bsize; in chkSuper()
375 sbi->l2niperblk = sbi->l2bsize - L2DISIZE; in chkSuper()
376 if (sbi->mntflag & JFS_INLINELOG) in chkSuper()
377 sbi->logpxd = j_sb->s_logpxd; in chkSuper()
379 sbi->logdev = new_decode_dev(le32_to_cpu(j_sb->s_logdev)); in chkSuper()
380 uuid_copy(&sbi->uuid, &j_sb->s_uuid); in chkSuper()
381 uuid_copy(&sbi->loguuid, &j_sb->s_loguuid); in chkSuper()
383 sbi->fsckpxd = j_sb->s_fsckpxd; in chkSuper()
384 sbi->ait2 = j_sb->s_ait2; in chkSuper()
388 return rc; in chkSuper()
395 * update synchronously superblock if it is mounted read-write.
402 int rc; in updateSuper() local
404 if (sbi->flag & JFS_NOINTEGRITY) { in updateSuper()
406 sbi->p_state = state; in updateSuper()
409 sbi->p_state = sbi->state; in updateSuper()
412 state = sbi->p_state; in updateSuper()
415 } else if (sbi->state == FM_DIRTY) in updateSuper()
418 if ((rc = readSuper(sb, &bh))) in updateSuper()
419 return rc; in updateSuper()
421 j_sb = (struct jfs_superblock *)bh->b_data; in updateSuper()
423 j_sb->s_state = cpu_to_le32(state); in updateSuper()
424 sbi->state = state; in updateSuper()
428 j_sb->s_logdev = cpu_to_le32(new_encode_dev(sbi->log->bdev->bd_dev)); in updateSuper()
429 j_sb->s_logserial = cpu_to_le32(sbi->log->serial); in updateSuper()
435 if (j_sb->s_flag & cpu_to_le32(JFS_DASD_ENABLED)) in updateSuper()
436 j_sb->s_flag |= cpu_to_le32(JFS_DASD_PRIME); in updateSuper()
455 *bpp = sb_bread(sb, SUPER1_OFF >> sb->s_blocksize_bits); in readSuper()
460 *bpp = sb_bread(sb, SUPER2_OFF >> sb->s_blocksize_bits); in readSuper()
464 return -EIO; in readSuper()
480 * to update block allocation map at aggregate level.
484 struct jfs_log *log = JFS_SBI(sb)->log; in logMOUNT()
491 lrd.aggregate = cpu_to_le32(new_encode_dev(sb->s_bdev->bd_dev)); in logMOUNT()