Lines Matching refs:dip

271  * @dip: The directory
274 struct inode *gfs2_lookup_meta(struct inode *dip, const char *name)
280 inode = gfs2_lookupi(dip, &qstr, 1);
312 struct gfs2_inode *dip = GFS2_I(dir);
328 if (gfs2_glock_is_locked_by_me(dip->i_gl) == NULL) {
329 error = gfs2_glock_nq_init(dip->i_gl, LM_ST_SHARED, 0, &d_gh);
353 * @dip: Directory in which dinode is to be created
360 static int create_ok(struct gfs2_inode *dip, const struct qstr *name,
365 error = gfs2_permission(&nop_mnt_idmap, &dip->i_inode,
371 if (!dip->i_inode.i_nlink)
374 if (dip->i_entries == (u32)-1)
376 if (S_ISDIR(mode) && dip->i_inode.i_nlink == (u32)-1)
382 static void munge_mode_uid_gid(const struct gfs2_inode *dip,
385 if (GFS2_SB(&dip->i_inode)->sd_args.ar_suiddir &&
386 (dip->i_inode.i_mode & S_ISUID) &&
387 !uid_eq(dip->i_inode.i_uid, GLOBAL_ROOT_UID)) {
390 else if (!uid_eq(dip->i_inode.i_uid, current_fsuid()))
392 inode->i_uid = dip->i_inode.i_uid;
396 if (dip->i_inode.i_mode & S_ISGID) {
399 inode->i_gid = dip->i_inode.i_gid;
488 * @dip: The directory this inode is being created in
494 static void init_dinode(struct gfs2_inode *dip, struct gfs2_inode *ip,
516 gfs2_init_dir(dibh, dip);
529 * @dip: The directory we are linking into
541 static unsigned gfs2_trans_da_blks(const struct gfs2_inode *dip,
545 return da->nr_blocks + gfs2_rg_blocks(dip, da->nr_blocks) +
549 static int link_dinode(struct gfs2_inode *dip, const struct qstr *name,
552 struct gfs2_sbd *sdp = GFS2_SB(&dip->i_inode);
557 error = gfs2_quota_lock_check(dip, &ap);
561 error = gfs2_inplace_reserve(dip, &ap);
565 error = gfs2_trans_begin(sdp, gfs2_trans_da_blks(dip, da, 2), 0);
574 error = gfs2_dir_add(&dip->i_inode, name, ip, da);
578 gfs2_inplace_release(dip);
580 gfs2_quota_unlock(dip);
629 struct gfs2_inode *dip = GFS2_I(dir), *ip;
630 struct gfs2_sbd *sdp = GFS2_SB(&dip->i_inode);
640 error = gfs2_qa_get(dip);
648 error = gfs2_glock_nq_init(dip->i_gl, LM_ST_EXCLUSIVE, 0, &d_gh);
653 error = create_ok(dip, name, mode);
702 munge_mode_uid_gid(dip, inode);
703 check_and_update_goal(dip);
704 ip->i_goal = dip->i_goal;
714 if ((dip->i_diskflags & GFS2_DIF_INHERIT_JDATA) ||
720 ip->i_diskflags |= (dip->i_diskflags & GFS2_DIF_INHERIT_JDATA);
727 if (dip->i_diskflags & GFS2_DIF_SYSTEM)
732 if ((GFS2_I(d_inode(sdp->sd_root_dir)) == dip) ||
733 (dip->i_diskflags & GFS2_DIF_TOPDIR))
776 init_dinode(dip, ip, symname);
798 error = security_inode_init_security(&ip->i_inode, &dip->i_inode, name,
803 error = link_dinode(dip, name, ip, &da);
819 gfs2_qa_put(dip);
856 gfs2_qa_put(dip);
948 struct gfs2_inode *dip = GFS2_I(dir);
960 error = gfs2_qa_get(dip);
964 gfs2_holder_init(dip->i_gl, LM_ST_EXCLUSIVE, 0, &d_gh);
995 if (!dip->i_inode.i_nlink)
998 if (dip->i_entries == (u32)-1)
1013 error = gfs2_quota_lock_check(dip, &ap);
1017 error = gfs2_inplace_reserve(dip, &ap);
1021 error = gfs2_trans_begin(sdp, gfs2_trans_da_blks(dip, &da, 2), 0);
1051 gfs2_inplace_release(dip);
1054 gfs2_quota_unlock(dip);
1061 gfs2_qa_put(dip);
1069 * @dip: the directory
1073 * Assumes that the lock on (at least) @dip is held.
1078 static int gfs2_unlink_ok(struct gfs2_inode *dip, const struct qstr *name,
1086 if ((dip->i_inode.i_mode & S_ISVTX) &&
1087 !uid_eq(dip->i_inode.i_uid, current_fsuid()) &&
1091 if (IS_APPEND(&dip->i_inode))
1094 error = gfs2_permission(&nop_mnt_idmap, &dip->i_inode,
1099 return gfs2_dir_check(&dip->i_inode, name, ip);
1104 * @dip: The parent directory
1113 static int gfs2_unlink_inode(struct gfs2_inode *dip,
1120 error = gfs2_dir_del(dip, dentry);
1150 struct gfs2_inode *dip = GFS2_I(dir);
1164 gfs2_holder_init(dip->i_gl, LM_ST_EXCLUSIVE, 0, &d_gh);
1196 error = gfs2_unlink_ok(dip, &dentry->d_name, ip);
1204 error = gfs2_unlink_inode(dip, dentry);