Linux: Simplify header file checks
[openafs.git] / src / afs / LINUX / osi_proc.c
index 2ac51af..ca83ca0 100644 (file)
 #include <afsconfig.h>
 #include "afs/param.h"
 
-RCSID
-    ("$Header$");
 
 #include <linux/module.h> /* early to avoid printf->printk mapping */
-#ifdef HAVE_KERNEL_LINUX_SEQ_FILE_H
+#ifdef HAVE_LINUX_SEQ_FILE_H
 #include <linux/seq_file.h>
 #endif
 #include "afs/sysincludes.h"
 #include "afsincludes.h"
 #include "afs/nfsclient.h"
-#include "h/unistd.h"          /* For syscall numbers. */
-#include "h/mm.h"
+#include <linux/unistd.h>              /* For syscall numbers. */
+#include <linux/mm.h>
 
 #ifdef AFS_AMD64_LINUX20_ENV
 #include <asm/ia32_unistd.h>
@@ -39,7 +37,7 @@ RCSID
 
 struct proc_dir_entry *openafs_procfs;
 
-#ifdef HAVE_KERNEL_LINUX_SEQ_FILE_H
+#ifdef HAVE_LINUX_SEQ_FILE_H
 static void *c_start(struct seq_file *m, loff_t *pos)
 {
        struct afs_q *cq, *tq;
@@ -69,7 +67,7 @@ static void *c_next(struct seq_file *m, void *p, loff_t *pos)
        tq = QNext(cq);
 
        if (tq == &CellLRU)
-               return NULL;
+               tq = NULL;
 
        AFS_GUNLOCK();
        return tq;
@@ -91,7 +89,7 @@ static int c_show(struct seq_file *m, void *p)
        seq_printf(m, ">%s #(%d/%d)\n", tc->cellName,
                   tc->cellNum, tc->cellIndex);
 
-       for (j = 0; j < MAXCELLHOSTS; j++) {
+       for (j = 0; j < AFS_MAXCELLHOSTS; j++) {
                afs_uint32 addr;
 
                if (!tc->cellHosts[j]) break;
@@ -247,7 +245,7 @@ static struct file_operations afs_unixuser_fops = {
 };
 
 
-#else /* HAVE_KERNEL_LINUX_SEQ_FILE_H */
+#else /* HAVE_LINUX_SEQ_FILE_H */
 
 static int
 csdbproc_info(char *buffer, char **start, off_t offset, int
@@ -284,7 +282,7 @@ length)
             }
         }
 
-        for (cnt = 0; cnt < MAXCELLHOSTS; cnt++) {
+        for (cnt = 0; cnt < AFS_MAXCELLHOSTS; cnt++) {
             if (!tc->cellHosts[cnt]) break;
             pos += 90;
             if (pos <= offset) {
@@ -316,7 +314,7 @@ done:
     return len;
 }
 
-#endif /* HAVE_KERNEL_LINUX_SEQ_FILE_H */
+#endif /* HAVE_LINUX_SEQ_FILE_H */
 
 void
 osi_proc_init(void)
@@ -332,7 +330,7 @@ osi_proc_init(void)
     sprintf(path, "fs/%s", PROC_FSDIRNAME);
     openafs_procfs = proc_mkdir(path, NULL);
 #endif
-#ifdef HAVE_KERNEL_LINUX_SEQ_FILE_H
+#ifdef HAVE_LINUX_SEQ_FILE_H
     entry = create_proc_entry("unixusers", 0, openafs_procfs);
     if (entry) {
        entry->proc_fops = &afs_unixuser_fops;
@@ -359,7 +357,7 @@ osi_proc_clean(void)
 #endif
 
     remove_proc_entry(PROC_CELLSERVDB_NAME, openafs_procfs);
-#ifdef HAVE_KERNEL_LINUX_SEQ_FILE_H
+#ifdef HAVE_LINUX_SEQ_FILE_H
     remove_proc_entry("unixusers", openafs_procfs);
 #endif
 #if defined(EXPORTED_PROC_ROOT_FS)