Lines Matching refs:dip

247 struct inode *gfs2_lookup_simple(struct inode *dip, const char *name)  in gfs2_lookup_simple()  argument
252 inode = gfs2_lookupi(dip, &qstr, 1); in gfs2_lookup_simple()
284 struct gfs2_inode *dip = GFS2_I(dir); in gfs2_lookupi() local
300 if (gfs2_glock_is_locked_by_me(dip->i_gl) == NULL) { in gfs2_lookupi()
301 error = gfs2_glock_nq_init(dip->i_gl, LM_ST_SHARED, 0, &d_gh); in gfs2_lookupi()
332 static int create_ok(struct gfs2_inode *dip, const struct qstr *name, in create_ok() argument
337 error = gfs2_permission(&dip->i_inode, MAY_WRITE | MAY_EXEC); in create_ok()
342 if (!dip->i_inode.i_nlink) in create_ok()
345 if (dip->i_entries == (u32)-1) in create_ok()
347 if (S_ISDIR(mode) && dip->i_inode.i_nlink == (u32)-1) in create_ok()
353 static void munge_mode_uid_gid(const struct gfs2_inode *dip, in munge_mode_uid_gid() argument
356 if (GFS2_SB(&dip->i_inode)->sd_args.ar_suiddir && in munge_mode_uid_gid()
357 (dip->i_inode.i_mode & S_ISUID) && in munge_mode_uid_gid()
358 !uid_eq(dip->i_inode.i_uid, GLOBAL_ROOT_UID)) { in munge_mode_uid_gid()
361 else if (!uid_eq(dip->i_inode.i_uid, current_fsuid())) in munge_mode_uid_gid()
363 inode->i_uid = dip->i_inode.i_uid; in munge_mode_uid_gid()
367 if (dip->i_inode.i_mode & S_ISGID) { in munge_mode_uid_gid()
370 inode->i_gid = dip->i_inode.i_gid; in munge_mode_uid_gid()
461 static void init_dinode(struct gfs2_inode *dip, struct gfs2_inode *ip, in init_dinode() argument
483 gfs2_init_dir(dibh, dip); in init_dinode()
508 static unsigned gfs2_trans_da_blks(const struct gfs2_inode *dip, in gfs2_trans_da_blks() argument
512 return da->nr_blocks + gfs2_rg_blocks(dip, da->nr_blocks) + in gfs2_trans_da_blks()
516 static int link_dinode(struct gfs2_inode *dip, const struct qstr *name, in link_dinode() argument
519 struct gfs2_sbd *sdp = GFS2_SB(&dip->i_inode); in link_dinode()
524 error = gfs2_quota_lock_check(dip, &ap); in link_dinode()
528 error = gfs2_inplace_reserve(dip, &ap); in link_dinode()
532 error = gfs2_trans_begin(sdp, gfs2_trans_da_blks(dip, da, 2), 0); in link_dinode()
541 error = gfs2_dir_add(&dip->i_inode, name, ip, da); in link_dinode()
545 gfs2_inplace_release(dip); in link_dinode()
547 gfs2_quota_unlock(dip); in link_dinode()
589 struct gfs2_inode *dip = GFS2_I(dir), *ip; in gfs2_create_inode() local
590 struct gfs2_sbd *sdp = GFS2_SB(&dip->i_inode); in gfs2_create_inode()
600 error = gfs2_rsqa_alloc(dip); in gfs2_create_inode()
608 error = gfs2_glock_nq_init(dip->i_gl, LM_ST_EXCLUSIVE, 0, ghs); in gfs2_create_inode()
613 error = create_ok(dip, name, mode); in gfs2_create_inode()
663 munge_mode_uid_gid(dip, inode); in gfs2_create_inode()
664 check_and_update_goal(dip); in gfs2_create_inode()
665 ip->i_goal = dip->i_goal; in gfs2_create_inode()
675 if ((dip->i_diskflags & GFS2_DIF_INHERIT_JDATA) || in gfs2_create_inode()
681 ip->i_diskflags |= (dip->i_diskflags & GFS2_DIF_INHERIT_JDATA); in gfs2_create_inode()
688 if (dip->i_diskflags & GFS2_DIF_SYSTEM) in gfs2_create_inode()
693 if ((GFS2_I(d_inode(sdp->sd_root_dir)) == dip) || in gfs2_create_inode()
694 (dip->i_diskflags & GFS2_DIF_TOPDIR)) in gfs2_create_inode()
724 init_dinode(dip, ip, symname); in gfs2_create_inode()
759 error = security_inode_init_security(&ip->i_inode, &dip->i_inode, name, in gfs2_create_inode()
764 error = link_dinode(dip, name, ip, &da); in gfs2_create_inode()
900 struct gfs2_inode *dip = GFS2_I(dir); in gfs2_link() local
912 error = gfs2_rsqa_alloc(dip); in gfs2_link()
916 gfs2_holder_init(dip->i_gl, LM_ST_EXCLUSIVE, 0, ghs); in gfs2_link()
946 if (!dip->i_inode.i_nlink) in gfs2_link()
949 if (dip->i_entries == (u32)-1) in gfs2_link()
967 error = gfs2_quota_lock_check(dip, &ap); in gfs2_link()
971 error = gfs2_inplace_reserve(dip, &ap); in gfs2_link()
975 error = gfs2_trans_begin(sdp, gfs2_trans_da_blks(dip, &da, 2), 0); in gfs2_link()
1005 gfs2_inplace_release(dip); in gfs2_link()
1008 gfs2_quota_unlock(dip); in gfs2_link()
1031 static int gfs2_unlink_ok(struct gfs2_inode *dip, const struct qstr *name, in gfs2_unlink_ok() argument
1039 if ((dip->i_inode.i_mode & S_ISVTX) && in gfs2_unlink_ok()
1040 !uid_eq(dip->i_inode.i_uid, current_fsuid()) && in gfs2_unlink_ok()
1044 if (IS_APPEND(&dip->i_inode)) in gfs2_unlink_ok()
1047 error = gfs2_permission(&dip->i_inode, MAY_WRITE | MAY_EXEC); in gfs2_unlink_ok()
1051 return gfs2_dir_check(&dip->i_inode, name, ip); in gfs2_unlink_ok()
1066 static int gfs2_unlink_inode(struct gfs2_inode *dip, in gfs2_unlink_inode() argument
1073 error = gfs2_dir_del(dip, dentry); in gfs2_unlink_inode()
1103 struct gfs2_inode *dip = GFS2_I(dir); in gfs2_unlink() local
1117 gfs2_holder_init(dip->i_gl, LM_ST_EXCLUSIVE, 0, ghs); in gfs2_unlink()
1149 error = gfs2_unlink_ok(dip, &dentry->d_name, ip); in gfs2_unlink()
1157 error = gfs2_unlink_inode(dip, dentry); in gfs2_unlink()