[glick2] No need for data subdir in exports



commit 310eb6d2e96eacf66e8339bf23fbf157a5a2fdac
Author: Alexander Larsson <alexl redhat com>
Date:   Tue Nov 29 16:51:39 2011 +0100

    No need for data subdir in exports

 fs.c |   23 ++++++++++++++++-------
 1 files changed, 16 insertions(+), 7 deletions(-)
---
diff --git a/fs.c b/fs.c
index 80eeaf5..eba7d8b 100644
--- a/fs.c
+++ b/fs.c
@@ -2079,7 +2079,7 @@ glick_mount_unref (GlickMount *mount)
 }
 
 static GlickMount *
-glick_mount_new (const char *name)
+glick_mount_new (const char *name, gboolean with_data_subdir)
 {
   GlickMount *mount;
 
@@ -2098,10 +2098,19 @@ glick_mount_new (const char *name)
   glick_inode_dir_add_child (glick_root, mount->name, (GlickInode *)mount->top_dir);
   glick_inode_own ((GlickInode *)mount->top_dir);
   glick_inode_set_immutable ((GlickInode *)mount->top_dir, TRUE);
-  mount->dir = glick_inode_new_dir ();
-  glick_inode_dir_add_child (mount->top_dir, "data", (GlickInode *)mount->dir);
-  glick_inode_own ((GlickInode *)mount->dir);
-  glick_inode_set_immutable ((GlickInode *)mount->dir, TRUE);
+
+  if (with_data_subdir)
+    {
+      mount->dir = glick_inode_new_dir ();
+      glick_inode_dir_add_child (mount->top_dir, "data", (GlickInode *)mount->dir);
+      glick_inode_own ((GlickInode *)mount->dir);
+      glick_inode_set_immutable ((GlickInode *)mount->dir, TRUE);
+    }
+  else
+    {
+      mount->dir = mount->top_dir;
+      glick_inode_ref ((GlickInode *)mount->top_dir);
+    }
   mount->dir->mount = mount;
   mount->dir->mount_path = g_strdup ("/");
 
@@ -2160,7 +2169,7 @@ glick_mount_new_public (void)
   GList *l;
   int i;
 
-  mount = glick_mount_new ("exports");
+  mount = glick_mount_new ("exports", FALSE);
   if (mount == NULL)
     return NULL;
 
@@ -2278,7 +2287,7 @@ glick_mount_new_for_bundle (int fd)
 
   header = (GlickBundleHeader *)data;
 
-  mount = glick_mount_new (NULL);
+  mount = glick_mount_new (NULL, TRUE);
   if (mount == NULL)
     goto out;
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]