Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 376598
b: refs/heads/master
c: 6f66f90
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed Jun 5, 2013
1 parent ee38f89 commit c6c66d0
Show file tree
Hide file tree
Showing 11 changed files with 139 additions and 59 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: a6a4d98b0124b5d3befe8b3a99f51f1b4fcc6dcf
refs/heads/master: 6f66f9005b66a9a09028f8c85d67600b20a979ec
34 changes: 18 additions & 16 deletions trunk/arch/microblaze/include/asm/cacheflush.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,21 +102,23 @@ do { \

#define flush_cache_range(vma, start, len) do { } while (0)

#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
do { \
u32 addr = virt_to_phys(dst); \
memcpy((dst), (src), (len)); \
if (vma->vm_flags & VM_EXEC) { \
invalidate_icache_range((unsigned) (addr), \
(unsigned) (addr) + PAGE_SIZE); \
flush_dcache_range((unsigned) (addr), \
(unsigned) (addr) + PAGE_SIZE); \
} \
} while (0)

#define copy_from_user_page(vma, page, vaddr, dst, src, len) \
do { \
memcpy((dst), (src), (len)); \
} while (0)
static inline void copy_to_user_page(struct vm_area_struct *vma,
struct page *page, unsigned long vaddr,
void *dst, void *src, int len)
{
u32 addr = virt_to_phys(dst);
memcpy(dst, src, len);
if (vma->vm_flags & VM_EXEC) {
invalidate_icache_range(addr, addr + PAGE_SIZE);
flush_dcache_range(addr, addr + PAGE_SIZE);
}
}

static inline void copy_from_user_page(struct vm_area_struct *vma,
struct page *page, unsigned long vaddr,
void *dst, void *src, int len)
{
memcpy(dst, src, len);
}

#endif /* _ASM_MICROBLAZE_CACHEFLUSH_H */
4 changes: 2 additions & 2 deletions trunk/arch/microblaze/include/asm/uaccess.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@ static inline int access_ok(int type, const void __user *addr,
if ((get_fs().seg < ((unsigned long)addr)) ||
(get_fs().seg < ((unsigned long)addr + size - 1))) {
pr_debug("ACCESS fail: %s at 0x%08x (size 0x%x), seg 0x%08x\n",
type ? "WRITE" : "READ ", (u32)addr, (u32)size,
type ? "WRITE" : "READ ", (__force u32)addr, (u32)size,
(u32)get_fs().seg);
return 0;
}
ok:
pr_debug("ACCESS OK: %s at 0x%08x (size 0x%x), seg 0x%08x\n",
type ? "WRITE" : "READ ", (u32)addr, (u32)size,
type ? "WRITE" : "READ ", (__force u32)addr, (u32)size,
(u32)get_fs().seg);
return 1;
}
Expand Down
7 changes: 5 additions & 2 deletions trunk/drivers/regulator/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1539,7 +1539,10 @@ static void regulator_ena_gpio_free(struct regulator_dev *rdev)
}

/**
* Balance enable_count of each GPIO and actual GPIO pin control.
* regulator_ena_gpio_ctrl - balance enable_count of each GPIO and actual GPIO pin control
* @rdev: regulator_dev structure
* @enable: enable GPIO at initial use?
*
* GPIO is enabled in case of initial use. (enable_count is 0)
* GPIO is disabled when it is not shared any more. (enable_count <= 1)
*/
Expand Down Expand Up @@ -2702,7 +2705,7 @@ EXPORT_SYMBOL_GPL(regulator_get_voltage);
/**
* regulator_set_current_limit - set regulator output current limit
* @regulator: regulator source
* @min_uA: Minimuum supported current in uA
* @min_uA: Minimum supported current in uA
* @max_uA: Maximum supported current in uA
*
* Sets current sink to the desired output current. This can be set during
Expand Down
24 changes: 12 additions & 12 deletions trunk/drivers/regulator/dbx500-prcmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,6 @@
static int power_state_active_cnt; /* will initialize to zero */
static DEFINE_SPINLOCK(power_state_active_lock);

int power_state_active_get(void)
{
unsigned long flags;
int cnt;

spin_lock_irqsave(&power_state_active_lock, flags);
cnt = power_state_active_cnt;
spin_unlock_irqrestore(&power_state_active_lock, flags);

return cnt;
}

void power_state_active_enable(void)
{
unsigned long flags;
Expand Down Expand Up @@ -65,6 +53,18 @@ int power_state_active_disable(void)

#ifdef CONFIG_REGULATOR_DEBUG

static int power_state_active_get(void)
{
unsigned long flags;
int cnt;

spin_lock_irqsave(&power_state_active_lock, flags);
cnt = power_state_active_cnt;
spin_unlock_irqrestore(&power_state_active_lock, flags);

return cnt;
}

static struct ux500_regulator_debug {
struct dentry *dir;
struct dentry *status_file;
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/regulator/palmas-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ static int palmas_regulators_probe(struct platform_device *pdev)
break;
}

if ((id == PALMAS_REG_SMPS6) && (id == PALMAS_REG_SMPS8))
if ((id == PALMAS_REG_SMPS6) || (id == PALMAS_REG_SMPS8))
ramp_delay_support = true;

if (ramp_delay_support) {
Expand Down Expand Up @@ -878,7 +878,7 @@ static int palmas_regulators_probe(struct platform_device *pdev)
pmic->desc[id].vsel_mask = SMPS10_VSEL;
pmic->desc[id].enable_reg =
PALMAS_BASE_TO_REG(PALMAS_SMPS_BASE,
PALMAS_SMPS10_STATUS);
PALMAS_SMPS10_CTRL);
pmic->desc[id].enable_mask = SMPS10_BOOST_EN;
pmic->desc[id].min_uV = 3750000;
pmic->desc[id].uV_step = 1250000;
Expand Down
12 changes: 9 additions & 3 deletions trunk/fs/fuse/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,17 +180,17 @@ u64 fuse_get_attr_version(struct fuse_conn *fc)
static int fuse_dentry_revalidate(struct dentry *entry, unsigned int flags)
{
struct inode *inode;
struct dentry *parent;
struct fuse_conn *fc;

inode = ACCESS_ONCE(entry->d_inode);
if (inode && is_bad_inode(inode))
return 0;
else if (fuse_dentry_time(entry) < get_jiffies_64()) {
int err;
struct fuse_entry_out outarg;
struct fuse_conn *fc;
struct fuse_req *req;
struct fuse_forget_link *forget;
struct dentry *parent;
u64 attr_version;

/* For negative dentries, always do a fresh lookup */
Expand Down Expand Up @@ -241,8 +241,14 @@ static int fuse_dentry_revalidate(struct dentry *entry, unsigned int flags)
entry_attr_timeout(&outarg),
attr_version);
fuse_change_entry_timeout(entry, &outarg);
} else if (inode) {
fc = get_fuse_conn(inode);
if (fc->readdirplus_auto) {
parent = dget_parent(entry);
fuse_advise_use_readdirplus(parent->d_inode);
dput(parent);
}
}
fuse_advise_use_readdirplus(inode);
return 1;
}

Expand Down
58 changes: 49 additions & 9 deletions trunk/fs/fuse/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <linux/compat.h>
#include <linux/swap.h>
#include <linux/aio.h>
#include <linux/falloc.h>

static const struct file_operations fuse_direct_io_file_operations;

Expand Down Expand Up @@ -1278,7 +1279,10 @@ ssize_t fuse_direct_io(struct fuse_io_priv *io, const struct iovec *iov,

iov_iter_init(&ii, iov, nr_segs, count, 0);

req = fuse_get_req(fc, fuse_iter_npages(&ii));
if (io->async)
req = fuse_get_req_for_background(fc, fuse_iter_npages(&ii));
else
req = fuse_get_req(fc, fuse_iter_npages(&ii));
if (IS_ERR(req))
return PTR_ERR(req);

Expand Down Expand Up @@ -1314,7 +1318,11 @@ ssize_t fuse_direct_io(struct fuse_io_priv *io, const struct iovec *iov,
break;
if (count) {
fuse_put_request(fc, req);
req = fuse_get_req(fc, fuse_iter_npages(&ii));
if (io->async)
req = fuse_get_req_for_background(fc,
fuse_iter_npages(&ii));
else
req = fuse_get_req(fc, fuse_iter_npages(&ii));
if (IS_ERR(req))
break;
}
Expand Down Expand Up @@ -2365,13 +2373,19 @@ static void fuse_do_truncate(struct file *file)
fuse_do_setattr(inode, &attr, file);
}

static inline loff_t fuse_round_up(loff_t off)
{
return round_up(off, FUSE_MAX_PAGES_PER_REQ << PAGE_SHIFT);
}

static ssize_t
fuse_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov,
loff_t offset, unsigned long nr_segs)
{
ssize_t ret = 0;
struct file *file = iocb->ki_filp;
struct fuse_file *ff = file->private_data;
bool async_dio = ff->fc->async_dio;
loff_t pos = 0;
struct inode *inode;
loff_t i_size;
Expand All @@ -2383,10 +2397,10 @@ fuse_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov,
i_size = i_size_read(inode);

/* optimization for short read */
if (rw != WRITE && offset + count > i_size) {
if (async_dio && rw != WRITE && offset + count > i_size) {
if (offset >= i_size)
return 0;
count = i_size - offset;
count = min_t(loff_t, count, fuse_round_up(i_size - offset));
}

io = kmalloc(sizeof(struct fuse_io_priv), GFP_KERNEL);
Expand All @@ -2404,15 +2418,15 @@ fuse_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov,
* By default, we want to optimize all I/Os with async request
* submission to the client filesystem if supported.
*/
io->async = ff->fc->async_dio;
io->async = async_dio;
io->iocb = iocb;

/*
* We cannot asynchronously extend the size of a file. We have no method
* to wait on real async I/O requests, so we must submit this request
* synchronously.
*/
if (!is_sync_kiocb(iocb) && (offset + count > i_size))
if (!is_sync_kiocb(iocb) && (offset + count > i_size) && rw == WRITE)
io->async = false;

if (rw == WRITE)
Expand All @@ -2424,7 +2438,7 @@ fuse_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov,
fuse_aio_complete(io, ret < 0 ? ret : 0, -1);

/* we have a non-extending, async request, so return */
if (ret > 0 && !is_sync_kiocb(iocb))
if (!is_sync_kiocb(iocb))
return -EIOCBQUEUED;

ret = wait_on_sync_kiocb(iocb);
Expand All @@ -2446,6 +2460,7 @@ static long fuse_file_fallocate(struct file *file, int mode, loff_t offset,
loff_t length)
{
struct fuse_file *ff = file->private_data;
struct inode *inode = file->f_inode;
struct fuse_conn *fc = ff->fc;
struct fuse_req *req;
struct fuse_fallocate_in inarg = {
Expand All @@ -2459,9 +2474,16 @@ static long fuse_file_fallocate(struct file *file, int mode, loff_t offset,
if (fc->no_fallocate)
return -EOPNOTSUPP;

if (mode & FALLOC_FL_PUNCH_HOLE) {
mutex_lock(&inode->i_mutex);
fuse_set_nowrite(inode);
}

req = fuse_get_req_nopages(fc);
if (IS_ERR(req))
return PTR_ERR(req);
if (IS_ERR(req)) {
err = PTR_ERR(req);
goto out;
}

req->in.h.opcode = FUSE_FALLOCATE;
req->in.h.nodeid = ff->nodeid;
Expand All @@ -2476,6 +2498,24 @@ static long fuse_file_fallocate(struct file *file, int mode, loff_t offset,
}
fuse_put_request(fc, req);

if (err)
goto out;

/* we could have extended the file */
if (!(mode & FALLOC_FL_KEEP_SIZE))
fuse_write_update_size(inode, offset + length);

if (mode & FALLOC_FL_PUNCH_HOLE)
truncate_pagecache_range(inode, offset, offset + length - 1);

fuse_invalidate_attr(inode);

out:
if (mode & FALLOC_FL_PUNCH_HOLE) {
fuse_release_nowrite(inode);
mutex_unlock(&inode->i_mutex);
}

return err;
}

Expand Down
7 changes: 4 additions & 3 deletions trunk/fs/fuse/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -867,10 +867,11 @@ static void process_init_reply(struct fuse_conn *fc, struct fuse_req *req)
fc->dont_mask = 1;
if (arg->flags & FUSE_AUTO_INVAL_DATA)
fc->auto_inval_data = 1;
if (arg->flags & FUSE_DO_READDIRPLUS)
if (arg->flags & FUSE_DO_READDIRPLUS) {
fc->do_readdirplus = 1;
if (arg->flags & FUSE_READDIRPLUS_AUTO)
fc->readdirplus_auto = 1;
if (arg->flags & FUSE_READDIRPLUS_AUTO)
fc->readdirplus_auto = 1;
}
if (arg->flags & FUSE_ASYNC_DIO)
fc->async_dio = 1;
} else {
Expand Down
8 changes: 7 additions & 1 deletion trunk/fs/jfs/jfs_logmgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -2009,7 +2009,13 @@ static int lbmRead(struct jfs_log * log, int pn, struct lbuf ** bpp)

bio->bi_end_io = lbmIODone;
bio->bi_private = bp;
submit_bio(READ_SYNC, bio);
/*check if journaling to disk has been disabled*/
if (log->no_integrity) {
bio->bi_size = 0;
lbmIODone(bio, 0);
} else {
submit_bio(READ_SYNC, bio);
}

wait_event(bp->l_ioevent, (bp->l_flag != lbmREAD));

Expand Down
Loading

0 comments on commit c6c66d0

Please sign in to comment.