Track requests that initiate inode fetches.
authorMichael Vrable <mvrable@cs.ucsd.edu>
Tue, 23 Nov 2010 18:27:31 +0000 (10:27 -0800)
committerMichael Vrable <mvrable@cs.ucsd.edu>
Tue, 23 Nov 2010 18:27:31 +0000 (10:27 -0800)
bluesky/bluesky.h
bluesky/inode.c

index e83c609..6bbf4a2 100644 (file)
@@ -289,6 +289,9 @@ typedef struct {
 
     /* Symlink-specific fields */
     gchar *symlink_contents;
+
+    /* A field for short-term use internally while the lock is held. */
+    gpointer private_data;
 } BlueSkyInode;
 
 /* A directory entry.  The name is UTF-8 and is a freshly-allocated string.
index b4b363c..8cd05a0 100644 (file)
@@ -359,6 +359,8 @@ static void inode_fetch_task(gpointer a, gpointer b)
 {
     BlueSkyInode *inode = (BlueSkyInode *)a;
 
+    bluesky_profile_set((BlueSkyProfile *)inode->private_data);
+
     BlueSkyCloudLog *item = inode->committed_item;
     inode->committed_item = NULL;
     g_print("Completing fetch of inode %"PRIu64"...\n", inode->inum);
@@ -404,5 +406,6 @@ void bluesky_inode_fetch(BlueSkyFS *fs, uint64_t inum)
     bluesky_cloudlog_ref(entry->item);
     bluesky_insert_inode(fs, inode);
 
+    inode->private_data = bluesky_profile_get();
     g_thread_pool_push(fs->inode_fetch_thread_pool, inode, NULL);
 }