Lines Matching +full:rc +full:- +full:map +full:- +full:name
2 * Copyright (C) International Business Machines Corp., 2000-2004
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
31 * allocation map inode" (aka fileset inode):
34 * allocation map inode" (aka aggregate inode) where each inode
36 * on-disk inode in uniform way at both aggregate and fileset level;
46 * mntvfs -> fileset ipimap+ -> aggregate ipbmap -> aggregate ipaimap;
47 * fileset vfs -> vp(1) <-> ... <-> vp(n) <->vproot;
69 * NAME: jfs_mount(sb)
73 * PARAMETER: sb - super block
75 * RETURN: -EBUSY - device already mounted or open for write
76 * -EBUSY - cvrdvp already mounted;
77 * -EBUSY - mount table full
78 * -ENOTDIR- cvrdvp not directory on a device mount
79 * -ENXIO - device open failure
83 int rc = 0; /* Return code */ in jfs_mount() local
94 if ((rc = chkSuper(sb))) { in jfs_mount()
101 rc = -EIO; in jfs_mount()
104 sbi->ipaimap = ipaimap; in jfs_mount()
109 * initialize aggregate inode allocation map in jfs_mount()
111 if ((rc = diMount(ipaimap))) { in jfs_mount()
112 jfs_err("jfs_mount: diMount(ipaimap) failed w/rc = %d", rc); in jfs_mount()
117 * open aggregate block allocation map in jfs_mount()
121 rc = -EIO; in jfs_mount()
127 sbi->ipbmap = ipbmap; in jfs_mount()
130 * initialize aggregate block allocation map in jfs_mount()
132 if ((rc = dbMount(ipbmap))) { in jfs_mount()
133 jfs_err("jfs_mount: dbMount failed w/rc = %d", rc); in jfs_mount()
138 * open the secondary aggregate inode allocation map in jfs_mount()
140 * This is a duplicate of the aggregate inode allocation map. in jfs_mount()
148 if ((sbi->mntflag & JFS_BAD_SAIT) == 0) { in jfs_mount()
152 rc = -EIO; in jfs_mount()
155 sbi->ipaimap2 = ipaimap2; in jfs_mount()
160 * initialize secondary aggregate inode allocation map in jfs_mount()
162 if ((rc = diMount(ipaimap2))) { in jfs_mount()
163 jfs_err("jfs_mount: diMount(ipaimap2) failed, rc = %d", in jfs_mount()
164 rc); in jfs_mount()
169 sbi->ipaimap2 = NULL; in jfs_mount()
175 * open fileset inode allocation map (aka fileset inode) in jfs_mount()
180 /* open fileset secondary inode allocation map */ in jfs_mount()
181 rc = -EIO; in jfs_mount()
186 /* map further access of per fileset inodes by the fileset inode */ in jfs_mount()
187 sbi->ipimap = ipimap; in jfs_mount()
189 /* initialize fileset inode allocation map */ in jfs_mount()
190 if ((rc = diMount(ipimap))) { in jfs_mount()
191 jfs_err("jfs_mount: diMount failed w/rc = %d", rc); in jfs_mount()
200 errout41: /* close fileset inode allocation map inode */ in jfs_mount()
205 /* close secondary aggregate inode allocation map */ in jfs_mount()
213 /* close aggregate block allocation map */ in jfs_mount()
217 errout22: /* close aggregate inode allocation map */ in jfs_mount()
227 if (rc) in jfs_mount()
228 jfs_err("Mount JFS Failure: %d", rc); in jfs_mount()
230 return rc; in jfs_mount()
234 * NAME: jfs_mount_rw(sb, remount)
236 * FUNCTION: Completes read-write mount, or remounts read-only volume
237 * as read-write
242 int rc; in jfs_mount_rw() local
245 * If we are re-mounting a previously read-only volume, we want to in jfs_mount_rw()
246 * re-read the inode and block maps, since fsck.jfs may have updated in jfs_mount_rw()
250 if (chkSuper(sb) || (sbi->state != FM_CLEAN)) in jfs_mount_rw()
251 return -EINVAL; in jfs_mount_rw()
253 truncate_inode_pages(sbi->ipimap->i_mapping, 0); in jfs_mount_rw()
254 truncate_inode_pages(sbi->ipbmap->i_mapping, 0); in jfs_mount_rw()
255 diUnmount(sbi->ipimap, 1); in jfs_mount_rw()
256 if ((rc = diMount(sbi->ipimap))) { in jfs_mount_rw()
258 return rc; in jfs_mount_rw()
261 dbUnmount(sbi->ipbmap, 1); in jfs_mount_rw()
262 if ((rc = dbMount(sbi->ipbmap))) { in jfs_mount_rw()
264 return rc; in jfs_mount_rw()
271 if ((rc = lmLogOpen(sb))) in jfs_mount_rw()
272 return rc; in jfs_mount_rw()
277 if ((rc = updateSuper(sb, FM_MOUNT))) { in jfs_mount_rw()
278 jfs_err("jfs_mount: updateSuper failed w/rc = %d", rc); in jfs_mount_rw()
280 return rc; in jfs_mount_rw()
288 return rc; in jfs_mount_rw()
303 int rc = 0; in chkSuper() local
313 if ((rc = readSuper(sb, &bh))) in chkSuper()
314 return rc; in chkSuper()
315 j_sb = (struct jfs_superblock *)bh->b_data; in chkSuper()
321 if (strncmp(j_sb->s_magic, JFS_MAGIC, 4) || in chkSuper()
322 le32_to_cpu(j_sb->s_version) > JFS_VERSION) { in chkSuper()
323 rc = -EINVAL; in chkSuper()
327 bsize = le32_to_cpu(j_sb->s_bsize); in chkSuper()
331 rc = -EINVAL; in chkSuper()
337 le32_to_cpu(j_sb->s_flag), le32_to_cpu(j_sb->s_state), in chkSuper()
338 (unsigned long long) le64_to_cpu(j_sb->s_size)); in chkSuper()
341 if ((j_sb->s_flag & cpu_to_le32(JFS_BAD_SAIT)) != in chkSuper()
344 AIM_bytesize = lengthPXD(&(j_sb->s_aim2)) * bsize; in chkSuper()
346 AIT_bytesize = lengthPXD(&(j_sb->s_ait2)) * bsize; in chkSuper()
347 AIM_byte_addr = addressPXD(&(j_sb->s_aim2)) * bsize; in chkSuper()
348 AIT_byte_addr = addressPXD(&(j_sb->s_ait2)) * bsize; in chkSuper()
349 byte_addr_diff0 = AIT_byte_addr - AIM_byte_addr; in chkSuper()
350 fsckwsp_addr = addressPXD(&(j_sb->s_fsckpxd)) * bsize; in chkSuper()
351 byte_addr_diff1 = fsckwsp_addr - AIT_byte_addr; in chkSuper()
356 j_sb->s_flag |= cpu_to_le32(JFS_BAD_SAIT); in chkSuper()
359 if ((j_sb->s_flag & cpu_to_le32(JFS_GROUPCOMMIT)) != in chkSuper()
361 j_sb->s_flag |= cpu_to_le32(JFS_GROUPCOMMIT); in chkSuper()
364 if (j_sb->s_state != cpu_to_le32(FM_CLEAN) && in chkSuper()
367 rc = -EINVAL; in chkSuper()
371 sbi->state = le32_to_cpu(j_sb->s_state); in chkSuper()
372 sbi->mntflag = le32_to_cpu(j_sb->s_flag); in chkSuper()
378 sbi->bsize = bsize; in chkSuper()
379 sbi->l2bsize = le16_to_cpu(j_sb->s_l2bsize); in chkSuper()
385 sbi->nbperpage = PSIZE >> sbi->l2bsize; in chkSuper()
386 sbi->l2nbperpage = L2PSIZE - sbi->l2bsize; in chkSuper()
387 sbi->l2niperblk = sbi->l2bsize - L2DISIZE; in chkSuper()
388 if (sbi->mntflag & JFS_INLINELOG) in chkSuper()
389 sbi->logpxd = j_sb->s_logpxd; in chkSuper()
391 sbi->logdev = new_decode_dev(le32_to_cpu(j_sb->s_logdev)); in chkSuper()
392 memcpy(sbi->uuid, j_sb->s_uuid, sizeof(sbi->uuid)); in chkSuper()
393 memcpy(sbi->loguuid, j_sb->s_loguuid, sizeof(sbi->uuid)); in chkSuper()
395 sbi->fsckpxd = j_sb->s_fsckpxd; in chkSuper()
396 sbi->ait2 = j_sb->s_ait2; in chkSuper()
400 return rc; in chkSuper()
407 * update synchronously superblock if it is mounted read-write.
414 int rc; in updateSuper() local
416 if (sbi->flag & JFS_NOINTEGRITY) { in updateSuper()
418 sbi->p_state = state; in updateSuper()
421 sbi->p_state = sbi->state; in updateSuper()
424 state = sbi->p_state; in updateSuper()
427 } else if (sbi->state == FM_DIRTY) in updateSuper()
430 if ((rc = readSuper(sb, &bh))) in updateSuper()
431 return rc; in updateSuper()
433 j_sb = (struct jfs_superblock *)bh->b_data; in updateSuper()
435 j_sb->s_state = cpu_to_le32(state); in updateSuper()
436 sbi->state = state; in updateSuper()
440 j_sb->s_logdev = cpu_to_le32(new_encode_dev(sbi->log->bdev->bd_dev)); in updateSuper()
441 j_sb->s_logserial = cpu_to_le32(sbi->log->serial); in updateSuper()
447 if (j_sb->s_flag & cpu_to_le32(JFS_DASD_ENABLED)) in updateSuper()
448 j_sb->s_flag |= cpu_to_le32(JFS_DASD_PRIME); in updateSuper()
467 *bpp = sb_bread(sb, SUPER1_OFF >> sb->s_blocksize_bits); in readSuper()
472 *bpp = sb_bread(sb, SUPER2_OFF >> sb->s_blocksize_bits); in readSuper()
476 return -EIO; in readSuper()
492 * to update block allocation map at aggregate level.
496 struct jfs_log *log = JFS_SBI(sb)->log; in logMOUNT()
503 lrd.aggregate = cpu_to_le32(new_encode_dev(sb->s_bdev->bd_dev)); in logMOUNT()