Whamcloud - gitweb
Branch b1_4
authoradilger <adilger>
Wed, 8 Jun 2005 20:20:00 +0000 (20:20 +0000)
committeradilger <adilger>
Wed, 8 Jun 2005 20:20:00 +0000 (20:20 +0000)
Move common KEY_IS() macro to header.

lustre/include/linux/obd_support.h
lustre/lov/lov_obd.c
lustre/osc/osc_request.c

index 9cb4ea8..98294db 100644 (file)
@@ -455,4 +455,7 @@ do {                                                                          \
         (ptr) = (void *)0xdeadbeef;                                           \
 } while (0)
 
+#define KEY_IS(str) \
+        (keylen == strlen(str) && memcmp(key, str, keylen) == 0)
+
 #endif
index 5b8835a..9fd2370 100644 (file)
@@ -2035,9 +2035,6 @@ static int lov_set_info(struct obd_export *exp, obd_count keylen,
         int i, rc = 0, err;
         ENTRY;
 
-#define KEY_IS(str) \
-        (keylen == strlen(str) && memcmp(key, str, keylen) == 0)
-
         if (KEY_IS("next_id")) {
                 if (vallen != lov->desc.ld_tgt_count)
                         RETURN(-EINVAL);
@@ -2083,7 +2080,6 @@ static int lov_set_info(struct obd_export *exp, obd_count keylen,
                         rc = err;
         }
         RETURN(rc);
-#undef KEY_IS
 }
 
 int lov_test_and_clear_async_rc(struct lov_stripe_md *lsm)
index f0d67de..de285be 100644 (file)
@@ -3067,9 +3067,6 @@ static int osc_set_info(struct obd_export *exp, obd_count keylen,
         char *bufs[1] = {key};
         ENTRY;
 
-#define KEY_IS(str) \
-        (keylen == strlen(str) && memcmp(key, str, keylen) == 0)
-
         OBD_FAIL_TIMEOUT(OBD_FAIL_OSC_SHUTDOWN, 10);
 
         if (KEY_IS("next_id")) {