projects
/
cascardo
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ARM: dts: dm816x: Fix NAND device nodes
[cascardo/linux.git]
/
mm
/
swapfile.c
diff --git
a/mm/swapfile.c
b/mm/swapfile.c
index
2bb30aa
..
d2c3736
100644
(file)
--- a/
mm/swapfile.c
+++ b/
mm/swapfile.c
@@
-785,14
+785,12
@@
static unsigned char swap_entry_free(struct swap_info_struct *p,
count--;
}
count--;
}
- if (!count)
- mem_cgroup_uncharge_swap(entry);
-
usage = count | has_cache;
p->swap_map[offset] = usage;
/* free if no reference */
if (!usage) {
usage = count | has_cache;
p->swap_map[offset] = usage;
/* free if no reference */
if (!usage) {
+ mem_cgroup_uncharge_swap(entry);
dec_cluster_info_page(p, p->cluster_info, offset);
if (offset < p->lowest_bit)
p->lowest_bit = offset;
dec_cluster_info_page(p, p->cluster_info, offset);
if (offset < p->lowest_bit)
p->lowest_bit = offset;
@@
-1008,7
+1006,7
@@
int free_swap_and_cache(swp_entry_t entry)
* Also recheck PageSwapCache now page is locked (above).
*/
if (PageSwapCache(page) && !PageWriteback(page) &&
* Also recheck PageSwapCache now page is locked (above).
*/
if (PageSwapCache(page) && !PageWriteback(page) &&
-
(!page_mapped(page) || vm_swap_full(
))) {
+
(!page_mapped(page) || mem_cgroup_swap_full(page
))) {
delete_from_swap_cache(page);
SetPageDirty(page);
}
delete_from_swap_cache(page);
SetPageDirty(page);
}
@@
-1958,9
+1956,9
@@
SYSCALL_DEFINE1(swapoff, const char __user *, specialfile)
set_blocksize(bdev, old_block_size);
blkdev_put(bdev, FMODE_READ | FMODE_WRITE | FMODE_EXCL);
} else {
set_blocksize(bdev, old_block_size);
blkdev_put(bdev, FMODE_READ | FMODE_WRITE | FMODE_EXCL);
} else {
-
mutex_lock(&inode->i_mutex
);
+
inode_lock(inode
);
inode->i_flags &= ~S_SWAPFILE;
inode->i_flags &= ~S_SWAPFILE;
-
mutex_unlock(&inode->i_mutex
);
+
inode_unlock(inode
);
}
filp_close(swap_file, NULL);
}
filp_close(swap_file, NULL);
@@
-2185,7
+2183,7
@@
static int claim_swapfile(struct swap_info_struct *p, struct inode *inode)
p->flags |= SWP_BLKDEV;
} else if (S_ISREG(inode->i_mode)) {
p->bdev = inode->i_sb->s_bdev;
p->flags |= SWP_BLKDEV;
} else if (S_ISREG(inode->i_mode)) {
p->bdev = inode->i_sb->s_bdev;
-
mutex_lock(&inode->i_mutex
);
+
inode_lock(inode
);
if (IS_SWAPFILE(inode))
return -EBUSY;
} else
if (IS_SWAPFILE(inode))
return -EBUSY;
} else
@@
-2418,7
+2416,7
@@
SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags)
mapping = swap_file->f_mapping;
inode = mapping->host;
mapping = swap_file->f_mapping;
inode = mapping->host;
- /* If S_ISREG(inode->i_mode) will do
mutex_lock(&inode->i_mutex
); */
+ /* If S_ISREG(inode->i_mode) will do
inode_lock(inode
); */
error = claim_swapfile(p, inode);
if (unlikely(error))
goto bad_swap;
error = claim_swapfile(p, inode);
if (unlikely(error))
goto bad_swap;
@@
-2563,7
+2561,7
@@
bad_swap:
vfree(cluster_info);
if (swap_file) {
if (inode && S_ISREG(inode->i_mode)) {
vfree(cluster_info);
if (swap_file) {
if (inode && S_ISREG(inode->i_mode)) {
-
mutex_unlock(&inode->i_mutex
);
+
inode_unlock(inode
);
inode = NULL;
}
filp_close(swap_file, NULL);
inode = NULL;
}
filp_close(swap_file, NULL);
@@
-2576,7
+2574,7
@@
out:
if (name)
putname(name);
if (inode && S_ISREG(inode->i_mode))
if (name)
putname(name);
if (inode && S_ISREG(inode->i_mode))
-
mutex_unlock(&inode->i_mutex
);
+
inode_unlock(inode
);
return error;
}
return error;
}