CVS: is/fs25 cache.c,1.1,1.2

Robert Read <[email protected]> Fri, 11 Oct 2002 16:29:59 -0700
Newsgroups gmane.comp.file-systems.intermezzo.cvs
Message-ID <[email protected]>
Update of /cvsroot/intermezzo/is/fs25
In directory usw-pr-cvs1:/tmp/cvs-serv27823

Modified Files:
	cache.c 
Log Message:
* use new kdev_t  properly


Index: cache.c
===================================================================
RCS file: /cvsroot/intermezzo/is/fs25/cache.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -U2 -r1.1 -r1.2
--- cache.c	11 Oct 2002 22:52:01 -0000	1.1
+++ cache.c	11 Oct 2002 23:29:57 -0000	1.2
@@ -61,5 +61,5 @@
 static inline int presto_cache_hash(kdev_t dev)
 {
-        return (CACHES_MASK) & ((0x000F & (dev)) + ((0x0F00 & (dev)) >>8));
+        return (CACHES_MASK) & ((0x000F & (major(dev)) << 8) + (0x000F & minor(dev)));
 }
 
@@ -88,5 +88,5 @@
         while ( (tmp = lh->next) != lh ) {
                 cache = list_entry(tmp, struct presto_cache, cache_chain);
-                if ( cache->cache_dev == dev ) {
+                if ( kdev_same(cache->cache_dev, dev) ) {
                         return cache;
                 }
@@ -102,5 +102,5 @@
         ENTRY;
         /* find the correct presto_cache here, based on the device */
-        cache = presto_cache_find(inode->i_dev);
+        cache = presto_cache_find(to_kdev_t(inode->i_dev));
         if ( !cache ) {
                 CERROR("WARNING: no presto cache for dev %x, ino %ld\n",
@@ -123,5 +123,5 @@
         if ( !cache )
                 return 0;
-        return (inode->i_dev == cache->cache_dev);
+        return kdev_same(to_kdev_t(inode->i_dev), cache->cache_dev);
 }
 



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf