Whamcloud - gitweb
LU-1606 api: Do not include lustre_idl.h from lustreapi.h
authorChristopher J. Morrone <morrone2@llnl.gov>
Sat, 10 Nov 2012 02:06:29 +0000 (18:06 -0800)
committerOleg Drokin <green@whamcloud.com>
Wed, 21 Nov 2012 05:26:31 +0000 (00:26 -0500)
lustre_idl.h has become increasingly difficult to use from
user-space.  Normal users of the lustre api should not
be looking into lustre wire protocol anyway, so this change
eliminates the include of lustre_idl.h.

After removing lustre_idl.h, it became obvious that a number
of programs have been picking up normal user-space headers
through a very windy path of includes.  With the include
of lustre_idl.h gone, they no longer compiled, so we also
add the missing explicit includes.

It became clear that copytool.c explicity requires
libcfs/libcfs.h, and lustre_rsync.c require lustre_idl.h.
But I believe that it is far better to have those includes
explicitly stated, so it is obvious that those programs
are peeking into lustre's internals.  In the future we
can work on creating new lustre API calls that provide the
information that they need without side-stepping abstraction
layers.

Change-Id: I8ce55ffe0e1766515061f3dbc63c2372d5713f58
Signed-off-by: Christopher J. Morrone <morrone2@llnl.gov>
Reviewed-on: http://review.whamcloud.com/4505
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Richard Henwood <richard.henwood@intel.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Yu Jian <yujian@whamcloud.com>
Tested-by: Yu Jian <yujian@whamcloud.com>
lustre/include/lustre/lustreapi.h
lustre/tests/copytool.c
lustre/tests/multiop.c
lustre/tests/sendfile.c
lustre/utils/lustre_rsync.c

index 3abe2c8..3dc0f6c 100644 (file)
@@ -43,7 +43,6 @@
  */
 
 #include <lustre/lustre_user.h>
-#include <lustre/lustre_idl.h>
 
 typedef void (*llapi_cb_t)(char *obd_type_name, char *obd_name, char *obd_uuid, void *args);
 
index 36e86cc..f89e61d 100644 (file)
  */
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <getopt.h>
 #include <signal.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <unistd.h>
 
+#include <libcfs/libcfs.h>
 #include <lustre/lustreapi.h>
 
 void *ctdata;
index 9ed0522..4c9899a 100644 (file)
@@ -43,6 +43,7 @@
 #include <sys/stat.h>
 #include <sys/mman.h>
 #include <sys/vfs.h>
+#include <sys/ioctl.h>
 #include <signal.h>
 #include <stdlib.h>
 #include <unistd.h>
index 0156425..e26c417 100644 (file)
@@ -36,6 +36,8 @@
 #include <unistd.h>
 #include <fcntl.h>
 #include <stdlib.h>
+#include <errno.h>
+#include <time.h>
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/sendfile.h>
index c05a19e..2e50a87 100644 (file)
 
 #include <libcfs/libcfsutil.h>
 #include <lustre/lustreapi.h>
+#include <lustre/lustre_idl.h>
 #include "lustre_rsync.h"
 
 #define REPLICATE_STATUS_VER 1