mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 09:36:22 +02:00
Merge patch series "fs: replace __get_free_pages() call with kmalloc()"
Mike Rapoport (Microsoft) <rppt@kernel.org> says: This is a (small) part of larger work of replacing page allocator calls with kmalloc. * patches from https://patch.msgid.link/20260523-b4-fs-v1-0-275e36a83f0e@kernel.org: bfs: replace get_zeroed_page() with kzalloc() binfmt_misc: replace __get_free_page() with kmalloc() configfs: replace __get_free_pages() with kzalloc() fs/namespace: use __getname() to allocate mntpath buffer fs/select: replace __get_free_page() with kmalloc() fuse: replace __get_free_page() with kmalloc() isofs: replace __get_free_page() with kmalloc() jbd2: replace __get_free_pages() with kmalloc() jfs: replace __get_free_page() with kmalloc() libfs: simple_transaction_get(): replace get_zeroed_page() with kzalloc() NFSD: replace __get_free_page() with kmalloc() in nfsd_buffered_readdir() NFS: remove unused page and page2 in nfs4_replace_transport() NFS: replace __get_free_page() with kmalloc() in nfs_show_devname() nilfs2: replace get_zeroed_page() with kzalloc() ocfs2/dlm: replace __get_free_page() with kmalloc() proc: replace __get_free_page() with kmalloc() quota: allocate dquot_hash with kmalloc() Link: https://patch.msgid.link/20260523-b4-fs-v1-0-275e36a83f0e@kernel.org Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
This commit is contained in:
commit
cfe724c85f
|
|
@ -311,7 +311,7 @@ void bfs_dump_imap(const char *prefix, struct super_block *s)
|
|||
{
|
||||
#ifdef DEBUG
|
||||
int i;
|
||||
char *tmpbuf = (char *)get_zeroed_page(GFP_KERNEL);
|
||||
char *tmpbuf = kzalloc(PAGE_SIZE, GFP_KERNEL);
|
||||
|
||||
if (!tmpbuf)
|
||||
return;
|
||||
|
|
@ -323,7 +323,7 @@ void bfs_dump_imap(const char *prefix, struct super_block *s)
|
|||
strcat(tmpbuf, "0");
|
||||
}
|
||||
printf("%s: lasti=%08lx <%s>\n", prefix, BFS_SB(s)->si_lasti, tmpbuf);
|
||||
free_page((unsigned long)tmpbuf);
|
||||
kfree(tmpbuf);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -704,7 +704,7 @@ bm_entry_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos)
|
|||
ssize_t res;
|
||||
char *page;
|
||||
|
||||
page = (char *) __get_free_page(GFP_KERNEL);
|
||||
page = kmalloc(PAGE_SIZE, GFP_KERNEL);
|
||||
if (!page)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
@ -712,7 +712,7 @@ bm_entry_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos)
|
|||
|
||||
res = simple_read_from_buffer(buf, nbytes, ppos, page, strlen(page));
|
||||
|
||||
free_page((unsigned long) page);
|
||||
kfree(page);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ static int fill_read_buffer(struct file *file, struct configfs_buffer *buffer)
|
|||
ssize_t count = -ENOENT;
|
||||
|
||||
if (!buffer->page)
|
||||
buffer->page = (char *) get_zeroed_page(GFP_KERNEL);
|
||||
buffer->page = kzalloc(PAGE_SIZE, GFP_KERNEL);
|
||||
if (!buffer->page)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
@ -184,7 +184,7 @@ static int fill_write_buffer(struct configfs_buffer *buffer,
|
|||
int copied;
|
||||
|
||||
if (!buffer->page)
|
||||
buffer->page = (char *)__get_free_pages(GFP_KERNEL, 0);
|
||||
buffer->page = kmalloc(PAGE_SIZE, GFP_KERNEL);
|
||||
if (!buffer->page)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
@ -381,8 +381,7 @@ static int configfs_release(struct inode *inode, struct file *filp)
|
|||
struct configfs_buffer *buffer = filp->private_data;
|
||||
|
||||
module_put(buffer->owner);
|
||||
if (buffer->page)
|
||||
free_page((unsigned long)buffer->page);
|
||||
kfree(buffer->page);
|
||||
mutex_destroy(&buffer->mutex);
|
||||
kfree(buffer);
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
#include <linux/fileattr.h>
|
||||
#include <linux/fsverity.h>
|
||||
|
||||
#include <linux/slab.h>
|
||||
#define FUSE_VERITY_ENABLE_ARG_MAX_PAGES 256
|
||||
|
||||
static ssize_t fuse_send_ioctl(struct fuse_mount *fm, struct fuse_args *args,
|
||||
|
|
@ -252,7 +253,7 @@ long fuse_do_ioctl(struct file *file, unsigned int cmd, unsigned long arg,
|
|||
|
||||
err = -ENOMEM;
|
||||
ap.folios = fuse_folios_alloc(fm->fc->max_pages, GFP_KERNEL, &ap.descs);
|
||||
iov_page = (struct iovec *) __get_free_page(GFP_KERNEL);
|
||||
iov_page = kmalloc(PAGE_SIZE, GFP_KERNEL);
|
||||
if (!ap.folios || !iov_page)
|
||||
goto out;
|
||||
|
||||
|
|
@ -400,7 +401,7 @@ long fuse_do_ioctl(struct file *file, unsigned int cmd, unsigned long arg,
|
|||
}
|
||||
err = 0;
|
||||
out:
|
||||
free_page((unsigned long) iov_page);
|
||||
kfree(iov_page);
|
||||
while (ap.num_folios)
|
||||
folio_put(ap.folios[--ap.num_folios]);
|
||||
kfree(ap.folios);
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@
|
|||
*/
|
||||
#include <linux/gfp.h>
|
||||
#include <linux/filelock.h>
|
||||
#include <linux/slab.h>
|
||||
#include "isofs.h"
|
||||
|
||||
int isofs_name_translate(struct iso_directory_record *de, char *new, struct inode *inode)
|
||||
|
|
@ -255,7 +256,7 @@ static int isofs_readdir(struct file *file, struct dir_context *ctx)
|
|||
struct iso_directory_record *tmpde;
|
||||
struct inode *inode = file_inode(file);
|
||||
|
||||
tmpname = (char *)__get_free_page(GFP_KERNEL);
|
||||
tmpname = kmalloc(PAGE_SIZE, GFP_KERNEL);
|
||||
if (tmpname == NULL)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
@ -263,7 +264,7 @@ static int isofs_readdir(struct file *file, struct dir_context *ctx)
|
|||
|
||||
result = do_isofs_readdir(inode, file, ctx, tmpname, tmpde);
|
||||
|
||||
free_page((unsigned long) tmpname);
|
||||
kfree(tmpname);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2784,7 +2784,7 @@ void *jbd2_alloc(size_t size, gfp_t flags)
|
|||
if (size < PAGE_SIZE)
|
||||
ptr = kmem_cache_alloc(get_slab(size), flags);
|
||||
else
|
||||
ptr = (void *)__get_free_pages(flags, get_order(size));
|
||||
ptr = kmalloc(size, flags);
|
||||
|
||||
/* Check alignment; SLUB has gotten this wrong in the past,
|
||||
* and this can lead to user data corruption! */
|
||||
|
|
@ -2795,10 +2795,7 @@ void *jbd2_alloc(size_t size, gfp_t flags)
|
|||
|
||||
void jbd2_free(void *ptr, size_t size)
|
||||
{
|
||||
if (size < PAGE_SIZE)
|
||||
kmem_cache_free(get_slab(size), ptr);
|
||||
else
|
||||
free_pages((unsigned long)ptr, get_order(size));
|
||||
kfree(ptr);
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -2729,7 +2729,7 @@ int jfs_readdir(struct file *file, struct dir_context *ctx)
|
|||
struct ldtentry *d;
|
||||
struct dtslot *t;
|
||||
int d_namleft, len, outlen;
|
||||
unsigned long dirent_buf;
|
||||
void *dirent_buf;
|
||||
char *name_ptr;
|
||||
u32 dir_index;
|
||||
int do_index = 0;
|
||||
|
|
@ -2884,7 +2884,7 @@ int jfs_readdir(struct file *file, struct dir_context *ctx)
|
|||
}
|
||||
}
|
||||
|
||||
dirent_buf = __get_free_page(GFP_KERNEL);
|
||||
dirent_buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
|
||||
if (dirent_buf == 0) {
|
||||
DT_PUTPAGE(mp);
|
||||
jfs_warn("jfs_readdir: __get_free_page failed!");
|
||||
|
|
@ -2893,7 +2893,7 @@ int jfs_readdir(struct file *file, struct dir_context *ctx)
|
|||
}
|
||||
|
||||
while (1) {
|
||||
jfs_dirent = (struct jfs_dirent *) dirent_buf;
|
||||
jfs_dirent = dirent_buf;
|
||||
jfs_dirents = 0;
|
||||
overflow = fix_page = 0;
|
||||
|
||||
|
|
@ -2903,7 +2903,7 @@ int jfs_readdir(struct file *file, struct dir_context *ctx)
|
|||
if (stbl[i] < 0) {
|
||||
jfs_err("JFS: Invalid stbl[%d] = %d for inode %ld, block = %lld",
|
||||
i, stbl[i], (long)ip->i_ino, (long long)bn);
|
||||
free_page(dirent_buf);
|
||||
kfree(dirent_buf);
|
||||
DT_PUTPAGE(mp);
|
||||
return -EIO;
|
||||
}
|
||||
|
|
@ -2911,7 +2911,7 @@ int jfs_readdir(struct file *file, struct dir_context *ctx)
|
|||
d = (struct ldtentry *) & p->slot[stbl[i]];
|
||||
|
||||
if (((long) jfs_dirent + d->namlen + 1) >
|
||||
(dirent_buf + PAGE_SIZE)) {
|
||||
((long)dirent_buf + PAGE_SIZE)) {
|
||||
/* DBCS codepages could overrun dirent_buf */
|
||||
index = i;
|
||||
overflow = 1;
|
||||
|
|
@ -3014,7 +3014,7 @@ int jfs_readdir(struct file *file, struct dir_context *ctx)
|
|||
/* unpin previous leaf page */
|
||||
DT_PUTPAGE(mp);
|
||||
|
||||
jfs_dirent = (struct jfs_dirent *) dirent_buf;
|
||||
jfs_dirent = dirent_buf;
|
||||
while (jfs_dirents--) {
|
||||
ctx->pos = jfs_dirent->position;
|
||||
if (!dir_emit(ctx, jfs_dirent->name,
|
||||
|
|
@ -3037,13 +3037,13 @@ int jfs_readdir(struct file *file, struct dir_context *ctx)
|
|||
|
||||
DT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
|
||||
if (rc) {
|
||||
free_page(dirent_buf);
|
||||
kfree(dirent_buf);
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
|
||||
out:
|
||||
free_page(dirent_buf);
|
||||
kfree(dirent_buf);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1258,7 +1258,7 @@ char *simple_transaction_get(struct file *file, const char __user *buf, size_t s
|
|||
if (size > SIMPLE_TRANSACTION_LIMIT - 1)
|
||||
return ERR_PTR(-EFBIG);
|
||||
|
||||
ar = (struct simple_transaction_argresp *)get_zeroed_page(GFP_KERNEL);
|
||||
ar = kzalloc(PAGE_SIZE, GFP_KERNEL);
|
||||
if (!ar)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
|
|
@ -1267,7 +1267,7 @@ char *simple_transaction_get(struct file *file, const char __user *buf, size_t s
|
|||
/* only one write allowed per open */
|
||||
if (file->private_data) {
|
||||
spin_unlock(&simple_transaction_lock);
|
||||
free_page((unsigned long)ar);
|
||||
kfree(ar);
|
||||
return ERR_PTR(-EBUSY);
|
||||
}
|
||||
|
||||
|
|
@ -1294,7 +1294,7 @@ EXPORT_SYMBOL(simple_transaction_read);
|
|||
|
||||
int simple_transaction_release(struct inode *inode, struct file *file)
|
||||
{
|
||||
free_page((unsigned long)file->private_data);
|
||||
kfree(file->private_data);
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(simple_transaction_release);
|
||||
|
|
|
|||
|
|
@ -3303,9 +3303,9 @@ static void mnt_warn_timestamp_expiry(const struct path *mountpoint,
|
|||
(ktime_get_real_seconds() + TIME_UPTIME_SEC_MAX > sb->s_time_max)) {
|
||||
char *buf, *mntpath;
|
||||
|
||||
buf = (char *)__get_free_page(GFP_KERNEL);
|
||||
buf = __getname();
|
||||
if (buf)
|
||||
mntpath = d_path(mountpoint, buf, PAGE_SIZE);
|
||||
mntpath = d_path(mountpoint, buf, PATH_MAX);
|
||||
else
|
||||
mntpath = ERR_PTR(-ENOMEM);
|
||||
if (IS_ERR(mntpath))
|
||||
|
|
@ -3318,8 +3318,7 @@ static void mnt_warn_timestamp_expiry(const struct path *mountpoint,
|
|||
(unsigned long long)sb->s_time_max);
|
||||
|
||||
sb->s_iflags |= SB_I_TS_EXPIRY_WARNED;
|
||||
if (buf)
|
||||
free_page((unsigned long)buf);
|
||||
__putname(buf);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -481,7 +481,6 @@ int nfs4_submount(struct fs_context *fc, struct nfs_server *server)
|
|||
* Returns zero on success, or a negative errno value.
|
||||
*/
|
||||
static int nfs4_try_replacing_one_location(struct nfs_server *server,
|
||||
char *page, char *page2,
|
||||
const struct nfs4_fs_location *location)
|
||||
{
|
||||
struct net *net = rpc_net_ns(server->client);
|
||||
|
|
@ -541,21 +540,12 @@ static int nfs4_try_replacing_one_location(struct nfs_server *server,
|
|||
int nfs4_replace_transport(struct nfs_server *server,
|
||||
const struct nfs4_fs_locations *locations)
|
||||
{
|
||||
char *page = NULL, *page2 = NULL;
|
||||
int loc, error;
|
||||
|
||||
error = -ENOENT;
|
||||
if (locations == NULL || locations->nlocations <= 0)
|
||||
goto out;
|
||||
|
||||
error = -ENOMEM;
|
||||
page = (char *) __get_free_page(GFP_USER);
|
||||
if (!page)
|
||||
goto out;
|
||||
page2 = (char *) __get_free_page(GFP_USER);
|
||||
if (!page2)
|
||||
goto out;
|
||||
|
||||
for (loc = 0; loc < locations->nlocations; loc++) {
|
||||
const struct nfs4_fs_location *location =
|
||||
&locations->locations[loc];
|
||||
|
|
@ -564,14 +554,11 @@ int nfs4_replace_transport(struct nfs_server *server,
|
|||
location->rootpath.ncomponents == 0)
|
||||
continue;
|
||||
|
||||
error = nfs4_try_replacing_one_location(server, page,
|
||||
page2, location);
|
||||
error = nfs4_try_replacing_one_location(server, location);
|
||||
if (error == 0)
|
||||
break;
|
||||
}
|
||||
|
||||
out:
|
||||
free_page((unsigned long)page);
|
||||
free_page((unsigned long)page2);
|
||||
return error;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -623,7 +623,7 @@ static void show_implementation_id(struct seq_file *m, struct nfs_server *nfss)
|
|||
|
||||
int nfs_show_devname(struct seq_file *m, struct dentry *root)
|
||||
{
|
||||
char *page = (char *) __get_free_page(GFP_KERNEL);
|
||||
char *page = kmalloc(PAGE_SIZE, GFP_KERNEL);
|
||||
char *devname, *dummy;
|
||||
int err = 0;
|
||||
if (!page)
|
||||
|
|
@ -633,7 +633,7 @@ int nfs_show_devname(struct seq_file *m, struct dentry *root)
|
|||
err = PTR_ERR(devname);
|
||||
else
|
||||
seq_escape(m, devname, " \t\n\\");
|
||||
free_page((unsigned long)page);
|
||||
kfree(page);
|
||||
return err;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(nfs_show_devname);
|
||||
|
|
|
|||
|
|
@ -2407,7 +2407,7 @@ static __be32 nfsd_buffered_readdir(struct file *file, struct svc_fh *fhp,
|
|||
loff_t offset;
|
||||
struct readdir_data buf = {
|
||||
.ctx.actor = nfsd_buffered_filldir,
|
||||
.dirent = (void *)__get_free_page(GFP_KERNEL)
|
||||
.dirent = kmalloc(PAGE_SIZE, GFP_KERNEL)
|
||||
};
|
||||
|
||||
if (!buf.dirent)
|
||||
|
|
@ -2458,7 +2458,7 @@ static __be32 nfsd_buffered_readdir(struct file *file, struct svc_fh *fhp,
|
|||
offset = vfs_llseek(file, 0, SEEK_CUR);
|
||||
}
|
||||
|
||||
free_page((unsigned long)(buf.dirent));
|
||||
kfree((buf.dirent));
|
||||
|
||||
if (host_err)
|
||||
return nfserrno(host_err);
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ static int nilfs_ioctl_wrap_copy(struct the_nilfs *nilfs,
|
|||
if (argv->v_index > ~(__u64)0 - argv->v_nmembs)
|
||||
return -EINVAL;
|
||||
|
||||
buf = (void *)get_zeroed_page(GFP_NOFS);
|
||||
buf = kzalloc(PAGE_SIZE, GFP_NOFS);
|
||||
if (unlikely(!buf))
|
||||
return -ENOMEM;
|
||||
maxmembs = PAGE_SIZE / argv->v_size;
|
||||
|
|
@ -107,7 +107,7 @@ static int nilfs_ioctl_wrap_copy(struct the_nilfs *nilfs,
|
|||
}
|
||||
argv->v_nmembs = total;
|
||||
|
||||
free_pages((unsigned long)buf, 0);
|
||||
kfree(buf);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -260,10 +260,10 @@ void dlm_print_one_mle(struct dlm_master_list_entry *mle)
|
|||
{
|
||||
char *buf;
|
||||
|
||||
buf = (char *) get_zeroed_page(GFP_ATOMIC);
|
||||
buf = kzalloc(PAGE_SIZE, GFP_ATOMIC);
|
||||
if (buf) {
|
||||
dump_mle(mle, buf, PAGE_SIZE - 1);
|
||||
free_page((unsigned long)buf);
|
||||
kfree(buf);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -280,7 +280,7 @@ static struct dentry *dlm_debugfs_root;
|
|||
/* begin - utils funcs */
|
||||
static int debug_release(struct inode *inode, struct file *file)
|
||||
{
|
||||
free_page((unsigned long)file->private_data);
|
||||
kfree(file->private_data);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -327,17 +327,15 @@ static int debug_purgelist_open(struct inode *inode, struct file *file)
|
|||
struct dlm_ctxt *dlm = inode->i_private;
|
||||
char *buf = NULL;
|
||||
|
||||
buf = (char *) get_zeroed_page(GFP_NOFS);
|
||||
buf = kzalloc(PAGE_SIZE, GFP_NOFS);
|
||||
if (!buf)
|
||||
goto bail;
|
||||
return -ENOMEM;
|
||||
|
||||
i_size_write(inode, debug_purgelist_print(dlm, buf, PAGE_SIZE - 1));
|
||||
|
||||
file->private_data = buf;
|
||||
|
||||
return 0;
|
||||
bail:
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
static const struct file_operations debug_purgelist_fops = {
|
||||
|
|
@ -384,17 +382,15 @@ static int debug_mle_open(struct inode *inode, struct file *file)
|
|||
struct dlm_ctxt *dlm = inode->i_private;
|
||||
char *buf = NULL;
|
||||
|
||||
buf = (char *) get_zeroed_page(GFP_NOFS);
|
||||
buf = kzalloc(PAGE_SIZE, GFP_NOFS);
|
||||
if (!buf)
|
||||
goto bail;
|
||||
return -ENOMEM;
|
||||
|
||||
i_size_write(inode, debug_mle_print(dlm, buf, PAGE_SIZE - 1));
|
||||
|
||||
file->private_data = buf;
|
||||
|
||||
return 0;
|
||||
bail:
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
static const struct file_operations debug_mle_fops = {
|
||||
|
|
@ -775,17 +771,15 @@ static int debug_state_open(struct inode *inode, struct file *file)
|
|||
struct dlm_ctxt *dlm = inode->i_private;
|
||||
char *buf = NULL;
|
||||
|
||||
buf = (char *) get_zeroed_page(GFP_NOFS);
|
||||
buf = kzalloc(PAGE_SIZE, GFP_NOFS);
|
||||
if (!buf)
|
||||
goto bail;
|
||||
return -ENOMEM;
|
||||
|
||||
i_size_write(inode, debug_state_print(dlm, buf, PAGE_SIZE - 1));
|
||||
|
||||
file->private_data = buf;
|
||||
|
||||
return 0;
|
||||
bail:
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
static const struct file_operations debug_state_fops = {
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ static inline void byte_copymap(u8 dmap[], unsigned long smap[],
|
|||
static void dlm_free_pagevec(void **vec, int pages)
|
||||
{
|
||||
while (pages--)
|
||||
free_page((unsigned long)vec[pages]);
|
||||
kfree(vec[pages]);
|
||||
kfree(vec);
|
||||
}
|
||||
|
||||
|
|
@ -75,9 +75,11 @@ static void **dlm_alloc_pagevec(int pages)
|
|||
if (!vec)
|
||||
return NULL;
|
||||
|
||||
for (i = 0; i < pages; i++)
|
||||
if (!(vec[i] = (void *)__get_free_page(GFP_KERNEL)))
|
||||
for (i = 0; i < pages; i++) {
|
||||
vec[i] = kmalloc(PAGE_SIZE, GFP_KERNEL);
|
||||
if (!vec[i])
|
||||
goto out_free;
|
||||
}
|
||||
|
||||
mlog(0, "Allocated DLM hash pagevec; %d pages (%lu expected), %lu buckets per page\n",
|
||||
pages, (unsigned long)DLM_HASH_PAGES,
|
||||
|
|
|
|||
|
|
@ -2548,7 +2548,7 @@ static int dlm_migrate_lockres(struct dlm_ctxt *dlm,
|
|||
|
||||
/* preallocate up front. if this fails, abort */
|
||||
ret = -ENOMEM;
|
||||
mres = (struct dlm_migratable_lockres *) __get_free_page(GFP_NOFS);
|
||||
mres = kmalloc(PAGE_SIZE, GFP_NOFS);
|
||||
if (!mres) {
|
||||
mlog_errno(ret);
|
||||
goto leave;
|
||||
|
|
@ -2725,8 +2725,7 @@ static int dlm_migrate_lockres(struct dlm_ctxt *dlm,
|
|||
if (wake)
|
||||
wake_up(&res->wq);
|
||||
|
||||
if (mres)
|
||||
free_page((unsigned long)mres);
|
||||
kfree(mres);
|
||||
|
||||
dlm_put(dlm);
|
||||
|
||||
|
|
|
|||
|
|
@ -837,7 +837,7 @@ int dlm_request_all_locks_handler(struct o2net_msg *msg, u32 len, void *data,
|
|||
}
|
||||
|
||||
/* this will get freed by dlm_request_all_locks_worker */
|
||||
buf = (char *) __get_free_page(GFP_NOFS);
|
||||
buf = kmalloc(PAGE_SIZE, GFP_NOFS);
|
||||
if (!buf) {
|
||||
kfree(item);
|
||||
dlm_put(dlm);
|
||||
|
|
@ -933,7 +933,7 @@ static void dlm_request_all_locks_worker(struct dlm_work_item *item, void *data)
|
|||
}
|
||||
}
|
||||
leave:
|
||||
free_page((unsigned long)data);
|
||||
kfree(data);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -261,7 +261,7 @@ static ssize_t get_mm_proctitle(struct mm_struct *mm, char __user *buf,
|
|||
if (pos >= PAGE_SIZE)
|
||||
return 0;
|
||||
|
||||
page = (char *)__get_free_page(GFP_KERNEL);
|
||||
page = kmalloc(PAGE_SIZE, GFP_KERNEL);
|
||||
if (!page)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
@ -284,7 +284,7 @@ static ssize_t get_mm_proctitle(struct mm_struct *mm, char __user *buf,
|
|||
ret = len;
|
||||
}
|
||||
}
|
||||
free_page((unsigned long)page);
|
||||
kfree(page);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -347,7 +347,7 @@ static ssize_t get_mm_cmdline(struct mm_struct *mm, char __user *buf,
|
|||
if (count > arg_end - pos)
|
||||
count = arg_end - pos;
|
||||
|
||||
page = (char *)__get_free_page(GFP_KERNEL);
|
||||
page = kmalloc(PAGE_SIZE, GFP_KERNEL);
|
||||
if (!page)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
@ -371,7 +371,7 @@ static ssize_t get_mm_cmdline(struct mm_struct *mm, char __user *buf,
|
|||
count -= got;
|
||||
}
|
||||
|
||||
free_page((unsigned long)page);
|
||||
kfree(page);
|
||||
return len;
|
||||
}
|
||||
|
||||
|
|
@ -908,7 +908,7 @@ static ssize_t mem_rw(struct file *file, char __user *buf,
|
|||
if (!mm)
|
||||
return 0;
|
||||
|
||||
page = (char *)__get_free_page(GFP_KERNEL);
|
||||
page = kmalloc(PAGE_SIZE, GFP_KERNEL);
|
||||
if (!page)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
@ -949,7 +949,7 @@ static ssize_t mem_rw(struct file *file, char __user *buf,
|
|||
|
||||
mmput(mm);
|
||||
free:
|
||||
free_page((unsigned long) page);
|
||||
kfree(page);
|
||||
return copied;
|
||||
}
|
||||
|
||||
|
|
@ -1016,7 +1016,7 @@ static ssize_t environ_read(struct file *file, char __user *buf,
|
|||
if (!mm || !mm->env_end)
|
||||
return 0;
|
||||
|
||||
page = (char *)__get_free_page(GFP_KERNEL);
|
||||
page = kmalloc(PAGE_SIZE, GFP_KERNEL);
|
||||
if (!page)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
@ -1062,7 +1062,7 @@ static ssize_t environ_read(struct file *file, char __user *buf,
|
|||
mmput(mm);
|
||||
|
||||
free:
|
||||
free_page((unsigned long) page);
|
||||
kfree(page);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3022,7 +3022,7 @@ static const struct ctl_table fs_dqstats_table[] = {
|
|||
static int __init dquot_init(void)
|
||||
{
|
||||
int i, ret;
|
||||
unsigned long nr_hash, order;
|
||||
unsigned long nr_hash;
|
||||
struct shrinker *dqcache_shrinker;
|
||||
|
||||
printk(KERN_NOTICE "VFS: Disk quotas %s\n", __DQUOT_VERSION__);
|
||||
|
|
@ -3035,8 +3035,7 @@ static int __init dquot_init(void)
|
|||
SLAB_PANIC),
|
||||
NULL);
|
||||
|
||||
order = 0;
|
||||
dquot_hash = (struct hlist_head *)__get_free_pages(GFP_KERNEL, order);
|
||||
dquot_hash = kmalloc(PAGE_SIZE, GFP_KERNEL);
|
||||
if (!dquot_hash)
|
||||
panic("Cannot create dquot hash table");
|
||||
|
||||
|
|
@ -3046,7 +3045,7 @@ static int __init dquot_init(void)
|
|||
panic("Cannot create dquot stat counters");
|
||||
|
||||
/* Find power-of-two hlist_heads which can fit into allocation */
|
||||
nr_hash = (1UL << order) * PAGE_SIZE / sizeof(struct hlist_head);
|
||||
nr_hash = PAGE_SIZE / sizeof(struct hlist_head);
|
||||
dq_hash_bits = ilog2(nr_hash);
|
||||
|
||||
nr_hash = 1UL << dq_hash_bits;
|
||||
|
|
@ -3054,8 +3053,8 @@ static int __init dquot_init(void)
|
|||
for (i = 0; i < nr_hash; i++)
|
||||
INIT_HLIST_HEAD(dquot_hash + i);
|
||||
|
||||
pr_info("VFS: Dquot-cache hash table entries: %ld (order %ld,"
|
||||
" %ld bytes)\n", nr_hash, order, (PAGE_SIZE << order));
|
||||
pr_info("VFS: Dquot-cache hash table entries: %ld (%ld bytes)\n",
|
||||
nr_hash, PAGE_SIZE);
|
||||
|
||||
dqcache_shrinker = shrinker_alloc(0, "dquota-cache");
|
||||
if (!dqcache_shrinker)
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ void poll_freewait(struct poll_wqueues *pwq)
|
|||
} while (entry > p->entries);
|
||||
old = p;
|
||||
p = p->next;
|
||||
free_page((unsigned long) old);
|
||||
kfree(old);
|
||||
}
|
||||
}
|
||||
EXPORT_SYMBOL(poll_freewait);
|
||||
|
|
@ -165,7 +165,7 @@ static struct poll_table_entry *poll_get_entry(struct poll_wqueues *p)
|
|||
if (!table || POLL_TABLE_FULL(table)) {
|
||||
struct poll_table_page *new_table;
|
||||
|
||||
new_table = (struct poll_table_page *) __get_free_page(GFP_KERNEL);
|
||||
new_table = kmalloc(PAGE_SIZE, GFP_KERNEL);
|
||||
if (!new_table) {
|
||||
p->error = -ENOMEM;
|
||||
return NULL;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user