Lines Matching refs:dip
62 static int jfs_create(struct mnt_idmap *idmap, struct inode *dip, in jfs_create() argument
74 jfs_info("jfs_create: dip:0x%p name:%pd", dip, dentry); in jfs_create()
76 rc = dquot_initialize(dip); in jfs_create()
92 ip = ialloc(dip, mode); in jfs_create()
98 tid = txBegin(dip->i_sb, 0); in jfs_create()
100 mutex_lock_nested(&JFS_IP(dip)->commit_mutex, COMMIT_MUTEX_PARENT); in jfs_create()
103 rc = jfs_init_acl(tid, ip, dip); in jfs_create()
107 rc = jfs_init_security(tid, ip, dip, &dentry->d_name); in jfs_create()
113 if ((rc = dtSearch(dip, &dname, &ino, &btstack, JFS_CREATE))) { in jfs_create()
124 iplist[0] = dip; in jfs_create()
137 if ((rc = dtInsert(tid, dip, &dname, &ino, &btstack))) { in jfs_create()
152 inode_set_mtime_to_ts(dip, inode_set_ctime_current(dip)); in jfs_create()
154 mark_inode_dirty(dip); in jfs_create()
161 mutex_unlock(&JFS_IP(dip)->commit_mutex); in jfs_create()
195 static int jfs_mkdir(struct mnt_idmap *idmap, struct inode *dip, in jfs_mkdir() argument
207 jfs_info("jfs_mkdir: dip:0x%p name:%pd", dip, dentry); in jfs_mkdir()
209 rc = dquot_initialize(dip); in jfs_mkdir()
225 ip = ialloc(dip, S_IFDIR | mode); in jfs_mkdir()
231 tid = txBegin(dip->i_sb, 0); in jfs_mkdir()
233 mutex_lock_nested(&JFS_IP(dip)->commit_mutex, COMMIT_MUTEX_PARENT); in jfs_mkdir()
236 rc = jfs_init_acl(tid, ip, dip); in jfs_mkdir()
240 rc = jfs_init_security(tid, ip, dip, &dentry->d_name); in jfs_mkdir()
246 if ((rc = dtSearch(dip, &dname, &ino, &btstack, JFS_CREATE))) { in jfs_mkdir()
257 iplist[0] = dip; in jfs_mkdir()
263 dtInitRoot(tid, ip, dip->i_ino); in jfs_mkdir()
270 if ((rc = dtInsert(tid, dip, &dname, &ino, &btstack))) { in jfs_mkdir()
286 inc_nlink(dip); /* for '..' from child directory */ in jfs_mkdir()
287 inode_set_mtime_to_ts(dip, inode_set_ctime_current(dip)); in jfs_mkdir()
288 mark_inode_dirty(dip); in jfs_mkdir()
295 mutex_unlock(&JFS_IP(dip)->commit_mutex); in jfs_mkdir()
333 static int jfs_rmdir(struct inode *dip, struct dentry *dentry) in jfs_rmdir() argument
343 jfs_info("jfs_rmdir: dip:0x%p name:%pd", dip, dentry); in jfs_rmdir()
346 rc = dquot_initialize(dip); in jfs_rmdir()
363 tid = txBegin(dip->i_sb, 0); in jfs_rmdir()
365 mutex_lock_nested(&JFS_IP(dip)->commit_mutex, COMMIT_MUTEX_PARENT); in jfs_rmdir()
368 iplist[0] = dip; in jfs_rmdir()
379 if ((rc = dtDelete(tid, dip, &dname, &ino, JFS_REMOVE))) { in jfs_rmdir()
385 mutex_unlock(&JFS_IP(dip)->commit_mutex); in jfs_rmdir()
393 inode_set_mtime_to_ts(dip, inode_set_ctime_current(dip)); in jfs_rmdir()
394 inode_dec_link_count(dip); in jfs_rmdir()
422 mutex_unlock(&JFS_IP(dip)->commit_mutex); in jfs_rmdir()
428 if (test_cflag(COMMIT_Stale, dip)) { in jfs_rmdir()
429 if (dip->i_size > 1) in jfs_rmdir()
430 jfs_truncate_nolock(dip, 0); in jfs_rmdir()
432 clear_cflag(COMMIT_Stale, dip); in jfs_rmdir()
463 static int jfs_unlink(struct inode *dip, struct dentry *dentry) in jfs_unlink() argument
475 jfs_info("jfs_unlink: dip:0x%p name:%pd", dip, dentry); in jfs_unlink()
478 rc = dquot_initialize(dip); in jfs_unlink()
490 tid = txBegin(dip->i_sb, 0); in jfs_unlink()
492 mutex_lock_nested(&JFS_IP(dip)->commit_mutex, COMMIT_MUTEX_PARENT); in jfs_unlink()
495 iplist[0] = dip; in jfs_unlink()
502 if ((rc = dtDelete(tid, dip, &dname, &ino, JFS_REMOVE))) { in jfs_unlink()
508 mutex_unlock(&JFS_IP(dip)->commit_mutex); in jfs_unlink()
515 inode_set_mtime_to_ts(dip, in jfs_unlink()
516 inode_set_ctime_to_ts(dip, inode_set_ctime_current(ip))); in jfs_unlink()
517 mark_inode_dirty(dip); in jfs_unlink()
532 mutex_unlock(&JFS_IP(dip)->commit_mutex); in jfs_unlink()
561 mutex_unlock(&JFS_IP(dip)->commit_mutex); in jfs_unlink()
564 tid = txBegin(dip->i_sb, 0); in jfs_unlink()
585 if (test_cflag(COMMIT_Stale, dip)) { in jfs_unlink()
586 if (dip->i_size > 1) in jfs_unlink()
587 jfs_truncate_nolock(dip, 0); in jfs_unlink()
589 clear_cflag(COMMIT_Stale, dip); in jfs_unlink()
878 static int jfs_symlink(struct mnt_idmap *idmap, struct inode *dip, in jfs_symlink() argument
897 jfs_info("jfs_symlink: dip:0x%p name:%s", dip, name); in jfs_symlink()
899 rc = dquot_initialize(dip); in jfs_symlink()
917 ip = ialloc(dip, S_IFLNK | 0777); in jfs_symlink()
923 tid = txBegin(dip->i_sb, 0); in jfs_symlink()
925 mutex_lock_nested(&JFS_IP(dip)->commit_mutex, COMMIT_MUTEX_PARENT); in jfs_symlink()
928 rc = jfs_init_security(tid, ip, dip, &dentry->d_name); in jfs_symlink()
1017 rc = dtSearch(dip, &dname, &ino, &btstack, JFS_CREATE); in jfs_symlink()
1020 rc = dtInsert(tid, dip, &dname, &ino, &btstack); in jfs_symlink()
1032 inode_set_mtime_to_ts(dip, inode_set_ctime_current(dip)); in jfs_symlink()
1033 mark_inode_dirty(dip); in jfs_symlink()
1038 iplist[0] = dip; in jfs_symlink()
1045 mutex_unlock(&JFS_IP(dip)->commit_mutex); in jfs_symlink()
1449 static struct dentry *jfs_lookup(struct inode *dip, struct dentry *dentry, unsigned int flags) in jfs_lookup() argument
1461 rc = dtSearch(dip, &key, &inum, &btstack, JFS_LOOKUP); in jfs_lookup()
1469 ip = jfs_iget(dip->i_sb, inum); in jfs_lookup()