net: rework SIOCGSTAMP ioctl handling
[sfrench/cifs-2.6.git] / net / x25 / af_x25.c
index 20a511398389d686383e9d8c74434b3f2ad40f3f..0ea48a52ce798f059b5c89529193f91124438e17 100644 (file)
@@ -1398,18 +1398,6 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
                break;
        }
 
-       case SIOCGSTAMP:
-               rc = -EINVAL;
-               if (sk)
-                       rc = sock_get_timestamp(sk,
-                                               (struct timeval __user *)argp);
-               break;
-       case SIOCGSTAMPNS:
-               rc = -EINVAL;
-               if (sk)
-                       rc = sock_get_timestampns(sk,
-                                       (struct timespec __user *)argp);
-               break;
        case SIOCGIFADDR:
        case SIOCSIFADDR:
        case SIOCGIFDSTADDR:
@@ -1681,8 +1669,6 @@ static int compat_x25_ioctl(struct socket *sock, unsigned int cmd,
                                unsigned long arg)
 {
        void __user *argp = compat_ptr(arg);
-       struct sock *sk = sock->sk;
-
        int rc = -ENOIOCTLCMD;
 
        switch(cmd) {
@@ -1690,18 +1676,6 @@ static int compat_x25_ioctl(struct socket *sock, unsigned int cmd,
        case TIOCINQ:
                rc = x25_ioctl(sock, cmd, (unsigned long)argp);
                break;
-       case SIOCGSTAMP:
-               rc = -EINVAL;
-               if (sk)
-                       rc = compat_sock_get_timestamp(sk,
-                                       (struct timeval __user*)argp);
-               break;
-       case SIOCGSTAMPNS:
-               rc = -EINVAL;
-               if (sk)
-                       rc = compat_sock_get_timestampns(sk,
-                                       (struct timespec __user*)argp);
-               break;
        case SIOCGIFADDR:
        case SIOCSIFADDR:
        case SIOCGIFDSTADDR:
@@ -1765,6 +1739,7 @@ static const struct proto_ops x25_proto_ops = {
 #ifdef CONFIG_COMPAT
        .compat_ioctl = compat_x25_ioctl,
 #endif
+       .gettstamp =    sock_gettstamp,
        .listen =       x25_listen,
        .shutdown =     sock_no_shutdown,
        .setsockopt =   x25_setsockopt,