Commit a393fd54 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

staging: lustre: libcfs: include: minor whitespace fixes

Found by the checkpatch.pl tool
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 681fc807
......@@ -73,7 +73,7 @@ typedef __u32 cfs_cap_t;
(1 << CFS_CAP_DAC_OVERRIDE) | \
(1 << CFS_CAP_DAC_READ_SEARCH) | \
(1 << CFS_CAP_FOWNER) | \
(1 << CFS_CAP_FSETID ) | \
(1 << CFS_CAP_FSETID) | \
(1 << CFS_CAP_LINUX_IMMUTABLE) | \
(1 << CFS_CAP_SYS_ADMIN) | \
(1 << CFS_CAP_SYS_BOOT) | \
......
......@@ -47,15 +47,15 @@
#include "curproc.h"
#ifndef offsetof
# define offsetof(typ,memb) ((long)(long_ptr_t)((char *)&(((typ *)0)->memb)))
# define offsetof(typ, memb) ((long)(long_ptr_t)((char *)&(((typ *)0)->memb)))
#endif
#ifndef ARRAY_SIZE
#define ARRAY_SIZE(a) ((sizeof (a)) / (sizeof ((a)[0])))
#define ARRAY_SIZE(a) ((sizeof(a)) / (sizeof((a)[0])))
#endif
#if !defined(swap)
#define swap(x,y) do { typeof(x) z = x; x = y; y = z; } while (0)
#define swap(x, y) do { typeof(x) z = x; x = y; y = z; } while (0)
#endif
#if !defined(container_of)
......
......@@ -254,19 +254,19 @@ do { \
goto label; \
} while (0)
extern int libcfs_debug_msg(struct libcfs_debug_msg_data *msgdata,
int libcfs_debug_msg(struct libcfs_debug_msg_data *msgdata,
const char *format1, ...)
__attribute__ ((format (printf, 2, 3)));
extern int libcfs_debug_vmsg2(struct libcfs_debug_msg_data *msgdata,
int libcfs_debug_vmsg2(struct libcfs_debug_msg_data *msgdata,
const char *format1,
va_list args, const char *format2, ...)
__attribute__ ((format (printf, 4, 5)));
/* other external symbols that tracefile provides: */
extern int cfs_trace_copyin_string(char *knl_buffer, int knl_buffer_nob,
int cfs_trace_copyin_string(char *knl_buffer, int knl_buffer_nob,
const char *usr_buffer, int usr_buffer_nob);
extern int cfs_trace_copyout_string(char *usr_buffer, int usr_buffer_nob,
int cfs_trace_copyout_string(char *usr_buffer, int usr_buffer_nob,
const char *knl_buffer, char *append);
#define LIBCFS_DEBUG_FILE_PATH_DEFAULT "/tmp/lustre-log"
......
......@@ -153,6 +153,7 @@ static inline void cfs_race(__u32 id)
if (CFS_FAIL_PRECHECK(id)) {
if (unlikely(__cfs_fail_check_set(id, 0, CFS_FAIL_LOC_NOSET))) {
int rc;
cfs_race_state = 0;
CERROR("cfs_race id %x sleeping\n", id);
cfs_wait_event_interruptible(cfs_race_waitq,
......@@ -165,6 +166,7 @@ static inline void cfs_race(__u32 id)
}
}
}
#define CFS_RACE(id) cfs_race(id)
#endif /* _LIBCFS_FAIL_H */
......@@ -41,7 +41,6 @@
#ifndef __LIBCFS_IOCTL_H__
#define __LIBCFS_IOCTL_H__
#define LIBCFS_IOCTL_VERSION 0x0001000a
struct libcfs_ioctl_data {
......@@ -90,7 +89,6 @@ do { \
data.ioc_len = sizeof(data); \
} while (0)
struct libcfs_ioctl_handler {
struct list_head item;
int (*handle_ioctl)(unsigned int cmd, struct libcfs_ioctl_data *data);
......@@ -102,11 +100,9 @@ struct libcfs_ioctl_handler {
/* .handle_ioctl = */ func \
}
/* FIXME check conflict with lustre_lib.h */
#define LIBCFS_IOC_DEBUG_MASK _IOWR('f', 250, long)
/* ioctls for manipulating snapshots 30- */
#define IOC_LIBCFS_TYPE 'e'
#define IOC_LIBCFS_MIN_NR 30
......@@ -149,6 +145,7 @@ struct libcfs_ioctl_handler {
static inline int libcfs_ioctl_packlen(struct libcfs_ioctl_data *data)
{
int len = sizeof(*data);
len += cfs_size_round(data->ioc_inllen1);
len += cfs_size_round(data->ioc_inllen2);
return len;
......@@ -157,64 +154,62 @@ static inline int libcfs_ioctl_packlen(struct libcfs_ioctl_data *data)
static inline int libcfs_ioctl_is_invalid(struct libcfs_ioctl_data *data)
{
if (data->ioc_len > (1<<30)) {
CERROR ("LIBCFS ioctl: ioc_len larger than 1<<30\n");
CERROR("LIBCFS ioctl: ioc_len larger than 1<<30\n");
return 1;
}
if (data->ioc_inllen1 > (1<<30)) {
CERROR ("LIBCFS ioctl: ioc_inllen1 larger than 1<<30\n");
CERROR("LIBCFS ioctl: ioc_inllen1 larger than 1<<30\n");
return 1;
}
if (data->ioc_inllen2 > (1<<30)) {
CERROR ("LIBCFS ioctl: ioc_inllen2 larger than 1<<30\n");
CERROR("LIBCFS ioctl: ioc_inllen2 larger than 1<<30\n");
return 1;
}
if (data->ioc_inlbuf1 && !data->ioc_inllen1) {
CERROR ("LIBCFS ioctl: inlbuf1 pointer but 0 length\n");
CERROR("LIBCFS ioctl: inlbuf1 pointer but 0 length\n");
return 1;
}
if (data->ioc_inlbuf2 && !data->ioc_inllen2) {
CERROR ("LIBCFS ioctl: inlbuf2 pointer but 0 length\n");
CERROR("LIBCFS ioctl: inlbuf2 pointer but 0 length\n");
return 1;
}
if (data->ioc_pbuf1 && !data->ioc_plen1) {
CERROR ("LIBCFS ioctl: pbuf1 pointer but 0 length\n");
CERROR("LIBCFS ioctl: pbuf1 pointer but 0 length\n");
return 1;
}
if (data->ioc_pbuf2 && !data->ioc_plen2) {
CERROR ("LIBCFS ioctl: pbuf2 pointer but 0 length\n");
CERROR("LIBCFS ioctl: pbuf2 pointer but 0 length\n");
return 1;
}
if (data->ioc_plen1 && !data->ioc_pbuf1) {
CERROR ("LIBCFS ioctl: plen1 nonzero but no pbuf1 pointer\n");
CERROR("LIBCFS ioctl: plen1 nonzero but no pbuf1 pointer\n");
return 1;
}
if (data->ioc_plen2 && !data->ioc_pbuf2) {
CERROR ("LIBCFS ioctl: plen2 nonzero but no pbuf2 pointer\n");
CERROR("LIBCFS ioctl: plen2 nonzero but no pbuf2 pointer\n");
return 1;
}
if ((__u32)libcfs_ioctl_packlen(data) != data->ioc_len ) {
CERROR ("LIBCFS ioctl: packlen != ioc_len\n");
if ((__u32)libcfs_ioctl_packlen(data) != data->ioc_len) {
CERROR("LIBCFS ioctl: packlen != ioc_len\n");
return 1;
}
if (data->ioc_inllen1 &&
data->ioc_bulk[data->ioc_inllen1 - 1] != '\0') {
CERROR ("LIBCFS ioctl: inlbuf1 not 0 terminated\n");
CERROR("LIBCFS ioctl: inlbuf1 not 0 terminated\n");
return 1;
}
if (data->ioc_inllen2 &&
data->ioc_bulk[cfs_size_round(data->ioc_inllen1) +
data->ioc_inllen2 - 1] != '\0') {
CERROR ("LIBCFS ioctl: inlbuf2 not 0 terminated\n");
CERROR("LIBCFS ioctl: inlbuf2 not 0 terminated\n");
return 1;
}
return 0;
}
int libcfs_register_ioctl(struct libcfs_ioctl_handler *hand);
int libcfs_deregister_ioctl(struct libcfs_ioctl_handler *hand);
int libcfs_ioctl_getdata(char *buf, char *end, void *arg);
int libcfs_ioctl_popdata(void *arg, void *buf, int size);
#endif /* __LIBCFS_IOCTL_H__ */
......@@ -47,7 +47,6 @@
#error Do not #include this file directly. #include <linux/libcfs/libcfs.h> instead
#endif
/* KUC message header.
* All current and future KUC messages should use this header.
* To avoid having to include Lustre headers from libcfs, define this here.
......@@ -90,12 +89,12 @@ typedef int (*libcfs_kkuc_cb_t)(__u32 data, void *cb_arg);
#define KUC_GRP_MAX KUC_GRP_HSM
/* Kernel methods */
extern int libcfs_kkuc_msg_put(struct file *fp, void *payload);
extern int libcfs_kkuc_group_put(int group, void *payload);
extern int libcfs_kkuc_group_add(struct file *fp, int uid, int group,
int libcfs_kkuc_msg_put(struct file *fp, void *payload);
int libcfs_kkuc_group_put(int group, void *payload);
int libcfs_kkuc_group_add(struct file *fp, int uid, int group,
__u32 data);
extern int libcfs_kkuc_group_rem(int uid, int group);
extern int libcfs_kkuc_group_foreach(int group, libcfs_kkuc_cb_t cb_func,
int libcfs_kkuc_group_rem(int uid, int group);
int libcfs_kkuc_group_foreach(int group, libcfs_kkuc_cb_t cb_func,
void *cb_arg);
#define LK_FLG_STOP 0x01
......@@ -111,9 +110,9 @@ typedef struct lustre_kernelcomm {
} __attribute__((packed)) lustre_kernelcomm;
/* Userspace methods */
extern int libcfs_ukuc_start(lustre_kernelcomm *l, int groups);
extern int libcfs_ukuc_stop(lustre_kernelcomm *l);
extern int libcfs_ukuc_msg_get(lustre_kernelcomm *l, char *buf, int maxsize,
int libcfs_ukuc_start(lustre_kernelcomm *l, int groups);
int libcfs_ukuc_stop(lustre_kernelcomm *l);
int libcfs_ukuc_msg_get(lustre_kernelcomm *l, char *buf, int maxsize,
int transport);
#endif /* __LIBCFS_KERNELCOMM_H__ */
......@@ -50,7 +50,6 @@
#endif
/*
* When this is on, LASSERT macro includes check for assignment used instead
* of equality check, but doesn't have unlikely(). Turn this on from time to
......@@ -58,7 +57,6 @@
*/
#define LASSERT_CHECKED (0)
#define LASSERTF(cond, fmt, ...) \
do { \
if (unlikely(!(cond))) { \
......@@ -80,18 +78,18 @@ do { \
*/
# define LINVRNT(exp) LASSERT(exp)
#else
# define LINVRNT(exp) ((void)sizeof!!(exp))
# define LINVRNT(exp) ((void)sizeof !!(exp))
#endif
#define KLASSERT(e) LASSERT(e)
void lbug_with_loc(struct libcfs_debug_msg_data *) __attribute__((noreturn));
void lbug_with_loc(struct libcfs_debug_msg_data *)__attribute__((noreturn));
#define LBUG() \
do { \
LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, D_EMERG, NULL); \
lbug_with_loc(&msgdata); \
} while(0)
} while (0)
extern atomic_t libcfs_kmemory;
/*
......@@ -111,7 +109,6 @@ do { \
# define libcfs_kmem_read() \
atomic_read(&libcfs_kmemory)
#ifndef LIBCFS_VMALLOC_SIZE
#define LIBCFS_VMALLOC_SIZE (2 << PAGE_CACHE_SHIFT) /* 2 pages */
#endif
......@@ -220,7 +217,6 @@ int libcfs_debug_mark_buffer(const char *text);
void libcfs_debug_set_level(unsigned int debug_level);
/*
* allocate per-cpu-partition data, returned value is an array of pointers,
* variable can be indexed by CPU ID.
......@@ -339,8 +335,8 @@ do { \
#define LASSERT_ATOMIC_ZERO(a) LASSERT_ATOMIC_EQ(a, 0)
#define LASSERT_ATOMIC_POS(a) LASSERT_ATOMIC_GT(a, 0)
#define CFS_ALLOC_PTR(ptr) LIBCFS_ALLOC(ptr, sizeof (*(ptr)));
#define CFS_FREE_PTR(ptr) LIBCFS_FREE(ptr, sizeof (*(ptr)));
#define CFS_ALLOC_PTR(ptr) LIBCFS_ALLOC(ptr, sizeof(*(ptr)));
#define CFS_FREE_PTR(ptr) LIBCFS_FREE(ptr, sizeof(*(ptr)));
/*
* percpu partition lock
......@@ -363,7 +359,6 @@ enum {
CFS_PERCPT_LOCK_EX = -1, /* negative */
};
struct cfs_percpt_lock {
/* cpu-partition-table for this lock */
struct cfs_cpt_table *pcl_cptab;
......@@ -380,7 +375,6 @@ cfs_percpt_lock_num(struct cfs_percpt_lock *pcl)
return cfs_cpt_number(pcl->pcl_cptab);
}
/*
* create a cpu-partition lock based on CPU partition table \a cptab,
* each private lock has extra \a psize bytes padding data
......@@ -400,7 +394,6 @@ void cfs_percpt_atomic_free(atomic_t **refs);
/* return sum of all percpu refs */
int cfs_percpt_atomic_summary(atomic_t **refs);
/** Compile-time assertion.
* Check an invariant described by a constant expression at compile time by
......@@ -415,7 +408,7 @@ int cfs_percpt_atomic_summary(atomic_t **refs);
* value after conversion...
*
*/
#define CLASSERT(cond) do {switch(42) {case (cond): case 0: break;}} while (0)
#define CLASSERT(cond) do {switch (42) {case (cond): case 0: break; } } while (0)
/* support decl needed both by kernel and liblustre */
int libcfs_isknown_lnd(int type);
......@@ -440,11 +433,11 @@ int cfs_match_nid(lnet_nid_t nid, struct list_head *list);
/** extract the network part of an lnet_nid_t */
#define LNET_NIDNET(nid) ((__u32)(((nid) >> 32)) & 0xffffffff)
/** make an lnet_nid_t from a network part and an address part */
#define LNET_MKNID(net,addr) ((((__u64)(net))<<32)|((__u64)(addr)))
#define LNET_MKNID(net, addr) ((((__u64)(net))<<32)|((__u64)(addr)))
/* how net encodes type:number */
#define LNET_NETNUM(net) ((net) & 0xffff)
#define LNET_NETTYP(net) (((net) >> 16) & 0xffff)
#define LNET_MKNET(typ,num) ((((__u32)(typ))<<16)|((__u32)(num)))
#define LNET_MKNET(typ, num) ((((__u32)(typ))<<16)|((__u32)(num)))
/** @} lnet_addr */
/* max value for numeric network address */
......@@ -469,24 +462,25 @@ struct libcfs_device_userstate
/* what used to be in portals_lib.h */
#ifndef MIN
# define MIN(a,b) (((a)<(b)) ? (a): (b))
# define MIN(a, b) (((a) < (b)) ? (a) : (b))
#endif
#ifndef MAX
# define MAX(a,b) (((a)>(b)) ? (a): (b))
# define MAX(a, b) (((a) > (b)) ? (a) : (b))
#endif
#define MKSTR(ptr) ((ptr))? (ptr) : ""
#define MKSTR(ptr) ((ptr)) ? (ptr) : ""
static inline int cfs_size_round4 (int val)
static inline int cfs_size_round4(int val)
{
return (val + 3) & (~0x3);
}
#ifndef HAVE_CFS_SIZE_ROUND
static inline int cfs_size_round (int val)
static inline int cfs_size_round(int val)
{
return (val + 7) & (~0x7);
}
#define HAVE_CFS_SIZE_ROUND
#endif
......@@ -525,21 +519,21 @@ static inline unsigned int cfs_power2_roundup(unsigned int val)
return val;
}
#define LOGL(var,len,ptr) \
#define LOGL(var, len, ptr) \
do { \
if (var) \
memcpy((char *)ptr, (const char *)var, len); \
ptr += cfs_size_round(len); \
} while (0)
#define LOGU(var,len,ptr) \
#define LOGU(var, len, ptr) \
do { \
if (var) \
memcpy((char *)var, (const char *)ptr, len); \
ptr += cfs_size_round(len); \
} while (0)
#define LOGL0(var,len,ptr) \
#define LOGL0(var, len, ptr) \
do { \
if (!len) \
break; \
......
......@@ -63,7 +63,6 @@ static inline int cfs_time_aftereq(cfs_time_t t1, cfs_time_t t2)
return cfs_time_beforeq(t2, t1);
}
static inline cfs_time_t cfs_time_shift(int seconds)
{
return cfs_time_add(cfs_time_current(), cfs_time_seconds(seconds));
......@@ -72,7 +71,7 @@ static inline cfs_time_t cfs_time_shift(int seconds)
static inline long cfs_timeval_sub(struct timeval *large, struct timeval *small,
struct timeval *result)
{
long r = (long) (
long r = (long)(
(large->tv_sec - small->tv_sec) * ONE_MILLION +
(large->tv_usec - small->tv_usec));
if (result != NULL) {
......@@ -87,7 +86,7 @@ static inline void cfs_slow_warning(cfs_time_t now, int seconds, char *msg)
if (cfs_time_after(cfs_time_current(),
cfs_time_add(now, cfs_time_seconds(15))))
CERROR("slow %s "CFS_TIME_T" sec\n", msg,
cfs_duration_sec(cfs_time_sub(cfs_time_current(),now)));
cfs_duration_sec(cfs_time_sub(cfs_time_current(), now)));
}
#define CFS_RATELIMIT(seconds) \
......
......@@ -37,7 +37,6 @@
#ifndef __LIBCFS_LINUX_KP30_H__
#define __LIBCFS_LINUX_KP30_H__
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/string.h>
......
......@@ -42,7 +42,6 @@
#endif
#include <stdarg.h>
#include "linux-cpu.h"
#include "linux-time.h"
......@@ -89,7 +88,7 @@ do { \
} while (0)
#define CFS_CHECK_STACK(msgdata, mask, cdls) __CHECK_STACK(msgdata, mask, cdls)
#else /* __x86_64__ */
#define CFS_CHECK_STACK(msgdata, mask, cdls) do {} while(0)
#define CFS_CHECK_STACK(msgdata, mask, cdls) do {} while (0)
#define CDEBUG_STACK() (0L)
#endif /* __x86_64__ */
......@@ -103,7 +102,7 @@ do { \
*
* Implementation is in linux-curproc.c
*/
#define CFS_CURPROC_COMM_MAX (sizeof ((struct task_struct *)0)->comm)
#define CFS_CURPROC_COMM_MAX (sizeof((struct task_struct *)0)->comm)
#include <linux/capability.h>
......@@ -116,6 +115,4 @@ typedef long long_ptr_t;
#endif
#endif /* _LINUX_LIBCFS_H */
......@@ -42,7 +42,6 @@
#error Do not #include this file directly. #include <linux/libcfs/libcfs.h> instead
#endif
#include <linux/cpu.h>
#include <linux/cpuset.h>
#include <linux/topology.h>
......
......@@ -45,7 +45,6 @@
#error Do not #include this file directly. #include <linux/libcfs/libcfs.h> instead
#endif
#include <linux/mutex.h>
/*
......@@ -81,8 +80,6 @@
*/
/*
* rw_semaphore "implementation" (use Linux kernel's primitives)
*
......@@ -94,10 +91,8 @@
* - up_write(x)
*/
#define fini_rwsem(s) do {} while (0)
/*
* rwlock_t "implementation" (use Linux kernel's primitives)
*
......@@ -112,7 +107,6 @@
* - RW_LOCK_UNLOCKED
*/
#ifndef DEFINE_RWLOCK
#define DEFINE_RWLOCK(lock) rwlock_t lock = __RW_LOCK_UNLOCKED(lock)
#endif
......@@ -170,7 +164,6 @@ struct lock_class_key {
/* This has to be a macro, so that `subclass' can be undefined in kernels
* that do not support lockdep. */
static inline void lockdep_off(void)
{
}
......@@ -200,5 +193,4 @@ static inline void lockdep_on(void)
#endif
#endif /* CONFIG_DEBUG_LOCK_ALLOC */
#endif /* __LIBCFS_LINUX_CFS_LOCK_H__ */
......@@ -45,7 +45,6 @@
#error Do not #include this file directly. #include <linux/libcfs/libcfs.h> instead
#endif
#include <linux/mm.h>
#include <linux/vmalloc.h>
#include <linux/pagemap.h>
......@@ -81,7 +80,7 @@
#define DECL_MMSPACE mm_segment_t __oldfs
#define MMSPACE_OPEN \
do { __oldfs = get_fs(); set_fs(get_ds());} while(0)
do { __oldfs = get_fs(); set_fs(get_ds()); } while (0)
#define MMSPACE_CLOSE set_fs(__oldfs)
#endif /* __LINUX_CFS_MEM_H__ */
......@@ -45,7 +45,6 @@
#error Do not #include this file directly. #include <linux/libcfs/libcfs.h> instead
#endif
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/proc_fs.h>
......
......@@ -45,7 +45,6 @@
#error Do not #include this file directly. #include <linux/libcfs/libcfs.h> instead
#endif
#include <net/sock.h>
typedef struct socket socket_t;
......
......@@ -45,7 +45,6 @@
#error Do not #include this file directly. #include <linux/libcfs/libcfs.h> instead
#endif
/* Portable time API */
/*
......@@ -88,7 +87,6 @@
#define ONE_BILLION ((u_int64_t)1000000000)
#define ONE_MILLION 1000000
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/time.h>
......@@ -123,7 +121,6 @@ static inline unsigned long long __cfs_fs_time_flat(cfs_fs_time_t *t)
return (unsigned long long)t->tv_sec * ONE_BILLION + t->tv_nsec;
}
/*
* Generic kernel stuff
*/
......@@ -179,6 +176,7 @@ static inline cfs_duration_t cfs_duration_build(int64_t nano)
/* We cannot use do_div(t, ONE_BILLION), do_div can only process
* 64 bits n and 32 bits base */
int64_t t = nano * HZ;
do_div(t, 1000);
do_div(t, 1000000);
return (cfs_duration_t)t;
......@@ -252,7 +250,6 @@ static inline int cfs_time_beforeq_64(__u64 t1, __u64 t2)
return (__s64)t2 - (__s64)t1 >= 0;
}
/*
* One jiffy
*/
......@@ -261,7 +258,6 @@ static inline int cfs_time_beforeq_64(__u64 t1, __u64 t2)
#define CFS_TIME_T "%lu"
#define CFS_DURATION_T "%ld"
#endif /* __LIBCFS_LINUX_LINUX_TIME_H__ */
/*
* Local variables:
......
......@@ -37,14 +37,14 @@
#ifndef __LIBCFS_LINUX_PORTALS_COMPAT_H__
#define __LIBCFS_LINUX_PORTALS_COMPAT_H__
// XXX BUG 1511 -- remove this stanza and all callers when bug 1511 is resolved
/* XXX BUG 1511 -- remove this stanza and all callers when bug 1511 is resolved */
#if defined(SPINLOCK_DEBUG) && SPINLOCK_DEBUG
# define SIGNAL_MASK_ASSERT() \
LASSERT(current->sighand->siglock.magic == SPINLOCK_MAGIC)
#else
# define SIGNAL_MASK_ASSERT()
#endif
// XXX BUG 1511 -- remove this stanza and all callers when bug 1511 is resolved
/* XXX BUG 1511 -- remove this stanza and all callers when bug 1511 is resolved */
#define SIGNAL_MASK_LOCK(task, flags) \
spin_lock_irqsave(&task->sighand->siglock, flags)
......
......@@ -108,21 +108,21 @@ typedef struct cfs_seq_file {
} cfs_seq_file_t;
typedef struct cfs_seq_operations {
void *(*start) (cfs_seq_file_t *m, loff_t *pos);
void (*stop) (cfs_seq_file_t *m, void *v);
void *(*next) (cfs_seq_file_t *m, void *v, loff_t *pos);
int (*show) (cfs_seq_file_t *m, void *v);
void *(*start)(cfs_seq_file_t *m, loff_t *pos);
void (*stop)(cfs_seq_file_t *m, void *v);
void *(*next)(cfs_seq_file_t *m, void *v, loff_t *pos);
int (*show)(cfs_seq_file_t *m, void *v);
} cfs_seq_ops_t;
typedef void *cfs_poll_table_t;
typedef struct cfs_param_file_ops {
struct module *owner;
int (*open) (cfs_inode_t *, struct file *);
int (*open)(cfs_inode_t *, struct file *);
loff_t (*llseek)(struct file *, loff_t, int);
int (*release) (cfs_inode_t *, cfs_param_file_t *);
unsigned int (*poll) (struct file *, cfs_poll_table_t *);
ssize_t (*write) (struct file *, const char *, size_t, loff_t *);
int (*release)(cfs_inode_t *, cfs_param_file_t *);
unsigned int (*poll)(struct file *, cfs_poll_table_t *);
ssize_t (*write)(struct file *, const char *, size_t, loff_t *);
ssize_t (*read)(struct file *, char *, size_t, loff_t *);
} cfs_param_file_ops_t;
typedef cfs_param_file_ops_t *cfs_lproc_filep_t;
......@@ -140,7 +140,7 @@ static inline cfs_proc_inode_t *FAKE_PROC_I(const cfs_inode_t *inode)
#define cfs_seq_read_common NULL
#define cfs_seq_lseek_common NULL
#define cfs_seq_private(seq) (seq->private)
#define cfs_seq_read(file, buf, count, ppos, rc) do {} while(0)
#define cfs_seq_read(file, buf, count, ppos, rc) do {} while (0)
#define cfs_seq_open(file, ops, rc) \
do { \
cfs_seq_file_t *p = cfs_file_private(file); \
......@@ -155,7 +155,7 @@ do { \
memset(p, 0, sizeof(*p)); \
p->op = ops; \
rc = 0; \
} while(0)
} while (0)
#endif /* LPROCFS */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment