Windows: GetVolumeInfo cell name
authorJeffrey Altman <jaltman@your-file-system.com>
Thu, 7 Feb 2013 03:44:44 +0000 (22:44 -0500)
committerJeffrey Altman <jaltman@your-file-system.com>
Fri, 8 Feb 2013 03:03:32 +0000 (19:03 -0800)
The service was supposed to provide the redirector the cell name
as part of the AFSVolumeInfoCB response from RDR_GetVolumeInfo.
Add a new field to store it and populate it.

Change-Id: Idcafaee66ed1031dfdeee1804bbdff617e464d3f
Reviewed-on: http://gerrit.openafs.org/9079
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

src/WINNT/afsrdr/common/AFSUserStructs.h
src/WINNT/afsrdr/user/RDRFunction.c

index c654464..1ecc74b 100644 (file)
@@ -264,7 +264,11 @@ typedef struct _AFS_VOLUME_INFORMATION
 
     ULONG           VolumeLabelLength;
 
-    WCHAR           VolumeLabel[128];            /* Volume:Cell */
+    WCHAR           VolumeLabel[128];           /* Volume */
+
+    ULONG           CellLength;
+
+    WCHAR           Cell[128];                  /* Cell */
 
 } AFSVolumeInfoCB;
 
index 2eaa3a1..fbf705f 100644 (file)
@@ -5364,7 +5364,6 @@ RDR_GetVolumeInfo( IN cm_user_t     *userp,
     cm_scache_t *scp = NULL;
     cm_volume_t *volp = NULL;
     afs_uint32   volType;
-    cm_cell_t   *cellp = NULL;
     cm_fid_t    Fid;
     afs_uint32  code;
     cm_req_t    req;
@@ -5447,6 +5446,11 @@ RDR_GetVolumeInfo( IN cm_user_t     *userp,
                                                        (sizeof(pResultCB->VolumeLabel) / sizeof(WCHAR)) + 1);
         if ( pResultCB->VolumeLabelLength )
             pResultCB->VolumeLabelLength--;
+
+        pResultCB->CellLength = cm_Utf8ToUtf16( "Freelance.Local", -1, pResultCB->Cell,
+                                                (sizeof(pResultCB->Cell) / sizeof(WCHAR)) + 1);
+        if ( pResultCB->CellLength )
+            pResultCB->CellLength--;
     } else {
         memcpy(&pResultCB->VolumeCreationTime, &ft, sizeof(ft));
 
@@ -5539,6 +5543,13 @@ RDR_GetVolumeInfo( IN cm_user_t     *userp,
         if ( pResultCB->VolumeLabelLength )
             pResultCB->VolumeLabelLength--;
 
+        pResultCB->CellLength = cm_Utf8ToUtf16( volp->cellp->name, -1, pResultCB->Cell,
+                                                (sizeof(pResultCB->Cell) / sizeof(WCHAR)) + 1);
+
+        /* do not include the trailing nul */
+        if ( pResultCB->CellLength )
+            pResultCB->CellLength--;
+
         if (sync_done) {
             if (!scp_locked) {
                 lock_ObtainWrite(&scp->rw);
@@ -5574,7 +5585,6 @@ RDR_GetVolumeSizeInfo( IN cm_user_t     *userp,
     cm_scache_t *scp = NULL;
     cm_volume_t *volp = NULL;
     afs_uint32   volType;
-    cm_cell_t   *cellp = NULL;
     cm_fid_t    Fid;
     afs_uint32  code;
     cm_req_t    req;