]> 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>
Sat, 22 Jan 2011 20:42:48 +0000 (12:42 -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.

Change-Id: I7e60cceb4548b7ad3a1e045f390e7052fece4926
Reviewed-on: http://gerrit.openafs.org/3700
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
src/vol/namei_ops.c

index 9175aa0d88f632affd3d2125f048d897b05bc994..ef8d4fce81943edf9b1201dced580c265fcd1f8d 100644 (file)
@@ -662,32 +662,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)
 {
@@ -709,7 +691,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)
@@ -733,7 +738,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. */