]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
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 c6544644bc0678efc3a71e5beb3327813b3aa3f3..1ecc74bcc77303c33d621a1f2b80726258f3551c 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 2eaa3a1392c4c48affb0ce8dc604eeba33f2c3e4..fbf705fc2300eef53b2ecaf4664bd4d379680038 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;