]> arthur.barton.de Git - netatalk.git/commitdiff
reput a hash method for cnid, work only with *one* device, it's doesn't used
authordidg <didg>
Mon, 28 Apr 2003 10:12:53 +0000 (10:12 +0000)
committerdidg <didg>
Mon, 28 Apr 2003 10:12:53 +0000 (10:12 +0000)
the device number.

configure.in
etc/afpd/directory.h

index 872332a52dd0e035407a476648c469fd08cd1987..74c0f4582c9e267a05e7ae0e4b11f4394c4b2f17 100644 (file)
@@ -1,4 +1,4 @@
-dnl $Id: configure.in,v 1.179 2003-03-09 19:55:33 didg Exp $
+dnl $Id: configure.in,v 1.179.2.1 2003-04-28 10:12:53 didg Exp $
 dnl configure.in for netatalk
 
 AC_INIT(bin/adv1tov2/adv1tov2.c)
@@ -231,7 +231,7 @@ bdb_required=no
 dnl Determine DID scheme
 AC_MSG_CHECKING([for DID scheme to use])
 AC_ARG_WITH(did,
-       [  --with-did=SCHEME       set DID scheme (cnid,last)],
+       [  --with-did=SCHEME       set DID scheme (cnid,last,hash)],
        [ did_scheme="$withval" ],
        [ did_scheme="cnid" ]
 )
@@ -239,6 +239,9 @@ AC_ARG_WITH(did,
 if test "x$did_scheme" = "xlast"; then
        AC_DEFINE(USE_LASTDID, 1, [Define if the last DID scheme should be used])
        AC_MSG_RESULT([last])
+elif test "x$did_scheme" = "xhash"; then
+       AC_DEFINE(USE_HASHDID, 1, [Define if the hash DID scheme should be used, only one dev])
+       AC_MSG_RESULT([hash])
 elif test "x$did_scheme" = "xcnid"; then
        bdb_required="yes"
        AC_DEFINE(CNID_DB, 1, [Define if the CNID DB DID scheme should be used])
index 1eed0e48a92ed9f4f35ac68e273d5e0a6c368a80..8846f975fe305565496a76d004379d937179ebe1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: directory.h,v 1.13 2003-04-20 06:53:40 didg Exp $
+ * $Id: directory.h,v 1.13.2.1 2003-04-28 10:12:53 didg Exp $
  *
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
  * All Rights Reserved.
@@ -153,6 +153,8 @@ extern int path_isadir(struct path *o_path);
 /* file/directory ids. what a mess. we scramble things in a vain attempt
  * to get something meaningful */
 #ifndef AFS
+
+#if 0
 #define CNID_XOR(a)  (((a) >> 16) ^ (a))
 #define CNID_DEV(a)   ((((CNID_XOR(major((a)->st_dev)) & 0xf) << 3) | \
        (CNID_XOR(minor((a)->st_dev)) & 0x7)) << 24)
@@ -160,6 +162,10 @@ extern int path_isadir(struct path *o_path);
                                       & 0x00ffffff)
 #define CNID_FILE(a)  (((a) & 0x1) << 31)
 #define CNID(a,b)     (CNID_DEV(a) | CNID_INODE(a) | CNID_FILE(b))
+#endif
+
+#define CNID(a,b)     ((a)->st_ino & 0xffffffff)
+
 #else /* AFS */
 #define CNID(a,b)     (((a)->st_ino & 0x7fffffff) | CNID_FILE(b))
 #endif /* AFS */