Skip to content

Commit

Permalink
staging/lustre: remove portals_compat25.h
Browse files Browse the repository at this point in the history
Remove include/linux/libcfs/linux/portals_compat25.h.

. remove some unused/unnecessary macros such as smp_num_cpus /
  SIGNAL_MASK_ASSERT etc.

. replace some macros with direct kernel API calls such as
  RECALC_SIGPENDING/CLEAR_SIGPENDING/CURRENT_SECONDS,
  cfs_wait_event_interruptible/_exclusive etc.

Signed-off-by: Liu Xuezhao <[email protected]>
Signed-off-by: Peng Tao <[email protected]>
Signed-off-by: James Simmons <[email protected]>
Signed-off-by: John L. Hammond <[email protected]>
Reviewed-on: http://review.whamcloud.com/4778
Reviewed-by: Andreas Dilger <[email protected]>
Reviewed-by: Keith Mannthey <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
jasimmons1973 authored and gregkh committed Sep 11, 2014
1 parent 16e0631 commit 46ffc93
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 110 deletions.
4 changes: 2 additions & 2 deletions drivers/staging/lustre/include/linux/libcfs/libcfs_fail.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ static inline void cfs_race(__u32 id)

cfs_race_state = 0;
CERROR("cfs_race id %x sleeping\n", id);
cfs_wait_event_interruptible(cfs_race_waitq,
cfs_race_state != 0, rc);
rc = wait_event_interruptible(cfs_race_waitq,
cfs_race_state != 0);
CERROR("cfs_fail_race id %x awake, rc=%d\n", id, rc);
} else {
CERROR("cfs_fail_race id %x waking\n", id);
Expand Down
1 change: 0 additions & 1 deletion drivers/staging/lustre/include/linux/libcfs/linux/libcfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@
#include "linux-cpu.h"
#include "linux-time.h"
#include "linux-mem.h"
#include "portals_compat25.h"


#define LUSTRE_TRACE_SIZE (THREAD_SIZE >> 5)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@
#include <linux/time.h>
#include <asm/div64.h>

#include "portals_compat25.h"

/*
* post 2.5 kernels.
*/
Expand Down

This file was deleted.

4 changes: 2 additions & 2 deletions drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1537,9 +1537,9 @@ int ksocknal_scheduler(void *arg)
nloops = 0;

if (!did_something) { /* wait for something to do */
cfs_wait_event_interruptible_exclusive(
rc = wait_event_interruptible_exclusive(
sched->kss_waitq,
!ksocknal_sched_cansleep(sched), rc);
!ksocknal_sched_cansleep(sched));
LASSERT (rc == 0);
} else {
cond_resched();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
#include <linux/syscalls.h>

#include "../../../include/linux/libcfs/libcfs.h"
#include "../../../include/linux/libcfs/linux/portals_compat25.h"

#include <linux/crc32.h>
static inline __u32 ksocknal_csum(__u32 crc, unsigned char const *p, size_t len)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@

#include <linux/fs_struct.h>
#include <linux/namei.h>
#include "../../../include/linux/libcfs/linux/portals_compat25.h"

#include "lustre_patchless_compat.h"

Expand Down
3 changes: 1 addition & 2 deletions drivers/staging/lustre/lustre/libcfs/hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -2092,8 +2092,7 @@ int cfs_hash_debug_str(struct cfs_hash *hs, struct seq_file *m)
maxdepb = ffz(~maxdep);
}
total += bd.bd_bucket->hsb_count;
dist[min(__cfs_fls(bd.bd_bucket->hsb_count/max(theta,
1)), 7)]++;
dist[min(fls(bd.bd_bucket->hsb_count / max(theta, 1)), 7)]++;
cfs_hash_bd_unlock(hs, &bd, 0);
}

Expand Down
5 changes: 2 additions & 3 deletions drivers/staging/lustre/lustre/libcfs/linux/linux-debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
# define DEBUG_SUBSYSTEM S_LNET

#include "../../../include/linux/libcfs/libcfs.h"
#include "../../../include/linux/libcfs/linux/portals_compat25.h"

#include "../tracefile.h"

Expand Down Expand Up @@ -86,7 +85,7 @@ void libcfs_run_debug_log_upcall(char *file)

argv[2] = NULL;

rc = USERMODEHELPER(argv[0], argv, envp);
rc = call_usermodehelper(argv[0], argv, envp, 1);
if (rc < 0 && rc != -ENOENT) {
CERROR("Error %d invoking LNET debug log upcall %s %s; "
"check /proc/sys/lnet/debug_log_upcall\n",
Expand All @@ -113,7 +112,7 @@ void libcfs_run_upcall(char **argv)

LASSERT(argc >= 2);

rc = USERMODEHELPER(argv[0], argv, envp);
rc = call_usermodehelper(argv[0], argv, envp, 1);
if (rc < 0 && rc != -ENOENT) {
CERROR("Error %d invoking LNET upcall %s %s%s%s%s%s%s%s%s; "
"check /proc/sys/lnet/upcall\n",
Expand Down
20 changes: 10 additions & 10 deletions drivers/staging/lustre/lustre/libcfs/linux/linux-prim.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,11 @@ cfs_block_allsigs(void)
unsigned long flags;
sigset_t old;

SIGNAL_MASK_LOCK(current, flags);
spin_lock_irqsave(&current->sighand->siglock, flags);
old = current->blocked;
sigfillset(&current->blocked);
recalc_sigpending();
SIGNAL_MASK_UNLOCK(current, flags);
spin_unlock_irqrestore(&current->sighand->siglock, flags);

return old;
}
Expand All @@ -144,11 +144,11 @@ sigset_t cfs_block_sigs(unsigned long sigs)
unsigned long flags;
sigset_t old;

SIGNAL_MASK_LOCK(current, flags);
spin_lock_irqsave(&current->sighand->siglock, flags);
old = current->blocked;
sigaddsetmask(&current->blocked, sigs);
recalc_sigpending();
SIGNAL_MASK_UNLOCK(current, flags);
spin_unlock_irqrestore(&current->sighand->siglock, flags);
return old;
}

Expand All @@ -158,11 +158,11 @@ sigset_t cfs_block_sigsinv(unsigned long sigs)
unsigned long flags;
sigset_t old;

SIGNAL_MASK_LOCK(current, flags);
spin_lock_irqsave(&current->sighand->siglock, flags);
old = current->blocked;
sigaddsetmask(&current->blocked, ~sigs);
recalc_sigpending();
SIGNAL_MASK_UNLOCK(current, flags);
spin_unlock_irqrestore(&current->sighand->siglock, flags);

return old;
}
Expand All @@ -172,10 +172,10 @@ cfs_restore_sigs (sigset_t old)
{
unsigned long flags;

SIGNAL_MASK_LOCK(current, flags);
spin_lock_irqsave(&current->sighand->siglock, flags);
current->blocked = old;
recalc_sigpending();
SIGNAL_MASK_UNLOCK(current, flags);
spin_unlock_irqrestore(&current->sighand->siglock, flags);
}

int
Expand All @@ -189,9 +189,9 @@ cfs_clear_sigpending(void)
{
unsigned long flags;

SIGNAL_MASK_LOCK(current, flags);
spin_lock_irqsave(&current->sighand->siglock, flags);
clear_tsk_thread_flag(current, TIF_SIGPENDING);
SIGNAL_MASK_UNLOCK(current, flags);
spin_unlock_irqrestore(&current->sighand->siglock, flags);
}

int
Expand Down
4 changes: 2 additions & 2 deletions drivers/staging/lustre/lustre/libcfs/workitem.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,8 @@ cfs_wi_scheduler (void *arg)
}

cfs_wi_sched_unlock(sched);
cfs_wait_event_interruptible_exclusive(sched->ws_waitq,
!cfs_wi_sched_cansleep(sched), rc);
rc = wait_event_interruptible_exclusive(sched->ws_waitq,
!cfs_wi_sched_cansleep(sched));
cfs_wi_sched_lock(sched);
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/lustre/lustre/obdclass/obd_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -1067,7 +1067,7 @@ static int process_param2_config(struct lustre_cfg *lcfg)
}

do_gettimeofday(&start);
rc = USERMODEHELPER(argv[0], argv, NULL);
rc = call_usermodehelper(argv[0], argv, NULL, 1);
do_gettimeofday(&end);

if (rc < 0) {
Expand Down
2 changes: 0 additions & 2 deletions drivers/staging/lustre/lustre/ptlrpc/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -2041,8 +2041,6 @@ int ptlrpc_set_next_timeout(struct ptlrpc_request_set *set)
struct ptlrpc_request *req;
int deadline;

SIGNAL_MASK_ASSERT(); /* XXX BUG 1511 */

list_for_each(tmp, &set->set_requests) {
req = list_entry(tmp, struct ptlrpc_request, rq_set_chain);

Expand Down

0 comments on commit 46ffc93

Please sign in to comment.