diff --git a/lnet/include/libcfs/libcfs.h b/lnet/include/libcfs/libcfs.h
index 6bb84c3..0e2bd2b 100644
--- a/lnet/include/libcfs/libcfs.h
+++ b/lnet/include/libcfs/libcfs.h
@@ -58,6 +58,7 @@
 
 #ifndef __KERNEL__
 #include <stdio.h>
+#define NO_QUOTA 1
 #endif
 
 /* Controlled via configure key */
diff --git a/lnet/include/libcfs/linux/linux-fs.h b/lnet/include/libcfs/linux/linux-fs.h
index 8cbd637..376b6d7 100644
--- a/lnet/include/libcfs/linux/linux-fs.h
+++ b/lnet/include/libcfs/linux/linux-fs.h
@@ -75,7 +75,7 @@ cfs_file_t *cfs_filp_open (const char *name, int flags, int mode, int *err);
 #define cfs_filp_close(f)                   filp_close(f, NULL)
 #define cfs_filp_read(fp, buf, size, pos)   (fp)->f_op->read((fp), (buf), (size), pos)
 #define cfs_filp_write(fp, buf, size, pos)  (fp)->f_op->write((fp), (buf), (size), pos)
-#define cfs_filp_fsync(fp)                  (fp)->f_op->fsync((fp), (fp)->f_dentry, 1)
+#define cfs_filp_fsync(fp)                  (fp)->f_op->fsync((fp), 1)
 
 #define cfs_get_file(f)                     get_file(f)
 #define cfs_put_file(f)                     fput(f)
diff --git a/lnet/libcfs/linux/linux-proc.c b/lnet/libcfs/linux/linux-proc.c
index 7b14dfd..15dfc4b 100644
--- a/lnet/libcfs/linux/linux-proc.c
+++ b/lnet/libcfs/linux/linux-proc.c
@@ -347,7 +347,6 @@ static cfs_sysctl_table_t lnet_table[] = {
          * to go via /proc for portability.
          */
         {
-                .ctl_name = PSDEV_DEBUG,
                 .procname = "debug",
                 .data     = &libcfs_debug,
                 .maxlen   = sizeof(int),
@@ -355,7 +354,6 @@ static cfs_sysctl_table_t lnet_table[] = {
                 .proc_handler = &proc_dobitmasks,
         },
         {
-                .ctl_name = PSDEV_SUBSYSTEM_DEBUG,
                 .procname = "subsystem_debug",
                 .data     = &libcfs_subsystem_debug,
                 .maxlen   = sizeof(int),
@@ -363,7 +361,6 @@ static cfs_sysctl_table_t lnet_table[] = {
                 .proc_handler = &proc_dobitmasks,
         },
         {
-                .ctl_name = PSDEV_PRINTK,
                 .procname = "printk",
                 .data     = &libcfs_printk,
                 .maxlen   = sizeof(int),
@@ -371,7 +368,6 @@ static cfs_sysctl_table_t lnet_table[] = {
                 .proc_handler = &proc_dobitmasks,
         },
         {
-                .ctl_name = PSDEV_CONSOLE_RATELIMIT,
                 .procname = "console_ratelimit",
                 .data     = &libcfs_console_ratelimit,
                 .maxlen   = sizeof(int),
@@ -379,28 +375,24 @@ static cfs_sysctl_table_t lnet_table[] = {
                 .proc_handler = &proc_dointvec
         },
         {
-                .ctl_name = PSDEV_CONSOLE_MAX_DELAY_CS,
                 .procname = "console_max_delay_centisecs",
                 .maxlen   = sizeof(int),
                 .mode     = 0644,
                 .proc_handler = &proc_console_max_delay_cs
         },
         {
-                .ctl_name = PSDEV_CONSOLE_MIN_DELAY_CS,
                 .procname = "console_min_delay_centisecs",
                 .maxlen   = sizeof(int),
                 .mode     = 0644,
                 .proc_handler = &proc_console_min_delay_cs
         },
         {
-                .ctl_name = PSDEV_CONSOLE_BACKOFF,
                 .procname = "console_backoff",
                 .maxlen   = sizeof(int),
                 .mode     = 0644,
                 .proc_handler = &proc_console_backoff
         },
         {
-                .ctl_name = PSDEV_DEBUG_PATH,
                 .procname = "debug_path",
                 .data     = debug_file_path_arr,
                 .maxlen   = sizeof(debug_file_path_arr),
@@ -408,7 +400,6 @@ static cfs_sysctl_table_t lnet_table[] = {
                 .proc_handler = &proc_dostring,
         },
         {
-                .ctl_name = PSDEV_LNET_UPCALL,
                 .procname = "upcall",
                 .data     = lnet_upcall,
                 .maxlen   = sizeof(lnet_upcall),
@@ -416,7 +407,6 @@ static cfs_sysctl_table_t lnet_table[] = {
                 .proc_handler = &proc_dostring,
         },
         {
-                .ctl_name = PSDEV_LNET_DEBUG_LOG_UPCALL,
                 .procname = "debug_log_upcall",
                 .data     = lnet_debug_log_upcall,
                 .maxlen   = sizeof(lnet_debug_log_upcall),
@@ -424,54 +414,44 @@ static cfs_sysctl_table_t lnet_table[] = {
                 .proc_handler = &proc_dostring,
         },
         {
-                .ctl_name = PSDEV_LNET_MEMUSED,
                 .procname = "memused",
                 .data     = (int *)&libcfs_kmemory.counter,
                 .maxlen   = sizeof(int),
                 .mode     = 0444,
                 .proc_handler = &proc_dointvec,
-                .strategy = &sysctl_intvec,
         },
         {
-                .ctl_name = PSDEV_LNET_CATASTROPHE,
                 .procname = "catastrophe",
                 .data     = &libcfs_catastrophe,
                 .maxlen   = sizeof(int),
                 .mode     = 0444,
                 .proc_handler = &proc_dointvec,
-                .strategy = &sysctl_intvec,
         },
         {
-                .ctl_name = PSDEV_LNET_PANIC_ON_LBUG,
                 .procname = "panic_on_lbug",
                 .data     = &libcfs_panic_on_lbug,
                 .maxlen   = sizeof(int),
                 .mode     = 0644,
                 .proc_handler = &proc_dointvec,
-                .strategy = &sysctl_intvec,
         },
         {
-                .ctl_name = PSDEV_LNET_DUMP_KERNEL,
                 .procname = "dump_kernel",
                 .maxlen   = 256,
                 .mode     = 0200,
                 .proc_handler = &proc_dump_kernel,
         },
         {
-                .ctl_name = PSDEV_LNET_DAEMON_FILE,
                 .procname = "daemon_file",
                 .mode     = 0644,
                 .maxlen   = 256,
                 .proc_handler = &proc_daemon_file,
         },
         {
-                .ctl_name = PSDEV_LNET_DEBUG_MB,
                 .procname = "debug_mb",
                 .mode     = 0644,
                 .proc_handler = &proc_debug_mb,
         },
         {
-                .ctl_name = PSDEV_LNET_WATCHDOG_RATELIMIT,
                 .procname = "watchdog_ratelimit",
                 .data     = &libcfs_watchdog_ratelimit,
                 .maxlen   = sizeof(int),
@@ -480,7 +460,7 @@ static cfs_sysctl_table_t lnet_table[] = {
                 .extra1   = &min_watchdog_ratelimit,
                 .extra2   = &max_watchdog_ratelimit,
         },
-        {       .ctl_name = PSDEV_LNET_FORCE_LBUG,
+        {       
                 .procname = "force_lbug",
                 .data     = NULL,
                 .maxlen   = 0,
@@ -493,7 +473,6 @@ static cfs_sysctl_table_t lnet_table[] = {
 #ifdef CONFIG_SYSCTL
 static cfs_sysctl_table_t top_table[] = {
         {
-                .ctl_name = CTL_LNET,
                 .procname = "lnet",
                 .mode     = 0555,
                 .data     = NULL,
@@ -501,7 +480,6 @@ static cfs_sysctl_table_t top_table[] = {
                 .child    = lnet_table,
         },
         {
-                .ctl_name = 0
         }
 };
 
diff --git a/lnet/libcfs/linux/linux-tcpip.c b/lnet/libcfs/linux/linux-tcpip.c
index fa69117..5260893 100644
--- a/lnet/libcfs/linux/linux-tcpip.c
+++ b/lnet/libcfs/linux/linux-tcpip.c
@@ -621,7 +621,7 @@ libcfs_sock_accept (struct socket **newsockp, struct socket *sock)
         newsock->ops = sock->ops;
 
         set_current_state(TASK_INTERRUPTIBLE);
-        add_wait_queue(sock->sk->sk_sleep, &wait);
+        add_wait_queue(sk_sleep(sock->sk), &wait);
 
         rc = sock->ops->accept(sock, newsock, O_NONBLOCK);
         if (rc == -EAGAIN) {
@@ -630,7 +630,7 @@ libcfs_sock_accept (struct socket **newsockp, struct socket *sock)
                 rc = sock->ops->accept(sock, newsock, O_NONBLOCK);
         }
 
-        remove_wait_queue(sock->sk->sk_sleep, &wait);
+        remove_wait_queue(sk_sleep(sock->sk), &wait);
         set_current_state(TASK_RUNNING);
 
         if (rc != 0)
@@ -649,7 +649,7 @@ EXPORT_SYMBOL(libcfs_sock_accept);
 void
 libcfs_sock_abort_accept (struct socket *sock)
 {
-        wake_up_all(sock->sk->sk_sleep);
+        wake_up_all(sk_sleep(sock->sk));
 }
 
 EXPORT_SYMBOL(libcfs_sock_abort_accept);
diff --git a/lnet/lnet/router_proc.c b/lnet/lnet/router_proc.c
index 8e7b657..94d2fdb 100644
--- a/lnet/lnet/router_proc.c
+++ b/lnet/lnet/router_proc.c
@@ -672,37 +672,31 @@ static cfs_sysctl_table_t lnet_table[] = {
          * to go via /proc for portability.
          */
         {
-                .ctl_name = PSDEV_LNET_STATS,
                 .procname = "stats",
                 .mode     = 0644,
                 .proc_handler = &proc_lnet_stats,
         },
         {
-                .ctl_name = PSDEV_LNET_ROUTES,
                 .procname = "routes",
                 .mode     = 0444,
                 .proc_handler = &proc_lnet_routes,
         },
         {
-                .ctl_name = PSDEV_LNET_ROUTERS,
                 .procname = "routers",
                 .mode     = 0444,
                 .proc_handler = &proc_lnet_routers,
         },
         {
-                .ctl_name = PSDEV_LNET_PEERS,
                 .procname = "peers",
                 .mode     = 0444,
                 .proc_handler = &proc_lnet_peers,
         },
         {
-                .ctl_name = PSDEV_LNET_PEERS,
                 .procname = "buffers",
                 .mode     = 0444,
                 .proc_handler = &proc_lnet_buffers,
         },
         {
-                .ctl_name = PSDEV_LNET_NIS,
                 .procname = "nis",
                 .mode     = 0444,
                 .proc_handler = &proc_lnet_nis,
@@ -712,7 +706,6 @@ static cfs_sysctl_table_t lnet_table[] = {
 
 static cfs_sysctl_table_t top_table[] = {
         {
-                .ctl_name = CTL_LNET,
                 .procname = "lnet",
                 .mode     = 0555,
                 .data     = NULL,
@@ -720,7 +713,6 @@ static cfs_sysctl_table_t top_table[] = {
                 .child    = lnet_table,
         },
         {
-                .ctl_name = 0
         }
 };
 
diff --git a/lustre/llite/file.c b/lustre/llite/file.c
index 4858a16..9c9c6aa 100644
--- a/lustre/llite/file.c
+++ b/lustre/llite/file.c
@@ -3099,9 +3099,9 @@ int ll_flush(struct file *file)
         return rc ? -EIO : 0;
 }
 
-int ll_fsync(struct file *file, struct dentry *dentry, int data)
+int ll_fsync(struct file *file, int data)
 {
-        struct inode *inode = dentry->d_inode;
+        struct inode *inode = file->f_dentry->d_inode;
         struct ll_inode_info *lli = ll_i2info(inode);
         struct lov_stripe_md *lsm = lli->lli_smd;
         struct ll_fid fid;
diff --git a/lustre/llite/llite_internal.h b/lustre/llite/llite_internal.h
index 5bf3b3e..6616185 100644
--- a/lustre/llite/llite_internal.h
+++ b/lustre/llite/llite_internal.h
@@ -800,7 +800,7 @@ int ll_dir_setstripe(struct inode *inode, struct lov_user_md *lump,
                      int set_default);
 int ll_dir_getstripe(struct inode *inode, struct lov_mds_md **lmm,
                      int *lmm_size, struct ptlrpc_request **request);
-int ll_fsync(struct file *file, struct dentry *dentry, int data);
+int ll_fsync(struct file *file, int data);
 int ll_do_fiemap(struct inode *inode, struct ll_user_fiemap *fiemap,
               int num_bytes);
 
diff --git a/lustre/lvfs/lvfs_linux.c b/lustre/lvfs/lvfs_linux.c
index a189007..e9877d2 100644
--- a/lustre/lvfs/lvfs_linux.c
+++ b/lustre/lvfs/lvfs_linux.c
@@ -428,7 +428,7 @@ int lustre_fsync(struct file *file)
         if (!file || !file->f_op || !file->f_op->fsync)
                 RETURN(-ENOSYS);
 
-        RETURN(file->f_op->fsync(file, file->f_dentry, 0));
+        RETURN(file->f_op->fsync(file, 0));
 }
 EXPORT_SYMBOL(lustre_fsync);
 
diff --git a/lustre/mdc/mdc_locks.c b/lustre/mdc/mdc_locks.c
index 68382e8..f01d152 100644
--- a/lustre/mdc/mdc_locks.c
+++ b/lustre/mdc/mdc_locks.c
@@ -185,7 +185,7 @@ static inline void mdc_clear_replay_flag(struct ptlrpc_request *req, int rc)
         }
 }
 
-static int round_up(int val)
+static int round_up_lustre(int val)
 {
         int ret = 1;
         while (val) {
@@ -301,7 +301,7 @@ static struct ptlrpc_request *mdc_intent_open_pack(struct obd_export *exp,
         rc = lustre_msg_size(class_exp2cliimp(exp)->imp_msg_magic,
                              bufcount, size);
         if (rc & (rc - 1))
-                size[bufcount - 1] = min(size[bufcount - 1] + round_up(rc) - rc,
+                size[bufcount - 1] = min(size[bufcount - 1] + round_up_lustre(rc) - rc,
                                          (__u32)obddev->u.cli.cl_max_mds_easize);
 
         /* If inode is known, cancel conflicting OPEN locks. */
diff --git a/lustre/obdclass/linux/linux-sysctl.c b/lustre/obdclass/linux/linux-sysctl.c
index 9b5a226..ccbb46e 100644
--- a/lustre/obdclass/linux/linux-sysctl.c
+++ b/lustre/obdclass/linux/linux-sysctl.c
@@ -342,7 +342,6 @@ int LL_PROC_PROTO(proc_at_history)
 #ifdef CONFIG_SYSCTL
 static cfs_sysctl_table_t obd_table[] = {
         {
-                .ctl_name = OBD_FAIL_LOC,
                 .procname = "fail_loc",
                 .data     = &obd_fail_loc,
                 .maxlen   = sizeof(int),
@@ -350,16 +349,13 @@ static cfs_sysctl_table_t obd_table[] = {
                 .proc_handler = &proc_fail_loc
         },
         {
-                .ctl_name = OBD_FAIL_VAL,
                 .procname = "fail_val",
                 .data     = &obd_fail_val,
                 .maxlen   = sizeof(int),
                 .mode     = 0644,
                 .proc_handler = &proc_dointvec,
-                .strategy = &sysctl_intvec,
         },
         {
-                .ctl_name = OBD_TIMEOUT,
                 .procname = "timeout",
                 .data     = &obd_timeout,
                 .maxlen   = sizeof(int),
@@ -367,7 +363,6 @@ static cfs_sysctl_table_t obd_table[] = {
                 .proc_handler = &proc_set_timeout
         },
         {
-                .ctl_name = OBD_DEBUG_PEER_ON_TIMEOUT,
                 .procname = "debug_peer_on_timeout",
                 .data     = &obd_debug_peer_on_timeout,
                 .maxlen   = sizeof(int),
@@ -375,7 +370,6 @@ static cfs_sysctl_table_t obd_table[] = {
                 .proc_handler = &proc_dointvec,
         },
         {
-                .ctl_name = OBD_DUMP_ON_TIMEOUT,
                 .procname = "dump_on_timeout",
                 .data     = &obd_dump_on_timeout,
                 .maxlen   = sizeof(int),
@@ -383,7 +377,6 @@ static cfs_sysctl_table_t obd_table[] = {
                 .proc_handler = &proc_dointvec,
         },
         {
-                .ctl_name = OBD_DUMP_ON_EVICTION,
                 .procname = "dump_on_eviction",
                 .data     = &obd_dump_on_eviction,
                 .maxlen   = sizeof(int),
@@ -391,7 +384,6 @@ static cfs_sysctl_table_t obd_table[] = {
                 .proc_handler = &proc_dointvec,
         },
         {
-                .ctl_name = OBD_MEMUSED,
                 .procname = "memused",
                 .data     = NULL,
                 .maxlen   = 0,
@@ -399,7 +391,6 @@ static cfs_sysctl_table_t obd_table[] = {
                 .proc_handler = &proc_memory_alloc,
         },
         {
-                .ctl_name = OBD_PAGESUSED,
                 .procname = "pagesused",
                 .data     = NULL,
                 .maxlen   = 0,
@@ -407,7 +398,6 @@ static cfs_sysctl_table_t obd_table[] = {
                 .proc_handler = &proc_pages_alloc,
         },
         {
-                .ctl_name = OBD_MAXMEMUSED,
                 .procname = "memused_max",
                 .data     = NULL,
                 .maxlen   = 0,
@@ -415,7 +405,6 @@ static cfs_sysctl_table_t obd_table[] = {
                 .proc_handler = &proc_mem_max,
         },
         {
-                .ctl_name = OBD_MAXPAGESUSED,
                 .procname = "pagesused_max",
                 .data     = NULL,
                 .maxlen   = 0,
@@ -423,7 +412,6 @@ static cfs_sysctl_table_t obd_table[] = {
                 .proc_handler = &proc_pages_max,
         },
         {
-                .ctl_name = OBD_LDLM_TIMEOUT,
                 .procname = "ldlm_timeout",
                 .data     = &ldlm_timeout,
                 .maxlen   = sizeof(int),
@@ -432,7 +420,6 @@ static cfs_sysctl_table_t obd_table[] = {
         },
 #ifdef RANDOM_FAIL_ALLOC
         {
-                .ctl_name = OBD_ALLOC_FAIL_RATE,
                 .procname = "alloc_fail_rate",
                 .data     = &obd_alloc_fail_rate,
                 .maxlen   = sizeof(int),
@@ -441,7 +428,6 @@ static cfs_sysctl_table_t obd_table[] = {
         },
 #endif
         {
-                .ctl_name = OBD_MAX_DIRTY_PAGES,
                 .procname = "max_dirty_mb",
                 .data     = &obd_max_dirty_pages,
                 .maxlen   = sizeof(int),
@@ -449,7 +435,6 @@ static cfs_sysctl_table_t obd_table[] = {
                 .proc_handler = &proc_max_dirty_pages_in_mb
         },
         {
-                .ctl_name = OBD_AT_MIN,
                 .procname = "at_min",
                 .data     = &at_min,
                 .maxlen   = sizeof(int),
@@ -457,7 +442,6 @@ static cfs_sysctl_table_t obd_table[] = {
                 .proc_handler = &proc_at_min
         },
         {
-                .ctl_name = OBD_AT_MAX,
                 .procname = "at_max",
                 .data     = &at_max,
                 .maxlen   = sizeof(int),
@@ -465,7 +449,6 @@ static cfs_sysctl_table_t obd_table[] = {
                 .proc_handler = &proc_at_max
         },
         {
-                .ctl_name = OBD_AT_EXTRA,
                 .procname = "at_extra",
                 .data     = &at_extra,
                 .maxlen   = sizeof(int),
@@ -473,7 +456,6 @@ static cfs_sysctl_table_t obd_table[] = {
                 .proc_handler = &proc_at_extra
         },
         {
-                .ctl_name = OBD_AT_EARLY_MARGIN,
                 .procname = "at_early_margin",
                 .data     = &at_early_margin,
                 .maxlen   = sizeof(int),
@@ -481,7 +463,6 @@ static cfs_sysctl_table_t obd_table[] = {
                 .proc_handler = &proc_at_early_margin
         },
         {
-                .ctl_name = OBD_AT_HISTORY,
                 .procname = "at_history",
                 .data     = &at_history,
                 .maxlen   = sizeof(int),
@@ -493,7 +474,6 @@ static cfs_sysctl_table_t obd_table[] = {
 
 static cfs_sysctl_table_t parent_table[] = {
        {
-               .ctl_name = CTL_LUSTRE,
                .procname = "lustre",
                .data     = NULL,
                .maxlen   = 0,
diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c
index 70c13c1..f93e9c9 100644
--- a/lustre/osc/osc_request.c
+++ b/lustre/osc/osc_request.c
@@ -41,6 +41,7 @@
 
 #ifdef __KERNEL__
 # include <libcfs/libcfs.h>
+#define NO_QUOTA 1
 #else /* __KERNEL__ */
 # include <liblustre.h>
 #endif
diff --git a/lustre/quota/quota_interface.c b/lustre/quota/quota_interface.c
index 939c495..a653903 100644
--- a/lustre/quota/quota_interface.c
+++ b/lustre/quota/quota_interface.c
@@ -48,6 +48,8 @@
 #  include <linux/buffer_head.h>
 #  include <linux/workqueue.h>
 #  include <linux/mount.h>
+#define QUOTA_OK 0
+#define NO_QUOTA 1
 #else /* __KERNEL__ */
 # include <liblustre.h>
 #endif
diff --git a/lustre/tests/Makefile.am b/lustre/tests/Makefile.am
index 98d7398..79ea8c2 100644
--- a/lustre/tests/Makefile.am
+++ b/lustre/tests/Makefile.am
@@ -62,7 +62,7 @@ endif # TESTS
 mmap_sanity_SOURCES= mmap_sanity.c
 
 LIBLUSTREAPI := $(top_builddir)/lustre/utils/liblustreapi.a
-multiop_LDADD=$(LIBLUSTREAPI) -lrt
+multiop_LDADD=$(LIBLUSTREAPI) -lrt $(PTHREAD_LIBS)
 
 ll_dirstripe_verify_SOURCES= ll_dirstripe_verify.c
 ll_dirstripe_verify_LDADD= -L$(top_builddir)/lustre/utils -llustreapi
