diff --git a/fs/cifs/dfs_cache.c b/fs/cifs/dfs_cache.c
index 6ee8496..3860241 100644
--- a/fs/cifs/dfs_cache.c
+++ b/fs/cifs/dfs_cache.c
@@ -20,6 +20,7 @@
 #include "smb2glob.h"
 
 #include "dfs_cache.h"
+#include "fs_context.h"
 
 #define CACHE_HTABLE_SIZE 32
 #define CACHE_MAX_ENTRIES 64
@@ -48,8 +49,8 @@ struct cache_entry {
 
 struct vol_info {
 	char *fullpath;
-	spinlock_t smb_vol_lock;
-	struct smb_vol smb_vol;
+	spinlock_t ctx_lock;
+	struct smb3_fs_context ctx;
 	char *mntdata;
 	struct list_head list;
 	struct list_head rlist;
@@ -586,7 +587,7 @@ static void __vol_release(struct vol_info *vi)
 {
 	kfree(vi->fullpath);
 	kfree(vi->mntdata);
-	cifs_cleanup_volume_info_contents(&vi->smb_vol);
+	cifs_cleanup_volume_info_contents(&vi->ctx);
 	kfree(vi);
 }
 
@@ -1140,43 +1141,43 @@ int dfs_cache_get_tgt_referral(const char *path,
 	return rc;
 }
 
-static int dup_vol(struct smb_vol *vol, struct smb_vol *new)
+static int dup_vol(struct smb3_fs_context *ctx, struct smb3_fs_context *new)
 {
-	memcpy(new, vol, sizeof(*new));
+	memcpy(new, ctx, sizeof(*new));
 
-	if (vol->username) {
-		new->username = kstrndup(vol->username, strlen(vol->username),
+	if (ctx->username) {
+		new->username = kstrndup(ctx->username, strlen(ctx->username),
 					 GFP_KERNEL);
 		if (!new->username)
 			return -ENOMEM;
 	}
-	if (vol->password) {
-		new->password = kstrndup(vol->password, strlen(vol->password),
+	if (ctx->password) {
+		new->password = kstrndup(ctx->password, strlen(ctx->password),
 					 GFP_KERNEL);
 		if (!new->password)
 			goto err_free_username;
 	}
-	if (vol->UNC) {
-		cifs_dbg(FYI, "%s: vol->UNC: %s\n", __func__, vol->UNC);
-		new->UNC = kstrndup(vol->UNC, strlen(vol->UNC), GFP_KERNEL);
+	if (ctx->UNC) {
+		cifs_dbg(FYI, "%s: ctx->UNC: %s\n", __func__, ctx->UNC);
+		new->UNC = kstrndup(ctx->UNC, strlen(ctx->UNC), GFP_KERNEL);
 		if (!new->UNC)
 			goto err_free_password;
 	}
-	if (vol->domainname) {
-		new->domainname = kstrndup(vol->domainname,
-					   strlen(vol->domainname), GFP_KERNEL);
+	if (ctx->domainname) {
+		new->domainname = kstrndup(ctx->domainname,
+					   strlen(ctx->domainname), GFP_KERNEL);
 		if (!new->domainname)
 			goto err_free_unc;
 	}
-	if (vol->iocharset) {
-		new->iocharset = kstrndup(vol->iocharset,
-					  strlen(vol->iocharset), GFP_KERNEL);
+	if (ctx->iocharset) {
+		new->iocharset = kstrndup(ctx->iocharset,
+					  strlen(ctx->iocharset), GFP_KERNEL);
 		if (!new->iocharset)
 			goto err_free_domainname;
 	}
-	if (vol->prepath) {
-		cifs_dbg(FYI, "%s: vol->prepath: %s\n", __func__, vol->prepath);
-		new->prepath = kstrndup(vol->prepath, strlen(vol->prepath),
+	if (ctx->prepath) {
+		cifs_dbg(FYI, "%s: ctx->prepath: %s\n", __func__, ctx->prepath);
+		new->prepath = kstrndup(ctx->prepath, strlen(ctx->prepath),
 					GFP_KERNEL);
 		if (!new->prepath)
 			goto err_free_iocharset;
@@ -1203,17 +1204,17 @@ static int dup_vol(struct smb_vol *vol, struct smb_vol *new)
  * DFS cache refresh worker.
  *
  * @mntdata: mount data.
- * @vol: cifs volume.
+ * @ctx: cifs context.
  * @fullpath: origin full path.
  *
  * Return zero if volume was set up correctly, otherwise non-zero.
  */
-int dfs_cache_add_vol(char *mntdata, struct smb_vol *vol, const char *fullpath)
+int dfs_cache_add_vol(char *mntdata, struct smb3_fs_context *ctx, const char *fullpath)
 {
 	int rc;
 	struct vol_info *vi;
 
-	if (!vol || !fullpath || !mntdata)
+	if (!ctx || !fullpath || !mntdata)
 		return -EINVAL;
 
 	cifs_dbg(FYI, "%s: fullpath: %s\n", __func__, fullpath);
@@ -1228,12 +1229,12 @@ int dfs_cache_add_vol(char *mntdata, struct smb_vol *vol, const char *fullpath)
 		goto err_free_vi;
 	}
 
-	rc = dup_vol(vol, &vi->smb_vol);
+	rc = dup_vol(ctx, &vi->ctx);
 	if (rc)
 		goto err_free_fullpath;
 
 	vi->mntdata = mntdata;
-	spin_lock_init(&vi->smb_vol_lock);
+	spin_lock_init(&vi->ctx_lock);
 	kref_init(&vi->refcnt);
 
 	spin_lock(&vol_list_lock);
@@ -1289,10 +1290,10 @@ int dfs_cache_update_vol(const char *fullpath, struct TCP_Server_Info *server)
 	spin_unlock(&vol_list_lock);
 
 	cifs_dbg(FYI, "%s: updating volume info\n", __func__);
-	spin_lock(&vi->smb_vol_lock);
-	memcpy(&vi->smb_vol.dstaddr, &server->dstaddr,
-	       sizeof(vi->smb_vol.dstaddr));
-	spin_unlock(&vi->smb_vol_lock);
+	spin_lock(&vi->ctx_lock);
+	memcpy(&vi->ctx.dstaddr, &server->dstaddr,
+	       sizeof(vi->ctx.dstaddr));
+	spin_unlock(&vi->ctx_lock);
 
 	kref_put(&vi->refcnt, vol_release);
 
@@ -1445,11 +1446,11 @@ static inline void put_tcp_server(struct TCP_Server_Info *server)
 	cifs_put_tcp_session(server, 0);
 }
 
-static struct TCP_Server_Info *get_tcp_server(struct smb_vol *vol)
+static struct TCP_Server_Info *get_tcp_server(struct smb3_fs_context *ctx)
 {
 	struct TCP_Server_Info *server;
 
-	server = cifs_find_tcp_session(vol);
+	server = cifs_find_tcp_session(ctx);
 	if (IS_ERR_OR_NULL(server))
 		return NULL;
 
@@ -1476,7 +1477,7 @@ static struct cifs_ses *find_root_ses(struct vol_info *vi,
 	char *mdata = NULL, *devname = NULL;
 	struct TCP_Server_Info *server;
 	struct cifs_ses *ses;
-	struct smb_vol vol = {NULL};
+	struct smb3_fs_context ctx = {NULL};
 
 	rpath = get_dfs_root(path);
 	if (IS_ERR(rpath))
@@ -1510,7 +1511,7 @@ static struct cifs_ses *find_root_ses(struct vol_info *vi,
 		goto out;
 	}
 
-	rc = cifs_setup_volume_info(&vol, mdata, devname, false);
+	rc = cifs_setup_volume_info(&ctx, mdata, devname, false);
 	kfree(devname);
 
 	if (rc) {
@@ -1518,16 +1519,16 @@ static struct cifs_ses *find_root_ses(struct vol_info *vi,
 		goto out;
 	}
 
-	server = get_tcp_server(&vol);
+	server = get_tcp_server(&ctx);
 	if (!server) {
 		ses = ERR_PTR(-EHOSTDOWN);
 		goto out;
 	}
 
-	ses = cifs_get_smb_ses(server, &vol);
+	ses = cifs_get_smb_ses(server, &ctx);
 
 out:
-	cifs_cleanup_volume_info_contents(&vol);
+	cifs_cleanup_volume_info_contents(&ctx);
 	kfree(mdata);
 	kfree(rpath);
 
@@ -1619,7 +1620,7 @@ static void refresh_cache_worker(struct work_struct *work)
 	 */
 	spin_lock(&vol_list_lock);
 	list_for_each_entry(vi, &vol_list, list) {
-		server = get_tcp_server(&vi->smb_vol);
+		server = get_tcp_server(&vi->ctx);
 		if (!server)
 			continue;
 
@@ -1631,9 +1632,9 @@ static void refresh_cache_worker(struct work_struct *work)
 
 	/* Walk through all TCONs and refresh any expired cache entry */
 	list_for_each_entry_safe(vi, nvi, &vols, rlist) {
-		spin_lock(&vi->smb_vol_lock);
-		server = get_tcp_server(&vi->smb_vol);
-		spin_unlock(&vi->smb_vol_lock);
+		spin_lock(&vi->ctx_lock);
+		server = get_tcp_server(&vi->ctx);
+		spin_unlock(&vi->ctx_lock);
 
 		if (!server)
 			goto next_vol;
