Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 376594
b: refs/heads/master
c: 4a58681
h: refs/heads/master
v: v3
  • Loading branch information
Bob Peterson authored and Steven Whitehouse committed Jun 3, 2013
1 parent 994fa7a commit e851e8e
Show file tree
Hide file tree
Showing 12 changed files with 62 additions and 140 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: 8764d86100fe58e69877753faa44fc1d9276c624
refs/heads/master: 4a586812055dbd2588b0836ab758f6b9670c3949
34 changes: 16 additions & 18 deletions trunk/arch/microblaze/include/asm/cacheflush.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,23 +102,21 @@ do { \

#define flush_cache_range(vma, start, len) do { } 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);
}
#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)

#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 ", (__force u32)addr, (u32)size,
type ? "WRITE" : "READ ", (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 ", (__force u32)addr, (u32)size,
type ? "WRITE" : "READ ", (u32)addr, (u32)size,
(u32)get_fs().seg);
return 1;
}
Expand Down
7 changes: 2 additions & 5 deletions trunk/drivers/regulator/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1539,10 +1539,7 @@ static void regulator_ena_gpio_free(struct regulator_dev *rdev)
}

/**
* 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?
*
* Balance enable_count of each GPIO and actual GPIO pin control.
* 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 @@ -2705,7 +2702,7 @@ EXPORT_SYMBOL_GPL(regulator_get_voltage);
/**
* regulator_set_current_limit - set regulator output current limit
* @regulator: regulator source
* @min_uA: Minimum supported current in uA
* @min_uA: Minimuum 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,6 +24,18 @@
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 @@ -53,18 +65,6 @@ 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_CTRL);
PALMAS_SMPS10_STATUS);
pmic->desc[id].enable_mask = SMPS10_BOOST_EN;
pmic->desc[id].min_uV = 3750000;
pmic->desc[id].uV_step = 1250000;
Expand Down
12 changes: 3 additions & 9 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,14 +241,8 @@ 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: 9 additions & 49 deletions trunk/fs/fuse/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#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 @@ -1279,10 +1278,7 @@ ssize_t fuse_direct_io(struct fuse_io_priv *io, const struct iovec *iov,

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

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

Expand Down Expand Up @@ -1318,11 +1314,7 @@ ssize_t fuse_direct_io(struct fuse_io_priv *io, const struct iovec *iov,
break;
if (count) {
fuse_put_request(fc, req);
if (io->async)
req = fuse_get_req_for_background(fc,
fuse_iter_npages(&ii));
else
req = fuse_get_req(fc, fuse_iter_npages(&ii));
req = fuse_get_req(fc, fuse_iter_npages(&ii));
if (IS_ERR(req))
break;
}
Expand Down Expand Up @@ -2373,19 +2365,13 @@ 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 @@ -2397,10 +2383,10 @@ fuse_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov,
i_size = i_size_read(inode);

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

io = kmalloc(sizeof(struct fuse_io_priv), GFP_KERNEL);
Expand All @@ -2418,15 +2404,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 = async_dio;
io->async = ff->fc->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) && rw == WRITE)
if (!is_sync_kiocb(iocb) && (offset + count > i_size))
io->async = false;

if (rw == WRITE)
Expand All @@ -2438,7 +2424,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 (!is_sync_kiocb(iocb))
if (ret > 0 && !is_sync_kiocb(iocb))
return -EIOCBQUEUED;

ret = wait_on_sync_kiocb(iocb);
Expand All @@ -2460,7 +2446,6 @@ 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 @@ -2474,16 +2459,9 @@ 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)) {
err = PTR_ERR(req);
goto out;
}
if (IS_ERR(req))
return PTR_ERR(req);

req->in.h.opcode = FUSE_FALLOCATE;
req->in.h.nodeid = ff->nodeid;
Expand All @@ -2498,24 +2476,6 @@ 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: 3 additions & 4 deletions trunk/fs/fuse/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -867,11 +867,10 @@ 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
4 changes: 3 additions & 1 deletion trunk/fs/gfs2/lops.c
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,9 @@ static void gfs2_before_commit(struct gfs2_sbd *sdp, unsigned int limit,
if (total > limit)
num = limit;
gfs2_log_unlock(sdp);
page = gfs2_get_log_desc(sdp, GFS2_LOG_DESC_METADATA, num + 1, num);
page = gfs2_get_log_desc(sdp,
is_databuf ? GFS2_LOG_DESC_JDATA :
GFS2_LOG_DESC_METADATA, num + 1, num);
ld = page_address(page);
gfs2_log_lock(sdp);
ptr = (__be64 *)(ld + 1);
Expand Down
8 changes: 1 addition & 7 deletions trunk/fs/jfs/jfs_logmgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -2009,13 +2009,7 @@ static int lbmRead(struct jfs_log * log, int pn, struct lbuf ** bpp)

bio->bi_end_io = lbmIODone;
bio->bi_private = bp;
/*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);
}
submit_bio(READ_SYNC, bio);

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

Expand Down
Loading

0 comments on commit e851e8e

Please sign in to comment.