]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
vol: make it clearer that SetOGM is not impl on Windows
authorJeffrey Altman <jaltman@your-file-system.com>
Thu, 20 Jan 2011 06:39:11 +0000 (01:39 -0500)
committerDerrick Brashear <shadow@dementia.org>
Fri, 4 Feb 2011 20:00:49 +0000 (12:00 -0800)
Separate the SetOGM function into two implementations to
match the other OGM functions.  Implement the Windows version
as returning -1 always.

In the future, the OGM functions could be renamed to express
their purpose: saving and restoring the volume id and tag
associated with a file.   Windows currently encodes this
information using the CreationDate and the file name but
in the future this information might be stored in an alternate
data stream.

Reviewed-on: http://gerrit.openafs.org/3700
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 270e5c01784f6459dd3d1dec81b714a6d7f2baea)

Change-Id: I347fb7b135c6fccb941ca4e34b3fb4f080f5b09c
Reviewed-on: http://gerrit.openafs.org/3847
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
src/vol/namei_ops.c

index a1535ddf50aed9b3b0a88bbc2b9b1a7304a8491a..526b30245eab637714deb1c92ff51a46a3e6b4e8 100644 (file)
@@ -657,32 +657,14 @@ namei_MakeSpecIno(int volid, int type)
     return ino;
 }
 
-/* SetOGM - set owner group and mode bits from parm and tag */
+#ifdef AFS_NT40_ENV
+/* SetOGM */
 static int
 SetOGM(FD_t fd, int parm, int tag)
 {
-#ifndef AFS_NT40_ENV
-/*
- * owner - low 15 bits of parm.
- * group - next 15 bits of parm.
- * mode - 2 bits of parm, then lowest = 3 bits of tag.
- */
-    int owner, group, mode;
-
-    owner = parm & 0x7fff;
-    group = (parm >> 15) & 0x7fff;
-    if (fchown(fd, owner, group) < 0)
-       return -1;
-
-    mode = (parm >> 27) & 0x18;
-    mode |= tag & 0x7;
-    if (fchmod(fd, mode) < 0)
-       return -1;
-#endif
-    return 0;
+    return -1;
 }
 
-#ifdef AFS_NT40_ENV
 static int
 CheckOGM(namei_t *name, FdHandle_t *fdP, int p1)
 {
@@ -704,7 +686,30 @@ CheckOGM(namei_t *name, FdHandle_t *fdP, int p1)
 
     return 0;
 }
-#else
+#else /* AFS_NT40_ENV */
+/* SetOGM - set owner group and mode bits from parm and tag */
+static int
+SetOGM(FD_t fd, int parm, int tag)
+{
+/*
+ * owner - low 15 bits of parm.
+ * group - next 15 bits of parm.
+ * mode - 2 bits of parm, then lowest = 3 bits of tag.
+ */
+    int owner, group, mode;
+
+    owner = parm & 0x7fff;
+    group = (parm >> 15) & 0x7fff;
+    if (fchown(fd, owner, group) < 0)
+       return -1;
+
+    mode = (parm >> 27) & 0x18;
+    mode |= tag & 0x7;
+    if (fchmod(fd, mode) < 0)
+       return -1;
+    return 0;
+}
+
 /* GetOGM - get parm and tag from owner, group and mode bits. */
 static void
 GetOGMFromStat(struct afs_stat *status, int *parm, int *tag)
@@ -728,7 +733,7 @@ CheckOGM(namei_t *name, FdHandle_t *fdP, int p1)
 
     return 0;
 }
-#endif
+#endif /* !AFS_NT40_ENV */
 
 int big_vno = 0;               /* Just in case we ever do 64 bit vnodes. */