Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 276453
b: refs/heads/master
c: fe6b91f
h: refs/heads/master
i:
  276451: c365b06
v: v3
  • Loading branch information
Alan Stern authored and Rafael J. Wysocki committed Dec 7, 2011
1 parent e1b93b1 commit 71a495d
Show file tree
Hide file tree
Showing 15 changed files with 91 additions and 123 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: 22c6b32d8d9b7adf903c19b7e108062431fdc6fc
refs/heads/master: fe6b91f47080eb17d21cbf2a39311877d57f6938
4 changes: 1 addition & 3 deletions trunk/arch/m68k/include/asm/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -350,12 +350,10 @@
#define __NR_clock_adjtime 342
#define __NR_syncfs 343
#define __NR_setns 344
#define __NR_process_vm_readv 345
#define __NR_process_vm_writev 346

#ifdef __KERNEL__

#define NR_syscalls 347
#define NR_syscalls 345

#define __ARCH_WANT_IPC_PARSE_VERSION
#define __ARCH_WANT_OLD_READDIR
Expand Down
2 changes: 0 additions & 2 deletions trunk/arch/m68k/kernel/syscalltable.S
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,4 @@ ENTRY(sys_call_table)
.long sys_clock_adjtime
.long sys_syncfs
.long sys_setns
.long sys_process_vm_readv /* 345 */
.long sys_process_vm_writev

6 changes: 4 additions & 2 deletions trunk/drivers/base/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1743,8 +1743,10 @@ void device_shutdown(void)
*/
list_del_init(&dev->kobj.entry);
spin_unlock(&devices_kset->list_lock);
/* Disable all device's runtime power management */
pm_runtime_disable(dev);

/* Don't allow any more runtime suspends */
pm_runtime_get_noresume(dev);
pm_runtime_barrier(dev);

if (dev->bus && dev->bus->shutdown) {
dev_dbg(dev, "shutdown\n");
Expand Down
7 changes: 1 addition & 6 deletions trunk/drivers/gpu/drm/i915/i915_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -2026,13 +2026,8 @@ i915_wait_request(struct intel_ring_buffer *ring,
* to handle this, the waiter on a request often wants an associated
* buffer to have made it to the inactive list, and we would need
* a separate wait queue to handle that.
*
* To avoid a recursion with the ilk VT-d workaround (that calls
* gpu_idle when unbinding objects with interruptible==false) don't
* retire requests in that case (because it might call unbind if the
* active list holds the last reference to the object).
*/
if (ret == 0 && dev_priv->mm.interruptible)
if (ret == 0)
i915_gem_retire_requests_ring(ring);

return ret;
Expand Down
7 changes: 4 additions & 3 deletions trunk/drivers/gpu/drm/radeon/radeon_encoders.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,12 +233,13 @@ u16 radeon_encoder_get_dp_bridge_encoder_id(struct drm_encoder *encoder)
switch (radeon_encoder->encoder_id) {
case ENCODER_OBJECT_ID_TRAVIS:
case ENCODER_OBJECT_ID_NUTMEG:
return radeon_encoder->encoder_id;
return true;
default:
return ENCODER_OBJECT_ID_NONE;
return false;
}
}
return ENCODER_OBJECT_ID_NONE;

return false;
}

void radeon_panel_mode_fixup(struct drm_encoder *encoder,
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ int vmw_present_ioctl(struct drm_device *dev, void *data,
goto out_clips;
}

clips = kcalloc(num_clips, sizeof(*clips), GFP_KERNEL);
clips = kzalloc(num_clips * sizeof(*clips), GFP_KERNEL);
if (clips == NULL) {
DRM_ERROR("Failed to allocate clip rect list.\n");
ret = -ENOMEM;
Expand Down Expand Up @@ -232,7 +232,7 @@ int vmw_present_readback_ioctl(struct drm_device *dev, void *data,
goto out_clips;
}

clips = kcalloc(num_clips, sizeof(*clips), GFP_KERNEL);
clips = kzalloc(num_clips * sizeof(*clips), GFP_KERNEL);
if (clips == NULL) {
DRM_ERROR("Failed to allocate clip rect list.\n");
ret = -ENOMEM;
Expand Down
13 changes: 9 additions & 4 deletions trunk/drivers/of/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
#include <linux/string.h>
#include <linux/slab.h>

/* For archs that don't support NO_IRQ (such as x86), provide a dummy value */
#ifndef NO_IRQ
#define NO_IRQ 0
#endif

/**
* irq_of_parse_and_map - Parse and map an interrupt into linux virq space
* @device: Device node of the device whose interrupt is to be mapped
Expand All @@ -39,7 +44,7 @@ unsigned int irq_of_parse_and_map(struct device_node *dev, int index)
struct of_irq oirq;

if (of_irq_map_one(dev, index, &oirq))
return 0;
return NO_IRQ;

return irq_create_of_mapping(oirq.controller, oirq.specifier,
oirq.size);
Expand Down Expand Up @@ -340,7 +345,7 @@ int of_irq_to_resource(struct device_node *dev, int index, struct resource *r)

/* Only dereference the resource if both the
* resource and the irq are valid. */
if (r && irq) {
if (r && irq != NO_IRQ) {
r->start = r->end = irq;
r->flags = IORESOURCE_IRQ;
r->name = dev->full_name;
Expand All @@ -358,7 +363,7 @@ int of_irq_count(struct device_node *dev)
{
int nr = 0;

while (of_irq_to_resource(dev, nr, NULL))
while (of_irq_to_resource(dev, nr, NULL) != NO_IRQ)
nr++;

return nr;
Expand All @@ -378,7 +383,7 @@ int of_irq_to_resource_table(struct device_node *dev, struct resource *res,
int i;

for (i = 0; i < nr_irqs; i++, res++)
if (!of_irq_to_resource(dev, i, res))
if (of_irq_to_resource(dev, i, res) == NO_IRQ)
break;

return i;
Expand Down
71 changes: 27 additions & 44 deletions trunk/fs/dcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -2439,14 +2439,16 @@ static int prepend_name(char **buffer, int *buflen, struct qstr *name)
/**
* prepend_path - Prepend path string to a buffer
* @path: the dentry/vfsmount to report
* @root: root vfsmnt/dentry
* @root: root vfsmnt/dentry (may be modified by this function)
* @buffer: pointer to the end of the buffer
* @buflen: pointer to buffer length
*
* Caller holds the rename_lock.
*
* If path is not reachable from the supplied root, then the value of
* root is changed (without modifying refcounts).
*/
static int prepend_path(const struct path *path,
const struct path *root,
static int prepend_path(const struct path *path, struct path *root,
char **buffer, int *buflen)
{
struct dentry *dentry = path->dentry;
Expand Down Expand Up @@ -2481,10 +2483,10 @@ static int prepend_path(const struct path *path,
dentry = parent;
}

out:
if (!error && !slash)
error = prepend(buffer, buflen, "/", 1);

out:
br_read_unlock(vfsmount_lock);
return error;

Expand All @@ -2498,17 +2500,15 @@ static int prepend_path(const struct path *path,
WARN(1, "Root dentry has weird name <%.*s>\n",
(int) dentry->d_name.len, dentry->d_name.name);
}
if (!slash)
error = prepend(buffer, buflen, "/", 1);
if (!error)
error = vfsmnt->mnt_ns ? 1 : 2;
root->mnt = vfsmnt;
root->dentry = dentry;
goto out;
}

/**
* __d_path - return the path of a dentry
* @path: the dentry/vfsmount to report
* @root: root vfsmnt/dentry
* @root: root vfsmnt/dentry (may be modified by this function)
* @buf: buffer to return value in
* @buflen: buffer length
*
Expand All @@ -2519,10 +2519,10 @@ static int prepend_path(const struct path *path,
*
* "buflen" should be positive.
*
* If the path is not reachable from the supplied root, return %NULL.
* If path is not reachable from the supplied root, then the value of
* root is changed (without modifying refcounts).
*/
char *__d_path(const struct path *path,
const struct path *root,
char *__d_path(const struct path *path, struct path *root,
char *buf, int buflen)
{
char *res = buf + buflen;
Expand All @@ -2533,38 +2533,16 @@ char *__d_path(const struct path *path,
error = prepend_path(path, root, &res, &buflen);
write_sequnlock(&rename_lock);

if (error < 0)
return ERR_PTR(error);
if (error > 0)
return NULL;
return res;
}

char *d_absolute_path(const struct path *path,
char *buf, int buflen)
{
struct path root = {};
char *res = buf + buflen;
int error;

prepend(&res, &buflen, "\0", 1);
write_seqlock(&rename_lock);
error = prepend_path(path, &root, &res, &buflen);
write_sequnlock(&rename_lock);

if (error > 1)
error = -EINVAL;
if (error < 0)
if (error)
return ERR_PTR(error);
return res;
}

/*
* same as __d_path but appends "(deleted)" for unlinked files.
*/
static int path_with_deleted(const struct path *path,
const struct path *root,
char **buf, int *buflen)
static int path_with_deleted(const struct path *path, struct path *root,
char **buf, int *buflen)
{
prepend(buf, buflen, "\0", 1);
if (d_unlinked(path->dentry)) {
Expand Down Expand Up @@ -2601,6 +2579,7 @@ char *d_path(const struct path *path, char *buf, int buflen)
{
char *res = buf + buflen;
struct path root;
struct path tmp;
int error;

/*
Expand All @@ -2615,8 +2594,9 @@ char *d_path(const struct path *path, char *buf, int buflen)

get_fs_root(current->fs, &root);
write_seqlock(&rename_lock);
error = path_with_deleted(path, &root, &res, &buflen);
if (error < 0)
tmp = root;
error = path_with_deleted(path, &tmp, &res, &buflen);
if (error)
res = ERR_PTR(error);
write_sequnlock(&rename_lock);
path_put(&root);
Expand All @@ -2637,15 +2617,17 @@ char *d_path_with_unreachable(const struct path *path, char *buf, int buflen)
{
char *res = buf + buflen;
struct path root;
struct path tmp;
int error;

if (path->dentry->d_op && path->dentry->d_op->d_dname)
return path->dentry->d_op->d_dname(path->dentry, buf, buflen);

get_fs_root(current->fs, &root);
write_seqlock(&rename_lock);
error = path_with_deleted(path, &root, &res, &buflen);
if (error > 0)
tmp = root;
error = path_with_deleted(path, &tmp, &res, &buflen);
if (!error && !path_equal(&tmp, &root))
error = prepend_unreachable(&res, &buflen);
write_sequnlock(&rename_lock);
path_put(&root);
Expand Down Expand Up @@ -2776,18 +2758,19 @@ SYSCALL_DEFINE2(getcwd, char __user *, buf, unsigned long, size)
write_seqlock(&rename_lock);
if (!d_unlinked(pwd.dentry)) {
unsigned long len;
struct path tmp = root;
char *cwd = page + PAGE_SIZE;
int buflen = PAGE_SIZE;

prepend(&cwd, &buflen, "\0", 1);
error = prepend_path(&pwd, &root, &cwd, &buflen);
error = prepend_path(&pwd, &tmp, &cwd, &buflen);
write_sequnlock(&rename_lock);

if (error < 0)
if (error)
goto out;

/* Unreachable from current root */
if (error > 0) {
if (!path_equal(&tmp, &root)) {
error = prepend_unreachable(&cwd, &buflen);
if (error)
goto out;
Expand Down
20 changes: 9 additions & 11 deletions trunk/fs/namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -1048,12 +1048,15 @@ static int show_mountinfo(struct seq_file *m, void *v)
if (err)
goto out;
seq_putc(m, ' ');

/* mountpoints outside of chroot jail will give SEQ_SKIP on this */
err = seq_path_root(m, &mnt_path, &root, " \t\n\\");
if (err)
goto out;

seq_path_root(m, &mnt_path, &root, " \t\n\\");
if (root.mnt != p->root.mnt || root.dentry != p->root.dentry) {
/*
* Mountpoint is outside root, discard that one. Ugly,
* but less so than trying to do that in iterator in a
* race-free way (due to renames).
*/
return SEQ_SKIP;
}
seq_puts(m, mnt->mnt_flags & MNT_READONLY ? " ro" : " rw");
show_mnt_opts(m, mnt);

Expand Down Expand Up @@ -2773,8 +2776,3 @@ void kern_unmount(struct vfsmount *mnt)
}
}
EXPORT_SYMBOL(kern_unmount);

bool our_mnt(struct vfsmount *mnt)
{
return check_mnt(mnt);
}
6 changes: 3 additions & 3 deletions trunk/fs/seq_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,8 @@ EXPORT_SYMBOL(seq_path);

/*
* Same as seq_path, but relative to supplied root.
*
* root may be changed, see __d_path().
*/
int seq_path_root(struct seq_file *m, struct path *path, struct path *root,
char *esc)
Expand All @@ -461,8 +463,6 @@ int seq_path_root(struct seq_file *m, struct path *path, struct path *root,
char *p;

p = __d_path(path, root, buf, size);
if (!p)
return SEQ_SKIP;
res = PTR_ERR(p);
if (!IS_ERR(p)) {
char *end = mangle_path(buf, p, esc);
Expand All @@ -474,7 +474,7 @@ int seq_path_root(struct seq_file *m, struct path *path, struct path *root,
}
seq_commit(m, res);

return res < 0 && res != -ENAMETOOLONG ? res : 0;
return res < 0 ? res : 0;
}

/*
Expand Down
3 changes: 1 addition & 2 deletions trunk/include/linux/dcache.h
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,7 @@ extern int d_validate(struct dentry *, struct dentry *);
*/
extern char *dynamic_dname(struct dentry *, char *, int, const char *, ...);

extern char *__d_path(const struct path *, const struct path *, char *, int);
extern char *d_absolute_path(const struct path *, char *, int);
extern char *__d_path(const struct path *path, struct path *root, char *, int);
extern char *d_path(const struct path *, char *, int);
extern char *d_path_with_unreachable(const struct path *, char *, int);
extern char *dentry_path_raw(struct dentry *, char *, int);
Expand Down
1 change: 0 additions & 1 deletion trunk/include/linux/fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1942,7 +1942,6 @@ extern int fd_statfs(int, struct kstatfs *);
extern int statfs_by_dentry(struct dentry *, struct kstatfs *);
extern int freeze_super(struct super_block *super);
extern int thaw_super(struct super_block *super);
extern bool our_mnt(struct vfsmount *mnt);

extern int current_umask(void);

Expand Down
Loading

0 comments on commit 71a495d

Please sign in to comment.