[LC_CONFIG_OBD_BUFFER_SIZE
# include/liblustre.h
-AC_CHECK_HEADERS([asm/page.h sys/user.h stdint.h])
+AC_CHECK_HEADERS([asm/page.h sys/user.h sys/vfs.h stdint.h])
# include/lustre/lustre_user.h
# See note there re: __ASM_X86_64_PROCESSOR_H
return old;
}
+struct nameidata;
+
+#if !defined(__DARWIN8__)
static inline int ll_path_lookup(const char *path, unsigned int flags, struct nameidata *nd)
{
int ret = 0;
}
return ret;
}
+#endif
#define to_kdev_t(dev) (dev)
#define kdev_t_to_nr(dev) (dev)
#define ext2_test_bit test_bit
-#endif /* !__KERNEL__ */
+#endif /* __KERNEL__ */
#endif
#ifdef __KERNEL__
static inline sigset_t l_w_e_set_sigs(sigset_t sigs)
{
- struct proc *p = current_proc();
- sigset_t old;
+ sigset_t old = 0;
+ /* XXX Liang: how to change sigmask in Darwin8.x?
+ * there is syscall like pthread_sigmask() but we cannot
+ * use in kernel */
+#if !defined(__DARWIN8__)
+ struct proc *p = current_proc();
extern int block_procsigmask(struct proc *p, int bit);
old = cfs_current()->uu_sigmask;
block_procsigmask(p, ~sigs);
+#endif
return old;
}
#endif
#include <libcfs/libcfs.h>
-#include <netat/sysglue.h>
#undef WITH_GROUP_INFO
# include <string.h>
#endif
-#if defined(__KERNEL__)
typedef struct stat lstat_t;
#define HAVE_LOV_USER_MDS_DATA
-#endif
#ifndef LPU64
-/* x86_64 defines __u64 as "long" in userspace, but "long long" in the kernel */
-#if defined(__x86_64__) && defined(__KERNEL__)
-# define LPU64 "%Lu"
-# define LPD64 "%Ld"
-# define LPX64 "%#Lx"
-# define LPSZ "%lu"
-# define LPSSZ "%ld"
-#elif (BITS_PER_LONG == 32 || __WORDSIZE == 32)
-# define LPU64 "%Lu"
-# define LPD64 "%Ld"
-# define LPX64 "%#Lx"
+#if (BITS_PER_LONG == 32 || __WORDSIZE == 32)
+# define LPU64 "%llu"
+# define LPD64 "%lld"
+# define LPX64 "%#llx"
# define LPSZ "%u"
# define LPSSZ "%d"
#elif (BITS_PER_LONG == 64 || __WORDSIZE == 64)
#error Do not #include this file directly. #include <obd_class.h> instead
#endif
-#define to_kdev_t(dev) dev
+#if !defined(__KERNEL__)
+#define to_kdev_t(dev) (dev)
+#endif
#endif /* __XNU_OBD_CLASS_H */
--- /dev/null
+#ifndef _LUSTRE_DARWIN_TYPES_H
+#define _LUSTRE_DARWIN_TYPES_H
+
+#include <libcfs/libcfs.h>
+
+#endif
#include <string.h>
#include <errno.h>
#include <sys/stat.h>
-#include <sys/vfs.h>
+#ifdef HAVE_SYS_VFS_H
+# include <sys/vfs.h>
+#endif
#include <unistd.h>
#include <fcntl.h>
#define QUOTA_OK 0
#define NO_QUOTA 1
-/* proc */
-#define proc_symlink(...) \
-({ \
- void *result = NULL; \
- result; \
-})
-
/* ACL */
struct posix_acl_entry {
short e_tag;
linux_HEADERS = lustre_idl.h
endif
-EXTRA_DIST = lprocfs_status.h lustre_debug.h lustre_lib.h \
+EXTRA_DIST = lprocfs_status.h lustre_debug.h lustre_lib.h types.h\
lustre_dlm.h lustre_handles.h lustre_net.h obd_class.h obd_support.h \
lustre_log.h lustre_compat25.h lustre_fsfilt.h lustre_mds.h obd.h \
lvfs.h lvfs_linux.h lustre_lite.h lustre_idl.h lustre_quota.h lustre_user.h
#include <lustre/types.h>
#endif
-#ifdef HAVE_QUOTA_SUPPORT
-#include <linux/quota.h>
-#endif
#ifndef __KERNEL__
-#define NEED_QUOTA_DEFS
+# define NEED_QUOTA_DEFS
+# ifdef HAVE_QUOTA_SUPPORT
+# include <sys/quota.h>
+# endif
#else
# include <linux/version.h>
# if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,21)
# define NEED_QUOTA_DEFS
# endif
+# ifdef HAVE_QUOTA_SUPPORT
+# include <linux/quota.h>
+# endif
#endif
/*
--- /dev/null
+#ifndef _LUSTRE_LINUX_TYPES_H
+#define _LUSTRE_LINUX_TYPES_H
+
+typedef unsigned short umode_t;
+
+#if (!defined(_LINUX_TYPES_H) && !defined(_BLKID_TYPES_H) && \
+ !defined(_EXT2_TYPES_H) && !defined(_I386_TYPES_H))
+
+/*
+ * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
+ * header files exported to user space
+ */
+
+typedef __signed__ char __s8;
+typedef unsigned char __u8;
+
+typedef __signed__ short __s16;
+typedef unsigned short __u16;
+
+typedef __signed__ int __s32;
+typedef unsigned int __u32;
+
+typedef __signed__ long long __s64;
+typedef unsigned long long __u64;
+#endif
+
+#endif
#ifndef _LUSTRE_TYPES_H
#define _LUSTRE_TYPES_H
-typedef unsigned short umode_t;
-
-#if (!defined(_LINUX_TYPES_H) && !defined(_BLKID_TYPES_H) && \
- !defined(_EXT2_TYPES_H) && !defined(_I386_TYPES_H))
-
-/*
- * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
- * header files exported to user space
- */
-
-typedef __signed__ char __s8;
-typedef unsigned char __u8;
-
-typedef __signed__ short __s16;
-typedef unsigned short __u16;
-
-typedef __signed__ int __s32;
-typedef unsigned int __u32;
-
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
+#if defined(__linux__)
+#include <linux/types.h>
+#elif defined(__APPLE__)
+#include <darwin/types.h>
+#elif defined(__WINNT__)
+#include <winnt/types.h>
+#else
+#error Unsupported operating system.
#endif
#endif
} \
if (condition) \
break; \
- if (cfs_signal_pending(cfs_current())) { \
+ if (cfs_signal_pending()) { \
if (!info->lwi_timeout || __timed_out) { \
break; \
} else { \
/* -EINTR when the RPC actually succeeded. */ \
/* the RECALC_SIGPENDING below will deliver the */ \
/* signal properly. */ \
- cfs_sigmask_lock(cfs_current(), irqflags); \
- cfs_clear_sigpending(cfs_current()); \
- cfs_sigmask_unlock(cfs_current(), irqflags); \
+ cfs_sigmask_lock(irqflags); \
+ cfs_clear_sigpending(); \
+ cfs_sigmask_unlock(irqflags); \
} \
} \
} \
cfs_block_sigs(blocked); \
\
if ((!info->lwi_timeout || __timed_out) && \
- cfs_signal_pending(cfs_current())) { \
+ cfs_signal_pending()) { \
if (info->lwi_on_signal) \
info->lwi_on_signal(info->lwi_cb_data); \
ret = -EINTR; \
* If the cache is older than @max_age we will get a new value from the
* target. Use a value of "jiffies + HZ" to guarantee freshness. */
static inline int obd_statfs(struct obd_device *obd, struct obd_statfs *osfs,
- unsigned long max_age)
+ cfs_time_t max_age)
{
int rc = 0;
ENTRY;
OBD_CHECK_OP(obd, statfs, -EOPNOTSUPP);
OBD_COUNTER_INCREMENT(obd, statfs);
- CDEBUG(D_SUPER, "osfs %lu, max_age %lu\n", obd->obd_osfs_age, max_age);
- if (time_before(obd->obd_osfs_age, max_age)) {
+ CDEBUG(D_SUPER, "osfs "CFS_TIME_T", max_age "CFS_TIME_T"\n",
+ obd->obd_osfs_age, max_age);
+ if (cfs_time_before(obd->obd_osfs_age, max_age)) {
rc = OBP(obd, statfs)(obd, osfs, max_age);
if (rc == 0) {
spin_lock(&obd->obd_osfs_lock);
static inline int obd_prep_async_page(struct obd_export *exp,
struct lov_stripe_md *lsm,
struct lov_oinfo *loi,
- struct page *page, obd_off offset,
+ cfs_page_t *page, obd_off offset,
struct obd_async_page_ops *ops,
void *data, void **res)
{
<string>1.0.0</string>
<key>OSBundleLibraries</key>
<dict>
- <key>com.apple.kernel.bsd</key>
- <string>1.1</string>
- <key>com.apple.kernel.iokit</key>
- <string>1.0.0b1</string>
- <key>com.apple.kernel.mach</key>
- <string>1.0.0b1</string>
- <key>com.clusterfs.lustre.libcfs</key>
- <string>1.0.0</string>
- <key>com.clusterfs.lustre.portals</key>
- <string>1.0.0</string>
- <key>com.clusterfs.lustre.lvfs</key>
- <string>1.0.0</string>
- <key>com.clusterfs.lustre.obdclass</key>
- <string>1.0.0</string>
- <key>com.clusterfs.lustre.osc</key>
- <string>1.0.0</string>
+ <key>com.apple.kpi.bsd</key>
+ <string>8.0.0b1</string>
+ <key>com.apple.kpi.libkern</key>
+ <string>8.0.0b1</string>
+ <key>com.apple.kpi.mach</key>
+ <string>8.0.0b1</string>
+ <key>com.clusterfs.lustre.libcfs</key>
+ <string>1.0.0</string>
+ <key>com.clusterfs.lustre.lvfs</key>
+ <string>1.0.0</string>
+ <key>com.clusterfs.lustre.obdclass</key>
+ <string>1.0.0</string>
+ <key>com.clusterfs.lustre.ptlrpc</key>
+ <string>1.0.0</string>
</dict>
</dict>
</plist>
plist_DATA := Info.plist
-#install-data-hook: fix-kext-ownership
+install_data_hook := fix-kext-ownership
endif # DARWIN
endif # MODULES
+install-data-hook: $(install_data_hook)
+
DIST_SOURCES = $(lov-objs:.o=.c) lov_internal.h
MOSTLYCLEANFILES := @MOSTLYCLEANFILES@
<key>OSBundleCompatibleVersion</key>
<string>1.0.0</string>
<key>OSBundleLibraries</key>
- <dict>
- <key>com.apple.kernel.bsd</key>
- <string>1.1</string>
- <key>com.apple.kernel.iokit</key>
- <string>1.0.0b1</string>
- <key>com.apple.kernel.mach</key>
- <string>1.0.0b1</string>
+ <dict>
+ <key>com.apple.kpi.bsd</key>
+ <string>8.0.0b1</string>
+ <key>com.apple.kpi.libkern</key>
+ <string>8.0.0b1</string>
+ <key>com.apple.kpi.mach</key>
+ <string>8.0.0b1</string>
+ <key>com.apple.kpi.unsupported</key>
+ <string>8.0.0b1</string>
<key>com.clusterfs.lustre.libcfs</key>
- <string>1.0.0</string>
- <key>com.clusterfs.lustre.lnet</key>
<string>1.0.0</string>
</dict>
</dict>
plist_DATA := Info.plist
-#install-data-hook: fix-kext-ownership
+install_data_hook := fix-kext-ownership
endif # DARWIN
endif # MODULES
+install-data-hook: $(install_data_hook)
+
DIST_SOURCES = fsfilt.c fsfilt_ext3.c fsfilt_reiserfs.c lvfs_common.c \
lvfs_internal.h lvfs_linux.c lvfs_userfs.c \
upcall_cache.c \
LBUG();
}
-int lvfs_arch_init(void)
-{
- return 0;
-}
-
-void lvfs_arch_exit(void)
-{
- return;
-}
-
-
static int __init lvfs_init(void)
{
int ret = 0;
ENTRY;
- ret = lvfs_arch_init();
-
RETURN(ret);
}
int leaked;
ENTRY;
- lvfs_arch_exit();
leaked = atomic_read(&obd_memory);
CDEBUG(leaked ? D_ERROR : D_INFO,
"obd mem max: %d leaked: %d\n", obd_memmax, leaked);
<string>1.0.0</string>
<key>OSBundleLibraries</key>
<dict>
- <key>com.apple.kernel.bsd</key>
- <string>1.1</string>
- <key>com.apple.kernel.iokit</key>
- <string>1.0.0b1</string>
- <key>com.apple.kernel.mach</key>
- <string>1.0.0b1</string>
+ <key>com.apple.kpi.bsd</key>
+ <string>8.0.0b1</string>
+ <key>com.apple.kpi.libkern</key>
+ <string>8.0.0b1</string>
+ <key>com.apple.kpi.mach</key>
+ <string>8.0.0b1</string>
+ <key>com.apple.kpi.unsupported</key>
+ <string>8.0.0b1</string>
<key>com.clusterfs.lustre.libcfs</key>
<string>1.0.0</string>
- <key>com.clusterfs.lustre.lnet</key>
- <string>1.0.0</string>
<key>com.clusterfs.lustre.lvfs</key>
<string>1.0.0</string>
</dict>
plist_DATA := Info.plist
-#install-data-hook: fix-kext-ownership
+install_data_hook := fix-kext-ownership
+
endif # DARWIN
endif # MODULES
+install-data-hook: $(install_data_hook)
+
MOSTLYCLEANFILES := @MOSTLYCLEANFILES@ llog-test.c
MOSTLYCLEANFILES += linux/*.o darwin/*.o
DIST_SOURCES = $(filter-out llog-test.c,$(obdclass-all-objs:.o=.c)) $(llog-test-objs:.o=.c) llog_test.c llog_internal.h
CWARN("LPD64 wrong length! strlen(%s)=%d != 2\n", buf, len);
ret = -EINVAL;
}
- if ((u64val & ~PAGE_MASK) >= PAGE_SIZE) {
- CWARN("mask failed: u64val "LPU64" >= %lu\n", u64val,PAGE_SIZE);
+ if ((u64val & ~CFS_PAGE_MASK) >= CFS_PAGE_SIZE) {
+ CWARN("mask failed: u64val "LPU64" >= %lu\n", u64val,CFS_PAGE_SIZE);
ret = -EINVAL;
}
int err = 0;
ENTRY;
- if (suser(p->p_ucred, &p->p_acflag))
+ if (!is_suser())
RETURN (-EPERM);
if (obd_psdev_ops.p_ioctl != NULL)
err = obd_psdev_ops.p_ioctl(NULL, cmd, (void *)arg);
int old_fail_loc = obd_fail_loc;
error = sysctl_handle_long(oidp, oidp->oid_arg1, oidp->oid_arg2, req);
- if (!error && req->newptr != NULL) {
+ if (!error && req->newptr != USER_ADDR_NULL) {
if (old_fail_loc != obd_fail_loc)
cfs_waitq_signal(&obd_race_waitq);
- } else if (req->newptr != NULL) {
+ } else if (req->newptr != USER_ADDR_NULL) {
/* Something was wrong with the write request */
printf ("sysctl fail loc fault: %d.\n", error);
} else {
<string>1.0.0</string>
<key>OSBundleLibraries</key>
<dict>
- <key>com.apple.kernel.bsd</key>
- <string>1.1</string>
- <key>com.apple.kernel.iokit</key>
- <string>1.0.0b1</string>
- <key>com.apple.kernel.mach</key>
- <string>1.0.0b1</string>
+ <key>com.apple.kpi.bsd</key>
+ <string>8.0.0b1</string>
+ <key>com.apple.kpi.libkern</key>
+ <string>8.0.0b1</string>
+ <key>com.apple.kpi.mach</key>
+ <string>8.0.0b1</string>
+ <key>com.apple.kpi.unsupported</key>
+ <string>8.0.0b1</string>
<key>com.clusterfs.lustre.libcfs</key>
- <string>1.0.0</string>
- <key>com.clusterfs.lustre.lnet</key>
- <string>1.0.0</string>
+ <string>1.0.0</string>
<key>com.clusterfs.lustre.lvfs</key>
<string>1.0.0</string>
<key>com.clusterfs.lustre.obdclass</key>
plist_DATA := Info.plist
-#install-data-hook: fix-kext-ownership
+install_data_hook := fix-kext-ownership
+
endif # darwin
endif # MODULES
+install-data-hook: $(install_data_hook)
+
MOSTLYCLEANFILES := @MOSTLYCLEANFILES@
DIST_SOURCES = $(obdecho-objs:%.o=%.c)
<string>1.0.0</string>
<key>OSBundleLibraries</key>
<dict>
- <key>com.apple.kernel.bsd</key>
- <string>1.1</string>
- <key>com.apple.kernel.iokit</key>
- <string>1.0.0b1</string>
- <key>com.apple.kernel.mach</key>
- <string>1.0.0b1</string>
+ <key>com.apple.kpi.bsd</key>
+ <string>8.0.0b1</string>
+ <key>com.apple.kpi.libkern</key>
+ <string>8.0.0b1</string>
+ <key>com.apple.kpi.mach</key>
+ <string>8.0.0b1</string>
+ <key>com.apple.kpi.unsupported</key>
+ <string>8.0.0b1</string>
<key>com.clusterfs.lustre.libcfs</key>
- <string>1.0.0</string>
- <key>com.clusterfs.lustre.lnet</key>
- <string>1.0.0</string>
+ <string>1.0.0</string>
<key>com.clusterfs.lustre.lvfs</key>
<string>1.0.0</string>
<key>com.clusterfs.lustre.obdclass</key>
plist_DATA := Info.plist
-#install-data-hook: fix-kext-ownership
+install_data_hook := fix-kext-ownership
+
endif # Darwin
endif
+install-data-hook: $(install_data_hook)
+
MOSTLYCLEANFILES := @MOSTLYCLEANFILES@
DIST_SOURCES = $(osc-objs:%.o=%.c) osc_internal.h
CDEBUG(D_HA,"%p: oscc recovery in progress, waiting\n",
oscc);
- lwi = LWI_TIMEOUT(MAX(obd_timeout*HZ/4, 1), NULL, NULL);
+ lwi = LWI_TIMEOUT(cfs_timeout_cap(cfs_time_seconds(obd_timeout/4)),
+ NULL, NULL);
rc = l_wait_event(oscc->oscc_waitq,
!oscc_recovering(oscc), &lwi);
LASSERT(rc == 0 || rc == -ETIMEDOUT);
void oscc_init(struct obd_device *obd);
void osc_wake_cache_waiters(struct client_obd *cli);
-
-/* Quota stuff */
-extern quota_interface_t *quota_interface;
-
#ifdef LPROCFS
int lproc_osc_attach_seqstat(struct obd_device *dev);
#else
#include <lustre_debug.h>
#include "osc_internal.h"
+static quota_interface_t *quota_interface = NULL;
+extern quota_interface_t osc_quota_interface;
+
/* Pack OSC object metadata for disk storage (LE byte order). */
static int osc_packmd(struct obd_export *exp, struct lov_mds_md **lmmp,
struct lov_stripe_md *lsm)
cli->cl_dirty, cli->cl_dirty_max);
oa->o_undirty = 0;
} else {
- long max_in_flight = (cli->cl_max_pages_per_rpc << PAGE_SHIFT)*
+ long max_in_flight = (cli->cl_max_pages_per_rpc << CFS_PAGE_SHIFT)*
(cli->cl_max_rpcs_in_flight + 1);
oa->o_undirty = max(cli->cl_dirty_max, max_in_flight);
}
static void osc_consume_write_grant(struct client_obd *cli,
struct osc_async_page *oap)
{
- cli->cl_dirty += PAGE_SIZE;
- cli->cl_avail_grant -= PAGE_SIZE;
+ cli->cl_dirty += CFS_PAGE_SIZE;
+ cli->cl_avail_grant -= CFS_PAGE_SIZE;
oap->oap_brw_flags |= OBD_BRW_FROM_GRANT;
- CDEBUG(D_CACHE, "using %lu grant credits for oap %p\n", PAGE_SIZE, oap);
+ CDEBUG(D_CACHE, "using %lu grant credits for oap %p\n", CFS_PAGE_SIZE, oap);
LASSERT(cli->cl_avail_grant >= 0);
}
ENTRY;
list_for_each_safe(l, tmp, &cli->cl_cache_waiters) {
/* if we can't dirty more, we must wait until some is written */
- if (cli->cl_dirty + PAGE_SIZE > cli->cl_dirty_max) {
+ if (cli->cl_dirty + CFS_PAGE_SIZE > cli->cl_dirty_max) {
CDEBUG(D_CACHE, "no dirty room: dirty: %ld max %ld\n",
cli->cl_dirty, cli->cl_dirty_max);
return;
/* if still dirty cache but no grant wait for pending RPCs that
* may yet return us some grant before doing sync writes */
- if (cli->cl_w_in_flight && cli->cl_avail_grant < PAGE_SIZE) {
+ if (cli->cl_w_in_flight && cli->cl_avail_grant < CFS_PAGE_SIZE) {
CDEBUG(D_CACHE, "%u BRW writes in flight, no grant\n",
cli->cl_w_in_flight);
return;
ocw = list_entry(l, struct osc_cache_waiter, ocw_entry);
list_del_init(&ocw->ocw_entry);
- if (cli->cl_avail_grant < PAGE_SIZE) {
+ if (cli->cl_avail_grant < CFS_PAGE_SIZE) {
/* no more RPCs in flight to return grant, do sync IO */
ocw->ocw_rc = -EDQUOT;
CDEBUG(D_INODE, "wake oap %p for sync\n", ocw->ocw_oap);
if (pga->count > nob_read) {
/* EOF inside this page */
- ptr = cfs_kmap(pga->pg) + (pga->off & ~PAGE_MASK);
+ ptr = cfs_kmap(pga->pg) + (pga->off & ~CFS_PAGE_MASK);
memset(ptr + nob_read, 0, pga->count - nob_read);
cfs_kunmap(pga->pg);
page_count--;
/* zero remaining pages */
while (page_count-- > 0) {
- ptr = cfs_kmap(pga->pg) + (pga->off & ~PAGE_MASK);
+ ptr = cfs_kmap(pga->pg) + (pga->off & ~CFS_PAGE_MASK);
memset(ptr, 0, pga->count);
cfs_kunmap(pga->pg);
pga++;
LASSERT (pg_count > 0);
while (nob > 0 && pg_count > 0) {
char *ptr = cfs_kmap(pga->pg);
- int off = pga->off & ~PAGE_MASK;
+ int off = pga->off & ~CFS_PAGE_MASK;
int count = pga->count > nob ? nob : pga->count;
cksum = crc32_le(cksum, ptr + off, count);
struct brw_page *pg_prev = pg - 1;
LASSERT(pg->count > 0);
- LASSERTF((pg->off & ~PAGE_MASK) + pg->count <= PAGE_SIZE,
+ LASSERTF((pg->off & ~CFS_PAGE_MASK) + pg->count <= CFS_PAGE_SIZE,
"i: %d pg: %p off: "LPU64", count: %u\n", i, pg,
pg->off, pg->count);
#ifdef __LINUX__
LASSERT((pga[0].flag & OBD_BRW_SRVLOCK) ==
(pg->flag & OBD_BRW_SRVLOCK));
- ptlrpc_prep_bulk_page(desc, pg->pg, pg->off & ~PAGE_MASK,
+ ptlrpc_prep_bulk_page(desc, pg->pg, pg->off & ~CFS_PAGE_MASK,
pg->count);
requested_nob += pg->count;
int offset;
LASSERT (pages > 0);
- offset = pg->off & (PAGE_SIZE - 1);
+ offset = pg->off & (CFS_PAGE_SIZE - 1);
for (;;) {
pages--;
if (pages == 0) /* that's all */
return count;
- if (offset + pg->count < PAGE_SIZE)
+ if (offset + pg->count < CFS_PAGE_SIZE)
return count; /* doesn't end on page boundary */
pg++;
- offset = pg->off & (PAGE_SIZE - 1);
+ offset = pg->off & (CFS_PAGE_SIZE - 1);
if (offset != 0) /* doesn't start on page boundary */
return count;
/* If there is a gap at the end of this page, it can't merge
* with any subsequent pages, so we'll hand the network a
* "fragmented" page array that it can't transfer in 1 RDMA */
- if (oap->oap_page_off + oap->oap_count < PAGE_SIZE)
+ if (oap->oap_page_off + oap->oap_count < CFS_PAGE_SIZE)
break;
}
lprocfs_oh_tally_log2(&cli->cl_read_page_hist, page_count);
lprocfs_oh_tally(&cli->cl_read_rpc_hist, cli->cl_r_in_flight);
lprocfs_oh_tally_log2(&cli->cl_read_offset_hist,
- starting_offset/PAGE_SIZE + 1);
+ starting_offset/CFS_PAGE_SIZE + 1);
} else {
lprocfs_oh_tally_log2(&cli->cl_write_page_hist, page_count);
lprocfs_oh_tally(&cli->cl_write_rpc_hist,
cli->cl_w_in_flight);
lprocfs_oh_tally_log2(&cli->cl_write_offset_hist,
- starting_offset/PAGE_SIZE + 1);
+ starting_offset/CFS_PAGE_SIZE + 1);
}
client_obd_list_lock(&cli->cl_loi_list_lock);
/* force the caller to try sync io. this can jump the list
* of queued writes and create a discontiguous rpc stream */
- if (cli->cl_dirty_max < PAGE_SIZE || cli->cl_ar.ar_force_sync ||
+ if (cli->cl_dirty_max < CFS_PAGE_SIZE || cli->cl_ar.ar_force_sync ||
loi->loi_ar.ar_force_sync)
RETURN(-EDQUOT);
/* Hopefully normal case - cache space and write credits available */
- if (cli->cl_dirty + PAGE_SIZE <= cli->cl_dirty_max &&
- cli->cl_avail_grant >= PAGE_SIZE) {
+ if (cli->cl_dirty + CFS_PAGE_SIZE <= cli->cl_dirty_max &&
+ cli->cl_avail_grant >= CFS_PAGE_SIZE) {
/* account for ourselves */
osc_consume_write_grant(cli, oap);
RETURN(0);
}
oap->oap_brw_flags &= ~OBD_BRW_FROM_GRANT;
- cli->cl_dirty -= PAGE_SIZE;
+ cli->cl_dirty -= CFS_PAGE_SIZE;
if (!sent) {
- cli->cl_lost_grant += PAGE_SIZE;
+ cli->cl_lost_grant += CFS_PAGE_SIZE;
CDEBUG(D_CACHE, "lost grant: %lu avail grant: %lu dirty: %lu\n",
cli->cl_lost_grant, cli->cl_avail_grant, cli->cl_dirty);
- } else if (PAGE_SIZE != blocksize && oap->oap_count != PAGE_SIZE) {
+ } else if (CFS_PAGE_SIZE != blocksize && oap->oap_count != CFS_PAGE_SIZE) {
/* For short writes we shouldn't count parts of pages that
* span a whole block on the OST side, or our accounting goes
* wrong. Should match the code in filter_grant_check. */
- int offset = (oap->oap_obj_off +oap->oap_page_off) & ~PAGE_MASK;
+ int offset = (oap->oap_obj_off +oap->oap_page_off) & ~CFS_PAGE_MASK;
int count = oap->oap_count + (offset & (blocksize - 1));
int end = (offset + oap->oap_count) & (blocksize - 1);
if (end)
count += blocksize - end;
- cli->cl_lost_grant += PAGE_SIZE - count;
+ cli->cl_lost_grant += CFS_PAGE_SIZE - count;
CDEBUG(D_CACHE, "lost %lu grant: %lu avail: %lu dirty: %lu\n",
- PAGE_SIZE - count, cli->cl_lost_grant,
+ CFS_PAGE_SIZE - count, cli->cl_lost_grant,
cli->cl_avail_grant, cli->cl_dirty);
}
}
int osc_prep_async_page(struct obd_export *exp, struct lov_stripe_md *lsm,
- struct lov_oinfo *loi, struct page *page,
+ struct lov_oinfo *loi, cfs_page_t *page,
obd_off offset, struct obd_async_page_ops *ops,
void *data, void **res)
{
CDEBUG(D_PAGE, "hole at ino %lu; index %ld\n",
page->mapping->host->i_ino,
page->index);
- memset(page_address(page), 0, PAGE_SIZE);
+ memset(page_address(page), 0, CFS_PAGE_SIZE);
continue;
}
if (!page->buffers) {
- create_empty_buffers(page, dev, PAGE_SIZE);
+ create_empty_buffers(page, dev, CFS_PAGE_SIZE);
bh = page->buffers;
clear_bit(BH_New, &bh->b_state);
dev = exp->exp_obd->u.cli.cl_sandev;
if (!page->buffers) {
- create_empty_buffers(page, dev, PAGE_SIZE);
+ create_empty_buffers(page, dev, CFS_PAGE_SIZE);
} else {
/* checking */
LASSERT(!test_bit(BH_New, &page->buffers->b_state));
/* Filesystem lock extents are extended to page boundaries so that
* dealing with the page cache is a little smoother. */
- policy->l_extent.start -= policy->l_extent.start & ~PAGE_MASK;
- policy->l_extent.end |= ~PAGE_MASK;
+ policy->l_extent.start -= policy->l_extent.start & ~CFS_PAGE_MASK;
+ policy->l_extent.end |= ~CFS_PAGE_MASK;
if (lsm->lsm_oinfo->loi_kms_valid == 0)
goto no_match;
/* Filesystem lock extents are extended to page boundaries so that
* dealing with the page cache is a little smoother */
- policy->l_extent.start -= policy->l_extent.start & ~PAGE_MASK;
- policy->l_extent.end |= ~PAGE_MASK;
+ policy->l_extent.start -= policy->l_extent.start & ~CFS_PAGE_MASK;
+ policy->l_extent.end |= ~CFS_PAGE_MASK;
/* Next, search for already existing extent locks that will cover us */
rc = ldlm_lock_match(obd->obd_namespace, *flags, &res_id, type,
};
#endif
-static quota_interface_t *quota_interface = NULL;
-extern quota_interface_t osc_quota_interface;
-
int __init osc_init(void)
{
struct lprocfs_static_vars lvars;
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
- <string>lvfs</string>
+ <string>ptlrpc</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
- <string>com.clusterfs.lustre.lvfs</string>
+ <string>com.clusterfs.lustre.ptlrpc</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>1.0.0</string>
<key>OSBundleLibraries</key>
<dict>
- <key>com.apple.kernel.bsd</key>
- <string>1.1</string>
- <key>com.apple.kernel.iokit</key>
- <string>1.0.0b1</string>
- <key>com.apple.kernel.mach</key>
- <string>1.0.0b1</string>
<key>com.clusterfs.lustre.libcfs</key>
<string>1.0.0</string>
<key>com.clusterfs.lustre.lnet</key>
<string>1.0.0</string>
+ <key>com.clusterfs.lustre.obdclass</key>
+ <string>1.0.0</string>
</dict>
</dict>
</plist>
plist_DATA := Info.plist
-#install-data-hook: fix-kext-ownership
+install_data_hook := fix-kext-ownership
+
endif # DARWIN
endif # MODULES
+install-data-hook: $(install_data_hook)
+
MOSTLYCLEANFILES := @MOSTLYCLEANFILES@ ldlm_*.c l_lock.c
DIST_SOURCES = $(ptlrpc_objs:.o=.c) ptlrpc_internal.h
rc = ptl_send_rpc(req);
if (rc) {
DEBUG_REQ(D_HA, req, "send failed (%d); recovering", rc);
- timeout = cfs_time_minimal_timeout();
+ timeout = CFS_TICK;
} else {
timeout = cfs_timeout_cap(cfs_time_seconds(req->rq_timeout));
DEBUG_REQ(D_NET, req,
for (;;) {
/* Network access will complete in finite time but the HUGE
* timeout lets us CWARN for visibility of sluggish NALs */
- lwi = LWI_TIMEOUT (300 * HZ, NULL, NULL);
+ lwi = LWI_TIMEOUT (cfs_time_seconds(300), NULL, NULL);
rc = l_wait_event(*wq, !ptlrpc_bulk_active(desc), &lwi);
if (rc == 0)
return;
spin_unlock_irqrestore(&svc->srv_lock, flags);
/* If we cannot get anything for some long time, we better
bail out instead of waiting infinitely */
- lwi = LWI_TIMEOUT(10 * HZ, NULL, NULL);
+ lwi = LWI_TIMEOUT(cfs_time_seconds(10), NULL, NULL);
rc = l_wait_event(svc->srv_free_rs_waitq,
!list_empty(&svc->srv_free_rs_list), &lwi);
if (rc)
/* if the next ping is within, say, 5 jiffies from
now, go ahead and ping. See note below. */
cfs_time_aftereq(this_ping,
- imp->imp_next_ping - 5 * CFS_MIN_DELAY)) {
+ imp->imp_next_ping - 5 * CFS_TICK)) {
if (level == LUSTRE_IMP_DISCON &&
!imp->imp_deactive) {
/* wait at least a timeout before
unsigned long flags;
if (cfs_time_aftereq(pd->pd_this_ping,
- imp->imp_next_ping - 5 * CFS_MIN_DELAY)) {
+ imp->imp_next_ping - 5 * CFS_TICK)) {
/* Add a ping. */
spin_lock_irqsave(&imp->imp_lock, flags);
generation = imp->imp_generation;
wirecheck_CPPFLAGS = -DCC="\"$(CC)\""
wiretest_SOURCES = wiretest.c
-lctl_SOURCES = parser.c obd.c lustre_cfg.c lctl.c parser.h obdctl.h
+lctl_SOURCES = parser.c obd.c lustre_cfg.c lctl.c parser.h obdctl.h platform.h
lload_SOURCES = lload.c
obdio_SOURCES = obdio.c obdiolib.c obdiolib.h
obdbarrier_SOURCES = obdbarrier.c obdiolib.c obdiolib.h
#include <sys/param.h>
#include <assert.h>
-#ifdef HAVE_LIBREADLINE
-#define READLINE_LIBRARY
-#include <readline/readline.h>
-
-/* completion_matches() is #if 0-ed out in modern glibc */
-#ifndef completion_matches
-# define completion_matches rl_completion_matches
-#endif
-extern void using_history(void);
-extern void stifle_history(int);
-extern void add_history(char *);
-#endif
-
+#include "platform.h"
#include "parser.h"
static command_t * top_level; /* Top level of commands, initialized by
--- /dev/null
+#ifndef __LUSTRE_UTILS_PLATFORM_H
+#define __LUSTRE_UTILS_PLATFORM_H
+
+#ifdef HAVE_LIBREADLINE
+# define READLINE_LIBRARY
+# include <readline/readline.h>
+
+/* completion_matches() is #if 0-ed out in modern glibc */
+# ifdef __linux__
+# ifndef completion_matches
+# define completion_matches rl_completion_matches
+# endif
+ extern void using_history(void);
+ extern void stifle_history(int);
+ extern void add_history(char *);
+# elif __APPLE__
+ typedef VFunction rl_vintfunc_t;
+ typedef VFunction rl_voidfunc_t;
+# else
+# endif /* __linux__ */
+
+#endif /* HAVE_LIBREADLINE */
+
+#endif