Lines Matching refs:ip

290 int diRead(struct inode *ip)  in diRead()  argument
292 struct jfs_sb_info *sbi = JFS_SBI(ip->i_sb); in diRead()
305 jfs_info("diRead: ino = %ld", ip->i_ino); in diRead()
308 JFS_IP(ip)->ipimap = ipimap; in diRead()
311 iagno = INOTOIAG(ip->i_ino); in diRead()
326 ino = ip->i_ino & (INOSPERIAG - 1); in diRead()
342 agno = BLKTOAG(agstart, JFS_SBI(ip->i_sb)); in diRead()
377 if (ip->i_ino != le32_to_cpu(dp->di_number)) { in diRead()
378 jfs_error(ip->i_sb, "i_ino != di_number\n"); in diRead()
384 rc = copy_from_dinode(dp, ip); in diRead()
389 JFS_IP(ip)->agstart = agstart; in diRead()
390 JFS_IP(ip)->active_ag = -1; in diRead()
423 struct inode *ip; in diReadSpecial() local
426 ip = new_inode(sb); in diReadSpecial()
427 if (ip == NULL) { in diReadSpecial()
429 return ip; in diReadSpecial()
434 JFS_IP(ip)->ipimap = sbi->ipaimap2; in diReadSpecial()
437 JFS_IP(ip)->ipimap = sbi->ipaimap; in diReadSpecial()
442 ip->i_ino = inum; in diReadSpecial()
447 mp = read_metapage(ip, address << sbi->l2nbperpage, PSIZE, 1); in diReadSpecial()
449 set_nlink(ip, 1); /* Don't want iput() deleting it */ in diReadSpecial()
450 iput(ip); in diReadSpecial()
459 if ((copy_from_dinode(dp, ip)) != 0) { in diReadSpecial()
461 set_nlink(ip, 1); /* Don't want iput() deleting it */ in diReadSpecial()
462 iput(ip); in diReadSpecial()
469 ip->i_mapping->a_ops = &jfs_metapage_aops; in diReadSpecial()
470 mapping_set_gfp_mask(ip->i_mapping, GFP_NOFS); in diReadSpecial()
473 ip->i_flags |= S_NOQUOTA; in diReadSpecial()
475 if ((inum == FILESYSTEM_I) && (JFS_IP(ip)->ipimap == sbi->ipaimap)) { in diReadSpecial()
483 inode_fake_hash(ip); in diReadSpecial()
485 return (ip); in diReadSpecial()
500 void diWriteSpecial(struct inode *ip, int secondary) in diWriteSpecial() argument
502 struct jfs_sb_info *sbi = JFS_SBI(ip->i_sb); in diWriteSpecial()
505 ino_t inum = ip->i_ino; in diWriteSpecial()
518 mp = read_metapage(ip, address << sbi->l2nbperpage, PSIZE, 1); in diWriteSpecial()
529 copy_to_dinode(dp, ip); in diWriteSpecial()
530 memcpy(&dp->di_xtroot, &JFS_IP(ip)->i_xtroot, 288); in diWriteSpecial()
544 void diFreeSpecial(struct inode *ip) in diFreeSpecial() argument
546 if (ip == NULL) { in diFreeSpecial()
550 filemap_write_and_wait(ip->i_mapping); in diFreeSpecial()
551 truncate_inode_pages(ip->i_mapping, 0); in diFreeSpecial()
552 iput(ip); in diFreeSpecial()
581 int diWrite(tid_t tid, struct inode *ip) in diWrite() argument
583 struct jfs_sb_info *sbi = JFS_SBI(ip->i_sb); in diWrite()
584 struct jfs_inode_info *jfs_ip = JFS_IP(ip); in diWrite()
605 ino = ip->i_ino & (INOSPERIAG - 1); in diWrite()
610 jfs_error(ip->i_sb, "ixpxd invalid\n"); in diWrite()
671 if (S_ISDIR(ip->i_mode) && (lid = jfs_ip->xtlid)) { in diWrite()
764 if (S_ISLNK(ip->i_mode) && ip->i_size < IDATASIZE) { in diWrite()
775 if (test_cflag(COMMIT_Inlineea, ip)) { in diWrite()
782 clear_cflag(COMMIT_Inlineea, ip); in diWrite()
790 copy_to_dinode(dp, ip); in diWrite()
791 if (test_and_clear_cflag(COMMIT_Dirtable, ip)) { in diWrite()
845 int diFree(struct inode *ip) in diFree() argument
848 ino_t inum = ip->i_ino; in diFree()
854 struct inode *ipimap = JFS_SBI(ip->i_sb)->ipimap; in diFree()
878 jfs_error(ip->i_sb, "inum = %d, iagno = %d, nextiag = %d\n", in diFree()
885 agno = BLKTOAG(JFS_IP(ip)->agstart, JFS_SBI(ip->i_sb)); in diFree()
914 jfs_error(ip->i_sb, "wmap shows inode already free\n"); in diFree()
921 jfs_error(ip->i_sb, "invalid inoext\n"); in diFree()
933 jfs_error(ip->i_sb, "numfree > numinos\n"); in diFree()
1121 invalidate_pxd_metapages(ip, freepxd); in diFree()
1182 jfs_error(ip->i_sb, "the pmap does not show inode free\n"); in diFree()
1296 diInitInode(struct inode *ip, int iagno, int ino, int extno, struct iag * iagp) in diInitInode() argument
1298 struct jfs_inode_info *jfs_ip = JFS_IP(ip); in diInitInode()
1300 ip->i_ino = (iagno << L2INOSPERIAG) + ino; in diInitInode()
1323 int diAlloc(struct inode *pip, bool dir, struct inode *ip) in diAlloc() argument
1339 JFS_IP(ip)->ipimap = ipimap; in diAlloc()
1340 JFS_IP(ip)->fileset = FILESYSTEM_I; in diAlloc()
1438 diInitInode(ip, iagno, ino, extno, in diAlloc()
1503 jfs_error(ip->i_sb, in diAlloc()
1521 diInitInode(ip, iagno, ino, extno, in diAlloc()
1560 diInitInode(ip, iagno, in diAlloc()
1590 rc = diAllocAG(imap, agno, dir, ip); in diAlloc()
1600 return (diAllocAny(imap, agno, dir, ip)); in diAlloc()
1634 diAllocAG(struct inomap * imap, int agno, bool dir, struct inode *ip) in diAllocAG() argument
1645 jfs_error(ip->i_sb, "numfree > numinos\n"); in diAllocAG()
1669 if ((rc = diAllocExt(imap, agno, ip)) != -ENOSPC) in diAllocAG()
1676 return (diAllocIno(imap, agno, ip)); in diAllocAG()
1704 diAllocAny(struct inomap * imap, int agno, bool dir, struct inode *ip) in diAllocAny() argument
1716 rc = diAllocAG(imap, ag, dir, ip); in diAllocAny()
1729 rc = diAllocAG(imap, ag, dir, ip); in diAllocAny()
1768 static int diAllocIno(struct inomap * imap, int agno, struct inode *ip) in diAllocIno() argument
1796 jfs_error(ip->i_sb, "nfreeinos = 0, but iag on freelist\n"); in diAllocIno()
1807 jfs_error(ip->i_sb, in diAllocIno()
1823 jfs_error(ip->i_sb, "no free extent found\n"); in diAllocIno()
1834 jfs_error(ip->i_sb, "free inode not found\n"); in diAllocIno()
1853 diInitInode(ip, iagno, ino, extno, iagp); in diAllocIno()
1892 static int diAllocExt(struct inomap * imap, int agno, struct inode *ip) in diAllocExt() argument
1920 jfs_error(ip->i_sb, "error reading iag\n"); in diAllocExt()
1932 jfs_error(ip->i_sb, "free ext summary map not found\n"); in diAllocExt()
1945 jfs_error(ip->i_sb, "free extent not found\n"); in diAllocExt()
1971 diInitInode(ip, iagno, extno << L2INOSPEREXT, extno, iagp); in diAllocExt()
2987 struct inode *ip; in duplicateIXtree() local
2993 ip = diReadSpecial(sb, FILESYSTEM_I, 1); in duplicateIXtree()
2994 if (ip == NULL) { in duplicateIXtree()
3010 if (xtInsert(tid, ip, 0, blkno, xlen, xaddr, 0)) { in duplicateIXtree()
3017 ip->i_size += PSIZE; in duplicateIXtree()
3018 inode_add_bytes(ip, PSIZE); in duplicateIXtree()
3019 txCommit(tid, 1, &ip, COMMIT_FORCE); in duplicateIXtree()
3022 diFreeSpecial(ip); in duplicateIXtree()
3034 static int copy_from_dinode(struct dinode * dip, struct inode *ip) in copy_from_dinode() argument
3036 struct jfs_inode_info *jfs_ip = JFS_IP(ip); in copy_from_dinode()
3037 struct jfs_sb_info *sbi = JFS_SBI(ip->i_sb); in copy_from_dinode()
3041 jfs_set_inode_flags(ip); in copy_from_dinode()
3043 ip->i_mode = le32_to_cpu(dip->di_mode) & 0xffff; in copy_from_dinode()
3045 ip->i_mode = (ip->i_mode & ~0777) | (0777 & ~sbi->umask); in copy_from_dinode()
3047 if (S_ISDIR(ip->i_mode)) { in copy_from_dinode()
3048 if (ip->i_mode & 0400) in copy_from_dinode()
3049 ip->i_mode |= 0100; in copy_from_dinode()
3050 if (ip->i_mode & 0040) in copy_from_dinode()
3051 ip->i_mode |= 0010; in copy_from_dinode()
3052 if (ip->i_mode & 0004) in copy_from_dinode()
3053 ip->i_mode |= 0001; in copy_from_dinode()
3056 set_nlink(ip, le32_to_cpu(dip->di_nlink)); in copy_from_dinode()
3060 ip->i_uid = jfs_ip->saved_uid; in copy_from_dinode()
3062 ip->i_uid = sbi->uid; in copy_from_dinode()
3067 ip->i_gid = jfs_ip->saved_gid; in copy_from_dinode()
3069 ip->i_gid = sbi->gid; in copy_from_dinode()
3072 ip->i_size = le64_to_cpu(dip->di_size); in copy_from_dinode()
3073 ip->i_atime.tv_sec = le32_to_cpu(dip->di_atime.tv_sec); in copy_from_dinode()
3074 ip->i_atime.tv_nsec = le32_to_cpu(dip->di_atime.tv_nsec); in copy_from_dinode()
3075 ip->i_mtime.tv_sec = le32_to_cpu(dip->di_mtime.tv_sec); in copy_from_dinode()
3076 ip->i_mtime.tv_nsec = le32_to_cpu(dip->di_mtime.tv_nsec); in copy_from_dinode()
3077 inode_set_ctime(ip, le32_to_cpu(dip->di_ctime.tv_sec), in copy_from_dinode()
3079 ip->i_blocks = LBLK2PBLK(ip->i_sb, le64_to_cpu(dip->di_nblocks)); in copy_from_dinode()
3080 ip->i_generation = le32_to_cpu(dip->di_gen); in copy_from_dinode()
3089 if (S_ISCHR(ip->i_mode) || S_ISBLK(ip->i_mode)) { in copy_from_dinode()
3091 ip->i_rdev = new_decode_dev(jfs_ip->dev); in copy_from_dinode()
3094 if (S_ISDIR(ip->i_mode)) { in copy_from_dinode()
3096 } else if (S_ISREG(ip->i_mode) || S_ISLNK(ip->i_mode)) { in copy_from_dinode()
3118 static void copy_to_dinode(struct dinode * dip, struct inode *ip) in copy_to_dinode() argument
3120 struct jfs_inode_info *jfs_ip = JFS_IP(ip); in copy_to_dinode()
3121 struct jfs_sb_info *sbi = JFS_SBI(ip->i_sb); in copy_to_dinode()
3125 dip->di_number = cpu_to_le32(ip->i_ino); in copy_to_dinode()
3126 dip->di_gen = cpu_to_le32(ip->i_generation); in copy_to_dinode()
3127 dip->di_size = cpu_to_le64(ip->i_size); in copy_to_dinode()
3128 dip->di_nblocks = cpu_to_le64(PBLK2LBLK(ip->i_sb, ip->i_blocks)); in copy_to_dinode()
3129 dip->di_nlink = cpu_to_le32(ip->i_nlink); in copy_to_dinode()
3131 dip->di_uid = cpu_to_le32(i_uid_read(ip)); in copy_to_dinode()
3136 dip->di_gid = cpu_to_le32(i_gid_read(ip)); in copy_to_dinode()
3146 ip->i_mode); in copy_to_dinode()
3150 dip->di_atime.tv_sec = cpu_to_le32(ip->i_atime.tv_sec); in copy_to_dinode()
3151 dip->di_atime.tv_nsec = cpu_to_le32(ip->i_atime.tv_nsec); in copy_to_dinode()
3152 dip->di_ctime.tv_sec = cpu_to_le32(inode_get_ctime(ip).tv_sec); in copy_to_dinode()
3153 dip->di_ctime.tv_nsec = cpu_to_le32(inode_get_ctime(ip).tv_nsec); in copy_to_dinode()
3154 dip->di_mtime.tv_sec = cpu_to_le32(ip->i_mtime.tv_sec); in copy_to_dinode()
3155 dip->di_mtime.tv_nsec = cpu_to_le32(ip->i_mtime.tv_nsec); in copy_to_dinode()
3163 if (S_ISCHR(ip->i_mode) || S_ISBLK(ip->i_mode)) in copy_to_dinode()