mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
Merge branch 'akpm' (patches from Andrew)
Merge updates from Andrew Morton: - a few misc bits - ocfs2 updates - almost all of MM * emailed patches from Andrew Morton <[email protected]>: (131 commits) memory hotplug: fix comments when adding section mm: make alloc_node_mem_map a void call if we don't have CONFIG_FLAT_NODE_MEM_MAP mm: simplify nodemask printing mm,oom_reaper: remove pointless kthread_run() error check mm/page_ext.c: check if page_ext is not prepared writeback: remove unused function parameter mm: do not rely on preempt_count in print_vma_addr mm, sparse: do not swamp log with huge vmemmap allocation failures mm/hmm: remove redundant variable align_end mm/list_lru.c: mark expected switch fall-through mm/shmem.c: mark expected switch fall-through mm/page_alloc.c: broken deferred calculation mm: don't warn about allocations which stall for too long fs: fuse: account fuse_inode slab memory as reclaimable mm, page_alloc: fix potential false positive in __zone_watermark_ok mm: mlock: remove lru_add_drain_all() mm, sysctl: make NUMA stats configurable shmem: convert shmem_init_inodecache() to void Unify migrate_pages and move_pages access checks mm, pagevec: rename pagevec drained field ...
This commit is contained in:
commit
7c225c69f8
250 changed files with 2276 additions and 4084 deletions
|
|
@ -3585,8 +3585,6 @@ static int ocfs2_merge_rec_left(struct ocfs2_path *right_path,
|
|||
* The easy case - we can just plop the record right in.
|
||||
*/
|
||||
*left_rec = *split_rec;
|
||||
|
||||
has_empty_extent = 0;
|
||||
} else
|
||||
le16_add_cpu(&left_rec->e_leaf_clusters, split_clusters);
|
||||
|
||||
|
|
|
|||
|
|
@ -134,6 +134,19 @@ bail:
|
|||
return err;
|
||||
}
|
||||
|
||||
static int ocfs2_lock_get_block(struct inode *inode, sector_t iblock,
|
||||
struct buffer_head *bh_result, int create)
|
||||
{
|
||||
int ret = 0;
|
||||
struct ocfs2_inode_info *oi = OCFS2_I(inode);
|
||||
|
||||
down_read(&oi->ip_alloc_sem);
|
||||
ret = ocfs2_get_block(inode, iblock, bh_result, create);
|
||||
up_read(&oi->ip_alloc_sem);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ocfs2_get_block(struct inode *inode, sector_t iblock,
|
||||
struct buffer_head *bh_result, int create)
|
||||
{
|
||||
|
|
@ -2128,7 +2141,7 @@ static void ocfs2_dio_free_write_ctx(struct inode *inode,
|
|||
* called like this: dio->get_blocks(dio->inode, fs_startblk,
|
||||
* fs_count, map_bh, dio->rw == WRITE);
|
||||
*/
|
||||
static int ocfs2_dio_get_block(struct inode *inode, sector_t iblock,
|
||||
static int ocfs2_dio_wr_get_block(struct inode *inode, sector_t iblock,
|
||||
struct buffer_head *bh_result, int create)
|
||||
{
|
||||
struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
|
||||
|
|
@ -2154,12 +2167,9 @@ static int ocfs2_dio_get_block(struct inode *inode, sector_t iblock,
|
|||
* while file size will be changed.
|
||||
*/
|
||||
if (pos + total_len <= i_size_read(inode)) {
|
||||
down_read(&oi->ip_alloc_sem);
|
||||
|
||||
/* This is the fast path for re-write. */
|
||||
ret = ocfs2_get_block(inode, iblock, bh_result, create);
|
||||
|
||||
up_read(&oi->ip_alloc_sem);
|
||||
|
||||
ret = ocfs2_lock_get_block(inode, iblock, bh_result, create);
|
||||
if (buffer_mapped(bh_result) &&
|
||||
!buffer_new(bh_result) &&
|
||||
ret == 0)
|
||||
|
|
@ -2424,9 +2434,9 @@ static ssize_t ocfs2_direct_IO(struct kiocb *iocb, struct iov_iter *iter)
|
|||
return 0;
|
||||
|
||||
if (iov_iter_rw(iter) == READ)
|
||||
get_block = ocfs2_get_block;
|
||||
get_block = ocfs2_lock_get_block;
|
||||
else
|
||||
get_block = ocfs2_dio_get_block;
|
||||
get_block = ocfs2_dio_wr_get_block;
|
||||
|
||||
return __blockdev_direct_IO(iocb, inode, inode->i_sb->s_bdev,
|
||||
iter, get_block,
|
||||
|
|
|
|||
|
|
@ -28,9 +28,6 @@
|
|||
|
||||
#include <linux/buffer_head.h>
|
||||
|
||||
void ocfs2_end_buffer_io_sync(struct buffer_head *bh,
|
||||
int uptodate);
|
||||
|
||||
int ocfs2_write_block(struct ocfs2_super *osb,
|
||||
struct buffer_head *bh,
|
||||
struct ocfs2_caching_info *ci);
|
||||
|
|
|
|||
|
|
@ -79,10 +79,8 @@ void o2hb_fill_node_map(unsigned long *map,
|
|||
unsigned bytes);
|
||||
void o2hb_exit(void);
|
||||
int o2hb_init(void);
|
||||
int o2hb_check_node_heartbeating(u8 node_num);
|
||||
int o2hb_check_node_heartbeating_no_sem(u8 node_num);
|
||||
int o2hb_check_node_heartbeating_from_callback(u8 node_num);
|
||||
int o2hb_check_local_node_heartbeating(void);
|
||||
void o2hb_stop_all_regions(void);
|
||||
int o2hb_get_all_regions(char *region_uuids, u8 numregions);
|
||||
int o2hb_global_heartbeat_active(void);
|
||||
|
|
|
|||
|
|
@ -40,6 +40,9 @@ char *o2nm_fence_method_desc[O2NM_FENCE_METHODS] = {
|
|||
"panic", /* O2NM_FENCE_PANIC */
|
||||
};
|
||||
|
||||
static inline void o2nm_lock_subsystem(void);
|
||||
static inline void o2nm_unlock_subsystem(void);
|
||||
|
||||
struct o2nm_node *o2nm_get_node_by_num(u8 node_num)
|
||||
{
|
||||
struct o2nm_node *node = NULL;
|
||||
|
|
@ -181,7 +184,10 @@ static struct o2nm_cluster *to_o2nm_cluster_from_node(struct o2nm_node *node)
|
|||
{
|
||||
/* through the first node_set .parent
|
||||
* mycluster/nodes/mynode == o2nm_cluster->o2nm_node_group->o2nm_node */
|
||||
return to_o2nm_cluster(node->nd_item.ci_parent->ci_parent);
|
||||
if (node->nd_item.ci_parent)
|
||||
return to_o2nm_cluster(node->nd_item.ci_parent->ci_parent);
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
enum {
|
||||
|
|
@ -194,7 +200,7 @@ static ssize_t o2nm_node_num_store(struct config_item *item, const char *page,
|
|||
size_t count)
|
||||
{
|
||||
struct o2nm_node *node = to_o2nm_node(item);
|
||||
struct o2nm_cluster *cluster = to_o2nm_cluster_from_node(node);
|
||||
struct o2nm_cluster *cluster;
|
||||
unsigned long tmp;
|
||||
char *p = (char *)page;
|
||||
int ret = 0;
|
||||
|
|
@ -214,6 +220,13 @@ static ssize_t o2nm_node_num_store(struct config_item *item, const char *page,
|
|||
!test_bit(O2NM_NODE_ATTR_PORT, &node->nd_set_attributes))
|
||||
return -EINVAL; /* XXX */
|
||||
|
||||
o2nm_lock_subsystem();
|
||||
cluster = to_o2nm_cluster_from_node(node);
|
||||
if (!cluster) {
|
||||
o2nm_unlock_subsystem();
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
write_lock(&cluster->cl_nodes_lock);
|
||||
if (cluster->cl_nodes[tmp])
|
||||
ret = -EEXIST;
|
||||
|
|
@ -226,6 +239,8 @@ static ssize_t o2nm_node_num_store(struct config_item *item, const char *page,
|
|||
set_bit(tmp, cluster->cl_nodes_bitmap);
|
||||
}
|
||||
write_unlock(&cluster->cl_nodes_lock);
|
||||
o2nm_unlock_subsystem();
|
||||
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
|
|
@ -269,7 +284,7 @@ static ssize_t o2nm_node_ipv4_address_store(struct config_item *item,
|
|||
size_t count)
|
||||
{
|
||||
struct o2nm_node *node = to_o2nm_node(item);
|
||||
struct o2nm_cluster *cluster = to_o2nm_cluster_from_node(node);
|
||||
struct o2nm_cluster *cluster;
|
||||
int ret, i;
|
||||
struct rb_node **p, *parent;
|
||||
unsigned int octets[4];
|
||||
|
|
@ -286,6 +301,13 @@ static ssize_t o2nm_node_ipv4_address_store(struct config_item *item,
|
|||
be32_add_cpu(&ipv4_addr, octets[i] << (i * 8));
|
||||
}
|
||||
|
||||
o2nm_lock_subsystem();
|
||||
cluster = to_o2nm_cluster_from_node(node);
|
||||
if (!cluster) {
|
||||
o2nm_unlock_subsystem();
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
ret = 0;
|
||||
write_lock(&cluster->cl_nodes_lock);
|
||||
if (o2nm_node_ip_tree_lookup(cluster, ipv4_addr, &p, &parent))
|
||||
|
|
@ -298,6 +320,8 @@ static ssize_t o2nm_node_ipv4_address_store(struct config_item *item,
|
|||
rb_insert_color(&node->nd_ip_node, &cluster->cl_node_ip_tree);
|
||||
}
|
||||
write_unlock(&cluster->cl_nodes_lock);
|
||||
o2nm_unlock_subsystem();
|
||||
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
|
|
@ -315,7 +339,7 @@ static ssize_t o2nm_node_local_store(struct config_item *item, const char *page,
|
|||
size_t count)
|
||||
{
|
||||
struct o2nm_node *node = to_o2nm_node(item);
|
||||
struct o2nm_cluster *cluster = to_o2nm_cluster_from_node(node);
|
||||
struct o2nm_cluster *cluster;
|
||||
unsigned long tmp;
|
||||
char *p = (char *)page;
|
||||
ssize_t ret;
|
||||
|
|
@ -333,17 +357,26 @@ static ssize_t o2nm_node_local_store(struct config_item *item, const char *page,
|
|||
!test_bit(O2NM_NODE_ATTR_PORT, &node->nd_set_attributes))
|
||||
return -EINVAL; /* XXX */
|
||||
|
||||
o2nm_lock_subsystem();
|
||||
cluster = to_o2nm_cluster_from_node(node);
|
||||
if (!cluster) {
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* the only failure case is trying to set a new local node
|
||||
* when a different one is already set */
|
||||
if (tmp && tmp == cluster->cl_has_local &&
|
||||
cluster->cl_local_node != node->nd_num)
|
||||
return -EBUSY;
|
||||
cluster->cl_local_node != node->nd_num) {
|
||||
ret = -EBUSY;
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* bring up the rx thread if we're setting the new local node. */
|
||||
if (tmp && !cluster->cl_has_local) {
|
||||
ret = o2net_start_listening(node);
|
||||
if (ret)
|
||||
return ret;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (!tmp && cluster->cl_has_local &&
|
||||
|
|
@ -358,7 +391,11 @@ static ssize_t o2nm_node_local_store(struct config_item *item, const char *page,
|
|||
cluster->cl_local_node = node->nd_num;
|
||||
}
|
||||
|
||||
return count;
|
||||
ret = count;
|
||||
|
||||
out:
|
||||
o2nm_unlock_subsystem();
|
||||
return ret;
|
||||
}
|
||||
|
||||
CONFIGFS_ATTR(o2nm_node_, num);
|
||||
|
|
@ -738,6 +775,16 @@ static struct o2nm_cluster_group o2nm_cluster_group = {
|
|||
},
|
||||
};
|
||||
|
||||
static inline void o2nm_lock_subsystem(void)
|
||||
{
|
||||
mutex_lock(&o2nm_cluster_group.cs_subsys.su_mutex);
|
||||
}
|
||||
|
||||
static inline void o2nm_unlock_subsystem(void)
|
||||
{
|
||||
mutex_unlock(&o2nm_cluster_group.cs_subsys.su_mutex);
|
||||
}
|
||||
|
||||
int o2nm_depend_item(struct config_item *item)
|
||||
{
|
||||
return configfs_depend_item(&o2nm_cluster_group.cs_subsys, item);
|
||||
|
|
|
|||
|
|
@ -394,7 +394,6 @@ int dlm_domain_fully_joined(struct dlm_ctxt *dlm)
|
|||
static void dlm_destroy_dlm_worker(struct dlm_ctxt *dlm)
|
||||
{
|
||||
if (dlm->dlm_worker) {
|
||||
flush_workqueue(dlm->dlm_worker);
|
||||
destroy_workqueue(dlm->dlm_worker);
|
||||
dlm->dlm_worker = NULL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2616,7 +2616,9 @@ static int dlm_migrate_lockres(struct dlm_ctxt *dlm,
|
|||
* otherwise the assert_master from the new
|
||||
* master will destroy this.
|
||||
*/
|
||||
dlm_get_mle_inuse(mle);
|
||||
if (ret != -EEXIST)
|
||||
dlm_get_mle_inuse(mle);
|
||||
|
||||
spin_unlock(&dlm->master_lock);
|
||||
spin_unlock(&dlm->spinlock);
|
||||
|
||||
|
|
|
|||
|
|
@ -2419,6 +2419,7 @@ static void dlm_do_local_recovery_cleanup(struct dlm_ctxt *dlm, u8 dead_node)
|
|||
dlm_lockres_put(res);
|
||||
continue;
|
||||
}
|
||||
dlm_move_lockres_to_recovery_list(dlm, res);
|
||||
} else if (res->owner == dlm->node_num) {
|
||||
dlm_free_dead_locks(dlm, res, dead_node);
|
||||
__dlm_lockres_calc_usage(dlm, res);
|
||||
|
|
|
|||
|
|
@ -670,7 +670,6 @@ static void __exit exit_dlmfs_fs(void)
|
|||
{
|
||||
unregister_filesystem(&dlmfs_fs_type);
|
||||
|
||||
flush_workqueue(user_dlm_worker);
|
||||
destroy_workqueue(user_dlm_worker);
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -1161,6 +1161,13 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr)
|
|||
}
|
||||
size_change = S_ISREG(inode->i_mode) && attr->ia_valid & ATTR_SIZE;
|
||||
if (size_change) {
|
||||
/*
|
||||
* Here we should wait dio to finish before inode lock
|
||||
* to avoid a deadlock between ocfs2_setattr() and
|
||||
* ocfs2_dio_end_io_write()
|
||||
*/
|
||||
inode_dio_wait(inode);
|
||||
|
||||
status = ocfs2_rw_lock(inode, 1);
|
||||
if (status < 0) {
|
||||
mlog_errno(status);
|
||||
|
|
@ -1200,8 +1207,6 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr)
|
|||
if (status)
|
||||
goto bail_unlock;
|
||||
|
||||
inode_dio_wait(inode);
|
||||
|
||||
if (i_size_read(inode) >= attr->ia_size) {
|
||||
if (ocfs2_should_order_data(inode)) {
|
||||
status = ocfs2_begin_ordered_truncate(inode,
|
||||
|
|
|
|||
|
|
@ -1147,12 +1147,9 @@ int ocfs2_reserve_cluster_bitmap_bits(struct ocfs2_super *osb,
|
|||
GLOBAL_BITMAP_SYSTEM_INODE,
|
||||
OCFS2_INVALID_SLOT, NULL,
|
||||
ALLOC_NEW_GROUP);
|
||||
if (status < 0 && status != -ENOSPC) {
|
||||
if (status < 0 && status != -ENOSPC)
|
||||
mlog_errno(status);
|
||||
goto bail;
|
||||
}
|
||||
|
||||
bail:
|
||||
return status;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2521,10 +2521,8 @@ static void ocfs2_delete_osb(struct ocfs2_super *osb)
|
|||
/* This function assumes that the caller has the main osb resource */
|
||||
|
||||
/* ocfs2_initializer_super have already created this workqueue */
|
||||
if (osb->ocfs2_wq) {
|
||||
flush_workqueue(osb->ocfs2_wq);
|
||||
if (osb->ocfs2_wq)
|
||||
destroy_workqueue(osb->ocfs2_wq);
|
||||
}
|
||||
|
||||
ocfs2_free_slot_info(osb);
|
||||
|
||||
|
|
|
|||
|
|
@ -26,9 +26,6 @@
|
|||
#ifndef OCFS2_SUPER_H
|
||||
#define OCFS2_SUPER_H
|
||||
|
||||
int ocfs2_publish_get_mount_state(struct ocfs2_super *osb,
|
||||
int node_num);
|
||||
|
||||
__printf(3, 4)
|
||||
int __ocfs2_error(struct super_block *sb, const char *function,
|
||||
const char *fmt, ...);
|
||||
|
|
|
|||
Loading…
Reference in a new issue