]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
Fix nfsstat ordering issue nfs-utils-1-0-1-pre7
authorneilbrown <neilbrown>
Sun, 5 May 2002 23:33:30 +0000 (23:33 +0000)
committerneilbrown <neilbrown>
Sun, 5 May 2002 23:33:30 +0000 (23:33 +0000)
utils/nfsstat/nfsstat.c

index afd323ede6f1f269fba68e6d9ecf998cf8c78229..739dabac1683880df1df2d9eb379bedec6a0e73a 100644 (file)
@@ -59,8 +59,8 @@ static unsigned int   svcfhinfo[6];   /* (for kernels >= 2.4.0)
                                         * 0  stale
                                         * 1  FH lookups
                                         * 2  'anon' FHs
                                         * 0  stale
                                         * 1  FH lookups
                                         * 2  'anon' FHs
-                                        * 3  noncached non-directories
-                                        * 4  noncached directories
+                                        * 3  noncached directories
+                                        * 4  noncached non-directories
                                         * leave hole to relocate stale for order
                                         *    compatability.
                                         */
                                         * leave hole to relocate stale for order
                                         *    compatability.
                                         */
@@ -214,11 +214,17 @@ main(int argc, char **argv)
                /*
                 * 2.2 puts all fh-related info after the 'rc' header
                 * 2.4 puts all fh-related info after the 'fh' header, but relocates
                /*
                 * 2.2 puts all fh-related info after the 'rc' header
                 * 2.4 puts all fh-related info after the 'fh' header, but relocates
-                *     'stale' to the start :-(  We keep it at the end.
+                *     'stale' to the start and swaps dir and nondir :-(  
+                *     We preseve the 2.2 order
                 */
                if (opt_prt & PRNT_FH) {
                        if (get_stat_info("fh", svcinfo)) {     /* >= 2.4 */
                 */
                if (opt_prt & PRNT_FH) {
                        if (get_stat_info("fh", svcinfo)) {     /* >= 2.4 */
+                               int t = svcfhinfo[3];
+                               svcfhinfo[3]=svcfhinfo[4];
+                               svcfhinfo[4]=t;
+                               
                                svcfhinfo[5]=svcfhinfo[0]; /* relocate 'stale' */
                                svcfhinfo[5]=svcfhinfo[0]; /* relocate 'stale' */
+                               
                                print_numbers(
                                        "Server file handle cache:\n"
                                        "lookup     anon       ncachedir ncachedir  stale\n",
                                print_numbers(
                                        "Server file handle cache:\n"
                                        "lookup     anon       ncachedir ncachedir  stale\n",