+
+/*
+ * Display all dentries holding the specified inode.
+ */
+#if 0
+static void show_dentry(struct list_head * dlist, int subdirs)
+{
+ struct list_head *tmp = dlist;
+
+ while ((tmp = tmp->next) != dlist) {
+ struct dentry * dentry;
+ const char * unhashed = "";
+
+ if ( subdirs )
+ dentry = list_entry(tmp, struct dentry, d_child);
+ else
+ dentry = list_entry(tmp, struct dentry, d_alias);
+
+ if (list_empty(&dentry->d_hash))
+ unhashed = "(unhashed)";
+
+ if ( dentry->d_inode )
+ printk("show_dentry: %s/%s, d_count=%d%s (ino %ld, dev %d, ct %d)\n",
+ dentry->d_parent->d_name.name,
+ dentry->d_name.name, dentry->d_count,
+ unhashed, dentry->d_inode->i_ino,
+ dentry->d_inode->i_dev,
+ dentry->d_inode->i_count);
+ else
+ printk("show_dentry: %s/%s, d_count=%d%s \n",
+ dentry->d_parent->d_name.name,
+ dentry->d_name.name, dentry->d_count,
+ unhashed);
+ }
+}
+#endif
+
+
+struct inode *obdfs_new_inode(struct inode *dir)
+{
+ struct obdo *obdo;
+ struct inode *inode;
+ int err;
+
+ obdo = obdo_alloc();
+ if (!obdo) {
+ EXIT;
+ return ERR_PTR(-ENOMEM);
+ }
+
+ err = IOPS(dir, create)(IID(dir), obdo);
+ if ( err )
+ return ERR_PTR(err);
+
+ inode = iget(dir->i_sb, (unsigned long)obdo->o_id);
+ if (!inode) {
+ obdo_free(obdo);
+ EXIT;
+ return ERR_PTR(-EIO);
+ }
+
+ if (!list_empty(&inode->i_dentry)) {
+ CDEBUG(D_INODE, "New inode (%ld) has aliases!\n",
+ inode->i_ino);
+ iput(inode);
+ EXIT;
+ return ERR_PTR(-EIO);
+ }
+
+
+ obdo_free(obdo);
+ EXIT;
+ return inode;
+}
+
+