Lines Matching refs: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 inode *dip, struct dentry *dentry, umode_t mode,
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 dip->i_ctime = dip->i_mtime = current_time(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 int jfs_mkdir(struct inode *dip, struct dentry *dentry, umode_t mode)
206 jfs_info("jfs_mkdir: dip:0x%p name:%pd", dip, dentry);
208 rc = dquot_initialize(dip);
224 ip = ialloc(dip, S_IFDIR | mode);
230 tid = txBegin(dip->i_sb, 0);
232 mutex_lock_nested(&JFS_IP(dip)->commit_mutex, COMMIT_MUTEX_PARENT);
235 rc = jfs_init_acl(tid, ip, dip);
239 rc = jfs_init_security(tid, ip, dip, &dentry->d_name);
245 if ((rc = dtSearch(dip, &dname, &ino, &btstack, JFS_CREATE))) {
256 iplist[0] = dip;
262 dtInitRoot(tid, ip, dip->i_ino);
269 if ((rc = dtInsert(tid, dip, &dname, &ino, &btstack))) {
285 inc_nlink(dip); /* for '..' from child directory */
286 dip->i_ctime = dip->i_mtime = current_time(dip);
287 mark_inode_dirty(dip);
294 mutex_unlock(&JFS_IP(dip)->commit_mutex);
314 * NAME: jfs_rmdir(dip, dentry)
318 * PARAMETER: dip - parent inode
332 static int jfs_rmdir(struct inode *dip, struct dentry *dentry)
342 jfs_info("jfs_rmdir: dip:0x%p name:%pd", dip, dentry);
345 rc = dquot_initialize(dip);
362 tid = txBegin(dip->i_sb, 0);
364 mutex_lock_nested(&JFS_IP(dip)->commit_mutex, COMMIT_MUTEX_PARENT);
367 iplist[0] = dip;
378 if ((rc = dtDelete(tid, dip, &dname, &ino, JFS_REMOVE))) {
384 mutex_unlock(&JFS_IP(dip)->commit_mutex);
392 dip->i_ctime = dip->i_mtime = current_time(dip);
393 inode_dec_link_count(dip);
421 mutex_unlock(&JFS_IP(dip)->commit_mutex);
427 if (test_cflag(COMMIT_Stale, dip)) {
428 if (dip->i_size > 1)
429 jfs_truncate_nolock(dip, 0);
431 clear_cflag(COMMIT_Stale, dip);
443 * NAME: jfs_unlink(dip, dentry)
448 * PARAMETER: dip - inode of parent directory
462 static int jfs_unlink(struct inode *dip, struct dentry *dentry)
474 jfs_info("jfs_unlink: dip:0x%p name:%pd", dip, dentry);
477 rc = dquot_initialize(dip);
489 tid = txBegin(dip->i_sb, 0);
491 mutex_lock_nested(&JFS_IP(dip)->commit_mutex, COMMIT_MUTEX_PARENT);
494 iplist[0] = dip;
501 if ((rc = dtDelete(tid, dip, &dname, &ino, JFS_REMOVE))) {
507 mutex_unlock(&JFS_IP(dip)->commit_mutex);
514 ip->i_ctime = dip->i_ctime = dip->i_mtime = current_time(ip);
515 mark_inode_dirty(dip);
530 mutex_unlock(&JFS_IP(dip)->commit_mutex);
559 mutex_unlock(&JFS_IP(dip)->commit_mutex);
562 tid = txBegin(dip->i_sb, 0);
583 if (test_cflag(COMMIT_Stale, dip)) {
584 if (dip->i_size > 1)
585 jfs_truncate_nolock(dip, 0);
587 clear_cflag(COMMIT_Stale, dip);
859 * NAME: jfs_symlink(dip, dentry, name)
862 * in directory <dip>
864 * PARAMETER: dip - parent directory vnode
876 static int jfs_symlink(struct inode *dip, struct dentry *dentry,
895 jfs_info("jfs_symlink: dip:0x%p name:%s", dip, name);
897 rc = dquot_initialize(dip);
915 ip = ialloc(dip, S_IFLNK | 0777);
921 tid = txBegin(dip->i_sb, 0);
923 mutex_lock_nested(&JFS_IP(dip)->commit_mutex, COMMIT_MUTEX_PARENT);
926 rc = jfs_init_security(tid, ip, dip, &dentry->d_name);
1015 rc = dtSearch(dip, &dname, &ino, &btstack, JFS_CREATE);
1018 rc = dtInsert(tid, dip, &dname, &ino, &btstack);
1030 dip->i_ctime = dip->i_mtime = current_time(dip);
1031 mark_inode_dirty(dip);
1036 iplist[0] = dip;
1043 mutex_unlock(&JFS_IP(dip)->commit_mutex);
1446 static struct dentry *jfs_lookup(struct inode *dip, struct dentry *dentry, unsigned int flags)
1458 rc = dtSearch(dip, &key, &inum, &btstack, JFS_LOOKUP);
1466 ip = jfs_iget(dip->i_sb, inum);