Lines Matching defs:dip

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