Lines Matching refs:dip
74 static int jfs_create(struct inode *dip, struct dentry *dentry, int mode, in jfs_create() argument
86 jfs_info("jfs_create: dip:0x%p name:%s", dip, dentry->d_name.name); in jfs_create()
100 ip = ialloc(dip, mode); in jfs_create()
106 tid = txBegin(dip->i_sb, 0); in jfs_create()
108 mutex_lock_nested(&JFS_IP(dip)->commit_mutex, COMMIT_MUTEX_PARENT); in jfs_create()
111 rc = jfs_init_acl(tid, ip, dip); in jfs_create()
115 rc = jfs_init_security(tid, ip, dip); in jfs_create()
121 if ((rc = dtSearch(dip, &dname, &ino, &btstack, JFS_CREATE))) { in jfs_create()
132 iplist[0] = dip; in jfs_create()
145 if ((rc = dtInsert(tid, dip, &dname, &ino, &btstack))) { in jfs_create()
160 dip->i_ctime = dip->i_mtime = CURRENT_TIME; in jfs_create()
162 mark_inode_dirty(dip); in jfs_create()
169 mutex_unlock(&JFS_IP(dip)->commit_mutex); in jfs_create()
205 static int jfs_mkdir(struct inode *dip, struct dentry *dentry, int mode) in jfs_mkdir() argument
216 jfs_info("jfs_mkdir: dip:0x%p name:%s", dip, dentry->d_name.name); in jfs_mkdir()
219 if (dip->i_nlink == JFS_LINK_MAX) { in jfs_mkdir()
236 ip = ialloc(dip, S_IFDIR | mode); in jfs_mkdir()
242 tid = txBegin(dip->i_sb, 0); in jfs_mkdir()
244 mutex_lock_nested(&JFS_IP(dip)->commit_mutex, COMMIT_MUTEX_PARENT); in jfs_mkdir()
247 rc = jfs_init_acl(tid, ip, dip); in jfs_mkdir()
251 rc = jfs_init_security(tid, ip, dip); in jfs_mkdir()
257 if ((rc = dtSearch(dip, &dname, &ino, &btstack, JFS_CREATE))) { in jfs_mkdir()
268 iplist[0] = dip; in jfs_mkdir()
274 dtInitRoot(tid, ip, dip->i_ino); in jfs_mkdir()
281 if ((rc = dtInsert(tid, dip, &dname, &ino, &btstack))) { in jfs_mkdir()
297 inc_nlink(dip); /* for '..' from child directory */ in jfs_mkdir()
298 dip->i_ctime = dip->i_mtime = CURRENT_TIME; in jfs_mkdir()
299 mark_inode_dirty(dip); in jfs_mkdir()
306 mutex_unlock(&JFS_IP(dip)->commit_mutex); in jfs_mkdir()
346 static int jfs_rmdir(struct inode *dip, struct dentry *dentry) in jfs_rmdir() argument
356 jfs_info("jfs_rmdir: dip:0x%p name:%s", dip, dentry->d_name.name); in jfs_rmdir()
371 tid = txBegin(dip->i_sb, 0); in jfs_rmdir()
373 mutex_lock_nested(&JFS_IP(dip)->commit_mutex, COMMIT_MUTEX_PARENT); in jfs_rmdir()
376 iplist[0] = dip; in jfs_rmdir()
387 if ((rc = dtDelete(tid, dip, &dname, &ino, JFS_REMOVE))) { in jfs_rmdir()
393 mutex_unlock(&JFS_IP(dip)->commit_mutex); in jfs_rmdir()
401 dip->i_ctime = dip->i_mtime = CURRENT_TIME; in jfs_rmdir()
402 inode_dec_link_count(dip); in jfs_rmdir()
430 mutex_unlock(&JFS_IP(dip)->commit_mutex); in jfs_rmdir()
436 if (test_cflag(COMMIT_Stale, dip)) { in jfs_rmdir()
437 if (dip->i_size > 1) in jfs_rmdir()
438 jfs_truncate_nolock(dip, 0); in jfs_rmdir()
440 clear_cflag(COMMIT_Stale, dip); in jfs_rmdir()
471 static int jfs_unlink(struct inode *dip, struct dentry *dentry) in jfs_unlink() argument
483 jfs_info("jfs_unlink: dip:0x%p name:%s", dip, dentry->d_name.name); in jfs_unlink()
493 tid = txBegin(dip->i_sb, 0); in jfs_unlink()
495 mutex_lock_nested(&JFS_IP(dip)->commit_mutex, COMMIT_MUTEX_PARENT); in jfs_unlink()
498 iplist[0] = dip; in jfs_unlink()
505 if ((rc = dtDelete(tid, dip, &dname, &ino, JFS_REMOVE))) { in jfs_unlink()
511 mutex_unlock(&JFS_IP(dip)->commit_mutex); in jfs_unlink()
518 ip->i_ctime = dip->i_ctime = dip->i_mtime = CURRENT_TIME; in jfs_unlink()
519 mark_inode_dirty(dip); in jfs_unlink()
534 mutex_unlock(&JFS_IP(dip)->commit_mutex); in jfs_unlink()
563 mutex_unlock(&JFS_IP(dip)->commit_mutex); in jfs_unlink()
566 tid = txBegin(dip->i_sb, 0); in jfs_unlink()
587 if (test_cflag(COMMIT_Stale, dip)) { in jfs_unlink()
588 if (dip->i_size > 1) in jfs_unlink()
589 jfs_truncate_nolock(dip, 0); in jfs_unlink()
591 clear_cflag(COMMIT_Stale, dip); in jfs_unlink()
877 static int jfs_symlink(struct inode *dip, struct dentry *dentry, in jfs_symlink() argument
897 jfs_info("jfs_symlink: dip:0x%p name:%s", dip, name); in jfs_symlink()
913 ip = ialloc(dip, S_IFLNK | 0777); in jfs_symlink()
919 tid = txBegin(dip->i_sb, 0); in jfs_symlink()
921 mutex_lock_nested(&JFS_IP(dip)->commit_mutex, COMMIT_MUTEX_PARENT); in jfs_symlink()
924 rc = jfs_init_security(tid, ip, dip); in jfs_symlink()
1013 rc = dtSearch(dip, &dname, &ino, &btstack, JFS_CREATE); in jfs_symlink()
1016 rc = dtInsert(tid, dip, &dname, &ino, &btstack); in jfs_symlink()
1028 dip->i_ctime = dip->i_mtime = CURRENT_TIME; in jfs_symlink()
1029 mark_inode_dirty(dip); in jfs_symlink()
1034 iplist[0] = dip; in jfs_symlink()
1041 mutex_unlock(&JFS_IP(dip)->commit_mutex); in jfs_symlink()
1440 static struct dentry *jfs_lookup(struct inode *dip, struct dentry *dentry, struct nameidata *nd) in jfs_lookup() argument
1452 if (JFS_SBI(dip->i_sb)->mntflag & JFS_OS2) in jfs_lookup()
1456 inum = dip->i_ino; in jfs_lookup()
1458 inum = PARENT(dip); in jfs_lookup()
1462 rc = dtSearch(dip, &key, &inum, &btstack, JFS_LOOKUP); in jfs_lookup()
1473 ip = jfs_iget(dip->i_sb, inum); in jfs_lookup()
1481 if (dentry && (JFS_SBI(dip->i_sb)->mntflag & JFS_OS2)) in jfs_lookup()