From 88821fe897cbb8b0d83785551fbb4787b1e74c66 Mon Sep 17 00:00:00 2001 From: Michael Vrable Date: Tue, 23 Nov 2010 10:27:31 -0800 Subject: [PATCH] Track requests that initiate inode fetches. --- bluesky/bluesky.h | 3 +++ bluesky/inode.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/bluesky/bluesky.h b/bluesky/bluesky.h index e83c609..6bbf4a2 100644 --- a/bluesky/bluesky.h +++ b/bluesky/bluesky.h @@ -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. diff --git a/bluesky/inode.c b/bluesky/inode.c index b4b363c..8cd05a0 100644 --- a/bluesky/inode.c +++ b/bluesky/inode.c @@ -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); } -- 2.20.1