tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

VOP_CREATE hanging

For my subfile project I am creating a directory and not attaching it to a parent directory, but rather storing the inode number of the directory and retrieving it using VGET. I'm having a problem when I try to create files within this directory however, it seems to just hang. Seems to be when I call VOP_CREATE so I was thinking I might have some argument messed up but I've been at it for awhile and can't seem to find the problem.

Here is a snipit of code from when I attempt to create the file:

                printf("subfile not found, needs to be created\n");
                        SCARG(uap, sub_path));

                sfnd.ni_cnd.cn_nameiop = CREATE;
                sfnd.ni_cnd.cn_flags |= LOCKPARENT | LOCKLEAF;
if ((SCARG(uap, flags) & O_EXCL) == 0 && ((SCARG(uap, flags) & O_NOFOLLOW) == 0))
                        sfnd.ni_cnd.cn_flags |= FOLLOW;

                /* lock subfile directory */
                if(VOP_ISLOCKED(sdvp) == 0){
                        printf("sdvp is unlocked, now locking\n");
                        vn_lock(sdvp, LK_EXCLUSIVE | LK_RETRY);

                /* set the attr of the new file */
                sfva.va_type = VREG;
sfva.va_mode = ((bva.va_mode &~ cwdi->cwdi_cmask) & ALLPERMS) &~ S_ISTXT;
                if (SCARG(uap, flags) & O_EXCL)
                        sfva.va_vaflags |= VA_EXCLUSIVE;

                error = VOP_CREATE(sdvp,&sfvp,&(sfnd.ni_cnd),&sfva);
                printf("VOP_CREATE error = %d\n",error);

Any advice on why it is hanging or even why it might be hanging this would be greatly appreciated. I can post more info if that would help.


Home | Main Index | Thread Index | Old Index