kernel-wide: replace USHORT_MAX, SHORT_MAX and SHORT_MIN with USHRT_MAX, SHRT_MAX...
[safe/jmp/linux-2.6] / net / 9p / protocol.c
index 94f5a8f..149f821 100644 (file)
@@ -28,6 +28,7 @@
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/uaccess.h>
+#include <linux/slab.h>
 #include <linux/sched.h>
 #include <linux/types.h>
 #include <net/9p/9p.h>
@@ -340,7 +341,8 @@ p9pdu_vreadf(struct p9_fcall *pdu, int proto_version, const char *fmt,
                        }
                        break;
                case '?':
-                       if (proto_version != p9_proto_2000u)
+                       if ((proto_version != p9_proto_2000u) &&
+                               (proto_version != p9_proto_2000L))
                                return 0;
                        break;
                default:
@@ -392,7 +394,7 @@ p9pdu_vwritef(struct p9_fcall *pdu, int proto_version, const char *fmt,
                                const char *sptr = va_arg(ap, const char *);
                                int16_t len = 0;
                                if (sptr)
-                                       len = MIN(strlen(sptr), USHORT_MAX);
+                                       len = MIN(strlen(sptr), USHRT_MAX);
 
                                errcode = p9pdu_writef(pdu, proto_version,
                                                                "w", len);
@@ -487,7 +489,8 @@ p9pdu_vwritef(struct p9_fcall *pdu, int proto_version, const char *fmt,
                        }
                        break;
                case '?':
-                       if (proto_version != p9_proto_2000u)
+                       if ((proto_version != p9_proto_2000u) &&
+                               (proto_version != p9_proto_2000L))
                                return 0;
                        break;
                default: