-static int coda_mknod(struct inode *dir, struct dentry *de, int mode, dev_t rdev)
-{
- int error=0;
- const char *name=de->d_name.name;
- int length=de->d_name.len;
- struct inode *inode;
- struct CodaFid newfid;
- struct coda_vattr attrs;
-
- if ( coda_hasmknod == 0 )
- return -EIO;
-
- if (!old_valid_dev(rdev))
- return -EINVAL;
-
- lock_kernel();
- coda_vfs_stat.create++;
-
- if (coda_isroot(dir) && coda_iscontrol(name, length)) {
- unlock_kernel();
- return -EPERM;
- }
-
- error = venus_create(dir->i_sb, coda_i2f(dir), name, length,
- 0, mode, rdev, &newfid, &attrs);
-
- if ( error ) {
- unlock_kernel();
- d_drop(de);
- return error;
- }
-
- inode = coda_iget(dir->i_sb, &newfid, &attrs);
- if ( IS_ERR(inode) ) {
- unlock_kernel();
- d_drop(de);
- return PTR_ERR(inode);
- }
-
- /* invalidate the directory cnode's attributes */
- coda_dir_changed(dir, 0);
- unlock_kernel();
- d_instantiate(de, inode);
- return 0;
-}
-