Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 210174
b: refs/heads/master
c: 6300d6d
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed Sep 7, 2010
1 parent 933252d commit bd36da7
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c7ef35a960369bcad733b92868e4befe03ba9234
refs/heads/master: 6300d6d755842f2ed18053ed6f868944d51b5aef
15 changes: 10 additions & 5 deletions trunk/arch/h8300/include/asm/atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@

static __inline__ int atomic_add_return(int i, atomic_t *v)
{
int ret,flags;
unsigned long flags;
int ret;
local_irq_save(flags);
ret = v->counter += i;
local_irq_restore(flags);
Expand All @@ -30,7 +31,8 @@ static __inline__ int atomic_add_return(int i, atomic_t *v)

static __inline__ int atomic_sub_return(int i, atomic_t *v)
{
int ret,flags;
unsigned long flags;
int ret;
local_irq_save(flags);
ret = v->counter -= i;
local_irq_restore(flags);
Expand All @@ -42,7 +44,8 @@ static __inline__ int atomic_sub_return(int i, atomic_t *v)

static __inline__ int atomic_inc_return(atomic_t *v)
{
int ret,flags;
unsigned long flags;
int ret;
local_irq_save(flags);
v->counter++;
ret = v->counter;
Expand All @@ -64,7 +67,8 @@ static __inline__ int atomic_inc_return(atomic_t *v)

static __inline__ int atomic_dec_return(atomic_t *v)
{
int ret,flags;
unsigned long flags;
int ret;
local_irq_save(flags);
--v->counter;
ret = v->counter;
Expand All @@ -76,7 +80,8 @@ static __inline__ int atomic_dec_return(atomic_t *v)

static __inline__ int atomic_dec_and_test(atomic_t *v)
{
int ret,flags;
unsigned long flags;
int ret;
local_irq_save(flags);
--v->counter;
ret = v->counter;
Expand Down
4 changes: 3 additions & 1 deletion trunk/arch/h8300/include/asm/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

#include <linux/linkage.h>

struct pt_regs;

/*
* switch_to(n) should switch tasks to task ptr, first checking that
* ptr isn't the current task, in which case it does nothing. This
Expand Down Expand Up @@ -155,6 +157,6 @@ static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int siz

#define arch_align_stack(x) (x)

void die(char *str, struct pt_regs *fp, unsigned long err);
extern void die(const char *str, struct pt_regs *fp, unsigned long err);

#endif /* _H8300_SYSTEM_H */
4 changes: 2 additions & 2 deletions trunk/arch/h8300/kernel/sys_h8300.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ int kernel_execve(const char *filename,
const char *const envp[])
{
register long res __asm__("er0");
register char *const *_c __asm__("er3") = envp;
register char *const *_b __asm__("er2") = argv;
register const char *const *_c __asm__("er3") = envp;
register const char *const *_b __asm__("er2") = argv;
register const char * _a __asm__("er1") = filename;
__asm__ __volatile__ ("mov.l %1,er0\n\t"
"trapa #0\n\t"
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/h8300/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ static void dump(struct pt_regs *fp)
printk("\n\n");
}

void die(char *str, struct pt_regs *fp, unsigned long err)
void die(const char *str, struct pt_regs *fp, unsigned long err)
{
static int diecount;

Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/m68knommu/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ SECTIONS {
_sdata = . ;
DATA_DATA
CACHELINE_ALIGNED_DATA(32)
PAGE_ALIGNED_DATA(PAGE_SIZE)
*(.data..shared_aligned)
INIT_TASK_DATA(THREAD_SIZE)
_edata = . ;
} > DATA
Expand Down
23 changes: 22 additions & 1 deletion trunk/fs/namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -1483,14 +1483,31 @@ static int graft_tree(struct vfsmount *mnt, struct path *path)
return err;
}

/*
* Sanity check the flags to change_mnt_propagation.
*/

static int flags_to_propagation_type(int flags)
{
int type = flags & ~MS_REC;

/* Fail if any non-propagation flags are set */
if (type & ~(MS_SHARED | MS_PRIVATE | MS_SLAVE | MS_UNBINDABLE))
return 0;
/* Only one propagation flag should be set */
if (!is_power_of_2(type))
return 0;
return type;
}

/*
* recursively change the type of the mountpoint.
*/
static int do_change_type(struct path *path, int flag)
{
struct vfsmount *m, *mnt = path->mnt;
int recurse = flag & MS_REC;
int type = flag & ~MS_REC;
int type;
int err = 0;

if (!capable(CAP_SYS_ADMIN))
Expand All @@ -1499,6 +1516,10 @@ static int do_change_type(struct path *path, int flag)
if (path->dentry != path->mnt->mnt_root)
return -EINVAL;

type = flags_to_propagation_type(flag);
if (!type)
return -EINVAL;

down_write(&namespace_sem);
if (type == MS_SHARED) {
err = invent_group_ids(mnt, recurse);
Expand Down

0 comments on commit bd36da7

Please sign in to comment.