Index: class-wp-theme.php
===================================================================
--- class-wp-theme.php	(revision 21377)
+++ class-wp-theme.php	(working copy)
@@ -1109,18 +1109,24 @@
 
 		$current = $blog_id == get_current_blog_id();
 
-		if ( $current )
+		if ( $current ) {
 			$allowed_themes[ $blog_id ] = get_option( 'allowedthemes' );
-		else
-			$allowed_themes[ $blog_id ] = get_blog_option( $blog_id, 'allowedthemes' );
+		} else {
+			switch_to_blog( $blog_id );
+			$allowed_themes[ $blog_id ] = get_option( 'allowedthemes' );
+			restore_current_blog();
+		}
 
 		// This is all super old MU back compat joy.
 		// 'allowedthemes' keys things by stylesheet. 'allowed_themes' keyed things by name.
 		if ( false === $allowed_themes[ $blog_id ] ) {
-			if ( $current )
+			if ( $current ) {
 				$allowed_themes[ $blog_id ] = get_option( 'allowed_themes' );
-			else
-				$allowed_themes[ $blog_id ] = get_blog_option( $blog_id, 'allowed_themes' );
+			} else {
+				switch_to_blog( $blog_id );
+				$allowed_themes[ $blog_id ] = get_option( 'allowed_themes' );
+				restore_current_blog();
+			}
 
 			if ( ! is_array( $allowed_themes[ $blog_id ] ) || empty( $allowed_themes[ $blog_id ] ) ) {
 				$allowed_themes[ $blog_id ] = array();
@@ -1139,8 +1145,10 @@
 					update_option( 'allowedthemes', $allowed_themes[ $blog_id ] );
 					delete_option( 'allowed_themes' );
 				} else {
-					update_blog_option( $blog_id, 'allowedthemes', $allowed_themes[ $blog_id ] );
-					delete_blog_option( $blog_id, 'allowed_themes' );
+					switch_to_blog( $blog_id );
+					update_option( 'allowedthemes', $allowed_themes[ $blog_id ] );
+					delete_option( 'allowed_themes' );
+					restore_current_blog();
 				}
 			}
 		}
Index: ms-blogs.php
===================================================================
--- ms-blogs.php	(revision 21377)
+++ ms-blogs.php	(working copy)
@@ -222,9 +222,11 @@
 		return $details;
 	}
 
-	$details->blogname		= get_blog_option( $blog_id, 'blogname' );
-	$details->siteurl		= get_blog_option( $blog_id, 'siteurl' );
-	$details->post_count	= get_blog_option( $blog_id, 'post_count' );
+	switch_to_blog( $blog_id );
+	$details->blogname		= get_option( 'blogname' );
+	$details->siteurl		= get_option( 'siteurl' );
+	$details->post_count	= get_option( 'post_count' );
+	restore_current_blog();
 
 	$details = apply_filters( 'blog_details', $details );
 
@@ -307,127 +309,6 @@
 }
 
 /**
- * Retrieve option value for a given blog id based on name of option.
- *
- * If the option does not exist or does not have a value, then the return value
- * will be false. This is useful to check whether you need to install an option
- * and is commonly used during installation of plugin options and to test
- * whether upgrading is required.
- *
- * If the option was serialized then it will be unserialized when it is returned.
- *
- * @since MU
- *
- * @param int $id A blog ID. Can be null to refer to the current blog.
- * @param string $option Name of option to retrieve. Expected to not be SQL-escaped.
- * @param mixed $default Optional. Default value to return if the option does not exist.
- * @return mixed Value set for the option.
- */
-function get_blog_option( $id, $option, $default = false ) {
-	$id = (int) $id;
-
-	if ( empty( $id ) )
-		$id = get_current_blog_id();
-
-	if ( $id == get_current_blog_id() )
-		return get_option( $option, $default );
-
-	switch_to_blog( $id );
-	$option = get_option( $option, $default );
-	restore_current_blog();
-
-	return $option;
-}
-
-/**
- * Add a new option for a given blog id.
- *
- * You do not need to serialize values. If the value needs to be serialized, then
- * it will be serialized before it is inserted into the database. Remember,
- * resources can not be serialized or added as an option.
- *
- * You can create options without values and then update the values later.
- * Existing options will not be updated and checks are performed to ensure that you
- * aren't adding a protected WordPress option. Care should be taken to not name
- * options the same as the ones which are protected.
- *
- * @since MU
- *
- * @param int $id A blog ID. Can be null to refer to the current blog.
- * @param string $option Name of option to add. Expected to not be SQL-escaped.
- * @param mixed $value Optional. Option value, can be anything. Expected to not be SQL-escaped.
- * @return bool False if option was not added and true if option was added.
- */
-function add_blog_option( $id, $option, $value ) {
-	$id = (int) $id;
-
-	if ( empty( $id ) )
-		$id = get_current_blog_id();
-
-	if ( $id == get_current_blog_id() )
-		return add_option( $option, $value );
-
-	switch_to_blog( $id );
-	$return = add_option( $option, $value );
-	restore_current_blog();
-
-	return $return;
-}
-
-/**
- * Removes option by name for a given blog id. Prevents removal of protected WordPress options.
- *
- * @since MU
- *
- * @param int $id A blog ID. Can be null to refer to the current blog.
- * @param string $option Name of option to remove. Expected to not be SQL-escaped.
- * @return bool True, if option is successfully deleted. False on failure.
- */
-function delete_blog_option( $id, $option ) {
-	$id = (int) $id;
-
-	if ( empty( $id ) )
-		$id = get_current_blog_id();
-
-	if ( $id == get_current_blog_id() )
-		return delete_option( $option );
-
-	switch_to_blog( $id );
-	$return = delete_option( $option );
-	restore_current_blog();
-
-	return $return;
-}
-
-/**
- * Update an option for a particular blog.
- *
- * @since MU
- *
- * @param int $id The blog id
- * @param string $option The option key
- * @param mixed $value The option value
- * @return bool True on success, false on failrue.
- */
-function update_blog_option( $id, $option, $value, $deprecated = null ) {
-	$id = (int) $id;
-
-	if ( null !== $deprecated  )
-		_deprecated_argument( __FUNCTION__, '3.1' );
-
-	if ( $id == get_current_blog_id() )
-		return update_option( $option, $value );
-
-	switch_to_blog( $id );
-	$return = update_option( $option, $value );
-	restore_current_blog();
-
-	refresh_blog_details( $id );
-
-	return $return;
-}
-
-/**
  * Switch the current blog.
  *
  * This function is useful if you need to pull posts, or other information,
Index: class-wp-xmlrpc-server.php
===================================================================
--- class-wp-xmlrpc-server.php	(revision 21377)
+++ class-wp-xmlrpc-server.php	(working copy)
@@ -475,13 +475,15 @@
 			$blog_id = $blog->userblog_id;
 			$is_admin = current_user_can_for_blog( $blog_id, 'manage_options' );
 
+			switch_to_blog( $blog_id );
 			$struct[] = array(
 				'isAdmin'		=> $is_admin,
-				'url'			=> get_home_url( $blog_id, '/' ),
+				'url'			=> home_url( '/' ),
 				'blogid'		=> (string) $blog_id,
-				'blogName'		=> get_blog_option( $blog_id, 'blogname' ),
-				'xmlrpc'		=> get_site_url( $blog_id, 'xmlrpc.php' )
+				'blogName'		=> get_option( 'blogname' ),
+				'xmlrpc'		=> site_url( 'xmlrpc.php' )
 			);
+			restore_current_blog();
 		}
 
 		return $struct;
Index: link-template.php
===================================================================
--- link-template.php	(revision 21377)
+++ link-template.php	(working copy)
@@ -1896,10 +1896,13 @@
 	if ( !in_array( $scheme, array( 'http', 'https', 'relative' ) ) )
 		$scheme = is_ssl() && !is_admin() ? 'https' : 'http';
 
-	if ( empty( $blog_id ) || !is_multisite() )
+	if ( empty( $blog_id ) || !is_multisite() ) {
 		$url = get_option( 'home' );
-	else
-		$url = get_blog_option( $blog_id, 'home' );
+	} else {
+		switch_to_blog( $blog_id );
+		$url = get_option( 'home' );
+		restore_current_blog();
+	}
 
 	if ( 'relative' == $scheme )
 		$url = preg_replace( '#^.+://[^/]*#', '', $url );
@@ -1961,10 +1964,13 @@
 			$scheme = ( is_ssl() ? 'https' : 'http' );
 	}
 
-	if ( empty( $blog_id ) || !is_multisite() )
+	if ( empty( $blog_id ) || !is_multisite() ) {
 		$url = get_option( 'siteurl' );
-	else
-		$url = get_blog_option( $blog_id, 'siteurl' );
+	} else {
+		switch_to_blog( $blog_id );
+		$url = get_option( 'siteurl' );
+		restore_current_blog();
+	}
 
 	if ( 'relative' == $scheme )
 		$url = preg_replace( '#^.+://[^/]*#', '', $url );
Index: ms-deprecated.php
===================================================================
--- ms-deprecated.php	(revision 21377)
+++ ms-deprecated.php	(working copy)
@@ -270,3 +270,136 @@
 	}
 	return $url;
 }
+
+/**
+ * Retrieve option value for a given blog id based on name of option.
+ *
+ * If the option does not exist or does not have a value, then the return value
+ * will be false. This is useful to check whether you need to install an option
+ * and is commonly used during installation of plugin options and to test
+ * whether upgrading is required.
+ *
+ * If the option was serialized then it will be unserialized when it is returned.
+ *
+ * @since MU
+ * @deprecated 3.5.0
+ * 
+ * @param int $id A blog ID. Can be null to refer to the current blog.
+ * @param string $option Name of option to retrieve. Expected to not be SQL-escaped.
+ * @param mixed $default Optional. Default value to return if the option does not exist.
+ * @return mixed Value set for the option.
+ */
+function get_blog_option( $id, $option, $default = false ) {
+	_deprecated_function( __FUNCTION__, '3.5' );
+
+	$id = (int) $id;
+
+	if ( empty( $id ) )
+		$id = get_current_blog_id();
+
+	if ( $id == get_current_blog_id() )
+		return get_option( $option, $default );
+
+	switch_to_blog( $id );
+	$option = get_option( $option, $default );
+	restore_current_blog();
+
+	return $option;
+}
+
+/**
+ * Add a new option for a given blog id.
+ *
+ * You do not need to serialize values. If the value needs to be serialized, then
+ * it will be serialized before it is inserted into the database. Remember,
+ * resources can not be serialized or added as an option.
+ *
+ * You can create options without values and then update the values later.
+ * Existing options will not be updated and checks are performed to ensure that you
+ * aren't adding a protected WordPress option. Care should be taken to not name
+ * options the same as the ones which are protected.
+ *
+ * @since MU
+ * @deprecated 3.5.0
+ *
+ * @param int $id A blog ID. Can be null to refer to the current blog.
+ * @param string $option Name of option to add. Expected to not be SQL-escaped.
+ * @param mixed $value Optional. Option value, can be anything. Expected to not be SQL-escaped.
+ * @return bool False if option was not added and true if option was added.
+ */
+function add_blog_option( $id, $option, $value ) {
+	_deprecated_function( __FUNCTION__, '3.5' );
+
+	$id = (int) $id;
+
+	if ( empty( $id ) )
+		$id = get_current_blog_id();
+
+	if ( $id == get_current_blog_id() )
+		return add_option( $option, $value );
+
+	switch_to_blog( $id );
+	$return = add_option( $option, $value );
+	restore_current_blog();
+
+	return $return;
+}
+
+/**
+ * Removes option by name for a given blog id. Prevents removal of protected WordPress options.
+ *
+ * @since MU
+ * @deprecated 3.5.0
+ *
+ * @param int $id A blog ID. Can be null to refer to the current blog.
+ * @param string $option Name of option to remove. Expected to not be SQL-escaped.
+ * @return bool True, if option is successfully deleted. False on failure.
+ */
+function delete_blog_option( $id, $option ) {
+	_deprecated_function( __FUNCTION__, '3.5' );
+
+	$id = (int) $id;
+
+	if ( empty( $id ) )
+		$id = get_current_blog_id();
+
+	if ( $id == get_current_blog_id() )
+		return delete_option( $option );
+
+	switch_to_blog( $id );
+	$return = delete_option( $option );
+	restore_current_blog();
+
+	return $return;
+}
+
+/**
+ * Update an option for a particular blog.
+ *
+ * @since MU
+ * @deprecated 3.5.0
+ *
+ * @param int $id The blog id
+ * @param string $option The option key
+ * @param mixed $value The option value
+ * @return bool True on success, false on failrue.
+ */
+function update_blog_option( $id, $option, $value, $deprecated = null ) {
+	_deprecated_function( __FUNCTION__, '3.5' );
+
+	$id = (int) $id;
+
+	if ( null !== $deprecated  )
+		_deprecated_argument( __FUNCTION__, '3.1' );
+
+	if ( $id == get_current_blog_id() )
+		return update_option( $option, $value );
+
+	switch_to_blog( $id );
+	$return = update_option( $option, $value );
+	restore_current_blog();
+
+	refresh_blog_details( $id );
+
+	return $return;
+}
