Lines Matching refs:ip
79 struct inode *ip = NULL; /* child directory inode */
102 ip = ialloc(dip, mode);
103 if (IS_ERR(ip)) {
104 rc = PTR_ERR(ip);
111 mutex_lock_nested(&JFS_IP(ip)->commit_mutex, COMMIT_MUTEX_CHILD);
113 rc = jfs_init_acl(tid, ip, dip);
117 rc = jfs_init_security(tid, ip, dip);
131 tblk->ino = ip->i_ino;
132 tblk->u.ixpxd = JFS_IP(ip)->ixpxd;
135 iplist[1] = ip;
140 xtInitRoot(tid, ip);
146 ino = ip->i_ino;
156 ip->i_op = &jfs_file_inode_operations;
157 ip->i_fop = &jfs_file_operations;
158 ip->i_mapping->a_ops = &jfs_aops;
160 mark_inode_dirty(ip);
170 mutex_unlock(&JFS_IP(ip)->commit_mutex);
173 free_ea_wmap(ip);
174 ip->i_nlink = 0;
175 unlock_new_inode(ip);
176 iput(ip);
178 d_instantiate(dentry, ip);
179 unlock_new_inode(ip);
211 struct inode *ip = NULL; /* child directory inode */
240 ip = ialloc(dip, S_IFDIR | mode);
241 if (IS_ERR(ip)) {
242 rc = PTR_ERR(ip);
249 mutex_lock_nested(&JFS_IP(ip)->commit_mutex, COMMIT_MUTEX_CHILD);
251 rc = jfs_init_acl(tid, ip, dip);
255 rc = jfs_init_security(tid, ip, dip);
269 tblk->ino = ip->i_ino;
270 tblk->u.ixpxd = JFS_IP(ip)->ixpxd;
273 iplist[1] = ip;
278 dtInitRoot(tid, ip, dip->i_ino);
284 ino = ip->i_ino;
294 ip->i_nlink = 2; /* for '.' */
295 ip->i_op = &jfs_dir_inode_operations;
296 ip->i_fop = &jfs_dir_operations;
298 mark_inode_dirty(ip);
309 mutex_unlock(&JFS_IP(ip)->commit_mutex);
312 free_ea_wmap(ip);
313 ip->i_nlink = 0;
314 unlock_new_inode(ip);
315 iput(ip);
317 d_instantiate(dentry, ip);
318 unlock_new_inode(ip);
354 struct inode *ip = dentry->d_inode;
364 dquot_initialize(ip);
367 if (!dtEmpty(ip)) {
379 mutex_lock_nested(&JFS_IP(ip)->commit_mutex, COMMIT_MUTEX_CHILD);
382 iplist[1] = ip;
386 tblk->u.ip = ip;
391 ino = ip->i_ino;
397 mutex_unlock(&JFS_IP(ip)->commit_mutex);
413 if (JFS_IP(ip)->ea.flag & DXD_EXTENT) {
415 txEA(tid, ip, &JFS_IP(ip)->ea, NULL);
417 JFS_IP(ip)->ea.flag = 0;
420 if (JFS_IP(ip)->acl.flag & DXD_EXTENT) {
422 txEA(tid, ip, &JFS_IP(ip)->acl, NULL);
424 JFS_IP(ip)->acl.flag = 0;
427 clear_nlink(ip);
428 mark_inode_dirty(ip);
434 mutex_unlock(&JFS_IP(ip)->commit_mutex);
480 struct inode *ip = dentry->d_inode;
492 dquot_initialize(ip);
497 IWRITE_LOCK(ip, RDWRLOCK_NORMAL);
502 mutex_lock_nested(&JFS_IP(ip)->commit_mutex, COMMIT_MUTEX_CHILD);
505 iplist[1] = ip;
510 ino = ip->i_ino;
516 mutex_unlock(&JFS_IP(ip)->commit_mutex);
518 IWRITE_UNLOCK(ip);
522 ASSERT(ip->i_nlink);
524 ip->i_ctime = dip->i_ctime = dip->i_mtime = CURRENT_TIME;
528 inode_dec_link_count(ip);
533 if (ip->i_nlink == 0) {
534 assert(!test_cflag(COMMIT_Nolink, ip));
536 if ((new_size = commitZeroLink(tid, ip)) < 0) {
539 mutex_unlock(&JFS_IP(ip)->commit_mutex);
541 IWRITE_UNLOCK(ip);
547 tblk->u.ip = ip;
568 mutex_unlock(&JFS_IP(ip)->commit_mutex);
573 mutex_lock(&JFS_IP(ip)->commit_mutex);
574 new_size = xtTruncate_pmap(tid, ip, new_size);
581 mutex_unlock(&JFS_IP(ip)->commit_mutex);
584 if (ip->i_nlink == 0)
585 set_cflag(COMMIT_Nolink, ip);
587 IWRITE_UNLOCK(ip);
631 static s64 commitZeroLink(tid_t tid, struct inode *ip)
636 jfs_info("commitZeroLink: tid = %d, ip = 0x%p", tid, ip);
638 filetype = ip->i_mode & S_IFMT;
644 if (ip->i_size < IDATASIZE) {
645 ip->i_size = 0;
654 set_cflag(COMMIT_Freewmap, ip);
663 if (JFS_IP(ip)->ea.flag & DXD_EXTENT)
665 txEA(tid, ip, &JFS_IP(ip)->ea, NULL);
670 if (JFS_IP(ip)->acl.flag & DXD_EXTENT)
672 txEA(tid, ip, &JFS_IP(ip)->acl, NULL);
680 if (ip->i_size)
681 return xtTruncate_pmap(tid, ip, 0);
695 * PARAMETER: ip - pointer to inode of file.
697 void jfs_free_zero_link(struct inode *ip)
701 jfs_info("jfs_free_zero_link: ip = 0x%p", ip);
706 type = ip->i_mode & S_IFMT;
713 if (ip->i_size < IDATASIZE)
723 if (JFS_IP(ip)->ea.flag & DXD_EXTENT) {
724 s64 xaddr = addressDXD(&JFS_IP(ip)->ea);
725 int xlen = lengthDXD(&JFS_IP(ip)->ea);
730 invalidate_dxd_metapages(ip, JFS_IP(ip)->ea);
738 txFreeMap(ip, pxdlock, NULL, COMMIT_WMAP);
744 if (JFS_IP(ip)->acl.flag & DXD_EXTENT) {
745 s64 xaddr = addressDXD(&JFS_IP(ip)->acl);
746 int xlen = lengthDXD(&JFS_IP(ip)->acl);
750 invalidate_dxd_metapages(ip, JFS_IP(ip)->acl);
758 txFreeMap(ip, pxdlock, NULL, COMMIT_WMAP);
766 if (ip->i_size)
767 xtTruncate(0, ip, 0, COMMIT_WMAP);
799 struct inode *ip = old_dentry->d_inode;
808 if (ip->i_nlink == JFS_LINK_MAX)
811 if (ip->i_nlink == 0)
816 tid = txBegin(ip->i_sb, 0);
819 mutex_lock_nested(&JFS_IP(ip)->commit_mutex, COMMIT_MUTEX_CHILD);
833 ino = ip->i_ino;
838 inc_nlink(ip); /* for new link */
839 ip->i_ctime = CURRENT_TIME;
842 atomic_inc(&ip->i_count);
844 iplist[0] = ip;
849 ip->i_nlink--; /* never instantiated */
850 iput(ip);
852 d_instantiate(dentry, ip);
860 mutex_unlock(&JFS_IP(ip)->commit_mutex);
894 struct inode *ip = dentry->d_inode;
923 ip = ialloc(dip, S_IFLNK | 0777);
924 if (IS_ERR(ip)) {
925 rc = PTR_ERR(ip);
932 mutex_lock_nested(&JFS_IP(ip)->commit_mutex, COMMIT_MUTEX_CHILD);
934 rc = jfs_init_security(tid, ip, dip);
940 tblk->ino = ip->i_ino;
941 tblk->u.ixpxd = JFS_IP(ip)->ixpxd;
947 ip->i_mode |= 0777;
952 xtInitRoot(tid, ip);
959 ip->i_op = &jfs_fast_symlink_inode_operations;
961 i_fastsymlink = JFS_IP(ip)->i_inline;
963 ip->i_size = ssize - 1;
969 if (ssize > sizeof (JFS_IP(ip)->i_inline))
970 JFS_IP(ip)->mode2 &= ~INLINEEA;
979 jfs_info("jfs_symlink: allocate extent ip:0x%p", ip);
981 ip->i_op = &jfs_symlink_inode_operations;
982 ip->i_mapping->a_ops = &jfs_aops;
989 sb = ip->i_sb;
994 if ((rc = xtInsert(tid, ip, 0, 0, xlen, &xaddr, 0))) {
999 ip->i_size = ssize - 1;
1004 mp = get_metapage(ip, xaddr, PSIZE, 1);
1007 xtTruncate(tid, ip, 0, COMMIT_PWMAP);
1025 ino = ip->i_ino;
1030 xtTruncate(tid, ip, 0, COMMIT_PWMAP);
1036 mark_inode_dirty(ip);
1045 iplist[1] = ip;
1050 mutex_unlock(&JFS_IP(ip)->commit_mutex);
1053 free_ea_wmap(ip);
1054 ip->i_nlink = 0;
1055 unlock_new_inode(ip);
1056 iput(ip);
1058 d_instantiate(dentry, ip);
1059 unlock_new_inode(ip);
1200 tblk->u.ip = new_ip;
1211 tblk->u.ip = new_ip;
1365 struct inode *ip;
1381 ip = ialloc(dir, mode);
1382 if (IS_ERR(ip)) {
1383 rc = PTR_ERR(ip);
1386 jfs_ip = JFS_IP(ip);
1391 mutex_lock_nested(&JFS_IP(ip)->commit_mutex, COMMIT_MUTEX_CHILD);
1393 rc = jfs_init_acl(tid, ip, dir);
1397 rc = jfs_init_security(tid, ip, dir);
1410 tblk->ino = ip->i_ino;
1411 tblk->u.ixpxd = JFS_IP(ip)->ixpxd;
1413 ino = ip->i_ino;
1419 ip->i_op = &jfs_file_inode_operations;
1421 init_special_inode(ip, ip->i_mode, rdev);
1423 mark_inode_dirty(ip);
1430 iplist[1] = ip;
1435 mutex_unlock(&JFS_IP(ip)->commit_mutex);
1438 free_ea_wmap(ip);
1439 ip->i_nlink = 0;
1440 unlock_new_inode(ip);
1441 iput(ip);
1443 d_instantiate(dentry, ip);
1444 unlock_new_inode(ip);
1459 struct inode *ip;
1488 ip = jfs_iget(dip->i_sb, inum);
1489 if (IS_ERR(ip)) {
1491 return ERR_CAST(ip);
1494 dentry = d_splice_alias(ip, dentry);