Commit a37f4989 authored by Mika Kukkonen's avatar Mika Kukkonen Committed by Linus Torvalds

[PATCH] sparse: NULL vs 0 - filesystems

parent a5439521
......@@ -60,7 +60,7 @@ static size_t dcookie_hash(unsigned long dcookie)
static struct dcookie_struct * find_dcookie(unsigned long dcookie)
{
struct dcookie_struct * found = 0;
struct dcookie_struct *found = NULL;
struct dcookie_struct * dcs;
struct list_head * pos;
struct list_head * list;
......
......@@ -133,7 +133,7 @@ static int ext2_alloc_block (struct inode * inode, unsigned long goal, int *err)
&ei->i_prealloc_count,
&ei->i_prealloc_block, err);
else
result = ext2_new_block (inode, goal, 0, 0, err);
result = ext2_new_block(inode, goal, NULL, NULL, err);
}
#else
result = ext2_new_block (inode, goal, 0, 0, err);
......
......@@ -129,7 +129,7 @@ static int ext3_readdir(struct file * filp,
while (!error && !stored && filp->f_pos < inode->i_size) {
blk = (filp->f_pos) >> EXT3_BLOCK_SIZE_BITS(sb);
bh = ext3_bread (0, inode, blk, 0, &err);
bh = ext3_bread(NULL, inode, blk, 0, &err);
if (!bh) {
ext3_error (sb, "ext3_readdir",
"directory #%lu contains a hole at offset %lu",
......@@ -295,14 +295,14 @@ static void free_rb_tree_fname(struct rb_root *root)
kfree (old);
}
if (!parent)
root->rb_node = 0;
root->rb_node = NULL;
else if (parent->rb_left == n)
parent->rb_left = 0;
parent->rb_left = NULL;
else if (parent->rb_right == n)
parent->rb_right = 0;
parent->rb_right = NULL;
n = parent;
}
root->rb_node = 0;
root->rb_node = NULL;
}
......@@ -313,9 +313,9 @@ struct dir_private_info *create_dir_info(loff_t pos)
p = kmalloc(sizeof(struct dir_private_info), GFP_KERNEL);
if (!p)
return NULL;
p->root.rb_node = 0;
p->curr_node = 0;
p->extra_fname = 0;
p->root.rb_node = NULL;
p->curr_node = NULL;
p->extra_fname = NULL;
p->last_pos = 0;
p->curr_hash = pos2maj_hash(pos);
p->curr_minor_hash = pos2min_hash(pos);
......@@ -447,8 +447,8 @@ static int ext3_dx_readdir(struct file * filp,
/* Some one has messed with f_pos; reset the world */
if (info->last_pos != filp->f_pos) {
free_rb_tree_fname(&info->root);
info->curr_node = 0;
info->extra_fname = 0;
info->curr_node = NULL;
info->extra_fname = NULL;
info->curr_hash = pos2maj_hash(filp->f_pos);
info->curr_minor_hash = pos2min_hash(filp->f_pos);
}
......@@ -472,7 +472,7 @@ static int ext3_dx_readdir(struct file * filp,
*/
if ((!info->curr_node) ||
(filp->f_version != inode->i_version)) {
info->curr_node = 0;
info->curr_node = NULL;
free_rb_tree_fname(&info->root);
filp->f_version = inode->i_version;
ret = ext3_htree_fill_tree(filp, info->curr_hash,
......
......@@ -287,7 +287,7 @@ static int ext3_alloc_block (handle_t *handle,
&ei->i_prealloc_count,
&ei->i_prealloc_block, err);
else
result = ext3_new_block (inode, goal, 0, 0, err);
result = ext3_new_block(inode, goal, NULL, NULL, err);
/*
* AKPM: this is somewhat sticky. I'm not surprised it was
* disabled in 2.2's ext3. Need to integrate b_committed_data
......@@ -296,7 +296,7 @@ static int ext3_alloc_block (handle_t *handle,
*/
}
#else
result = ext3_new_block (handle, inode, goal, 0, 0, err);
result = ext3_new_block(handle, inode, goal, NULL, NULL, err);
#endif
return result;
}
......@@ -859,7 +859,7 @@ ext3_get_block_handle(handle_t *handle, struct inode *inode, sector_t iblock,
static int ext3_get_block(struct inode *inode, sector_t iblock,
struct buffer_head *bh_result, int create)
{
handle_t *handle = 0;
handle_t *handle = NULL;
int ret;
if (create) {
......
......@@ -604,7 +604,7 @@ int ext3_htree_fill_tree(struct file *dir_file, __u32 start_hash,
}
hinfo.hash = start_hash;
hinfo.minor_hash = 0;
frame = dx_probe(0, dir_file->f_dentry->d_inode, &hinfo, frames, &err);
frame = dx_probe(NULL, dir_file->f_dentry->d_inode, &hinfo, frames, &err);
if (!frame)
return err;
......@@ -930,7 +930,7 @@ static struct buffer_head * ext3_dx_find_entry(struct dentry *dentry,
struct inode *dir = dentry->d_parent->d_inode;
sb = dir->i_sb;
if (!(frame = dx_probe (dentry, 0, &hinfo, frames, err)))
if (!(frame = dx_probe(dentry, NULL, &hinfo, frames, err)))
return NULL;
hash = hinfo.hash;
do {
......@@ -956,7 +956,7 @@ static struct buffer_head * ext3_dx_find_entry(struct dentry *dentry,
brelse (bh);
/* Check to see if we should continue to search */
retval = ext3_htree_next_block(dir, hash, frame,
frames, 0);
frames, NULL);
if (retval < 0) {
ext3_warning(sb, __FUNCTION__,
"error reading index page in directory #%lu",
......@@ -1392,7 +1392,7 @@ static int ext3_add_entry (handle_t *handle, struct dentry *dentry,
bh = ext3_bread(handle, dir, block, 0, &retval);
if(!bh)
return retval;
retval = add_dirent_to_buf(handle, dentry, inode, 0, bh);
retval = add_dirent_to_buf(handle, dentry, inode, NULL, bh);
if (retval != -ENOSPC)
return retval;
......@@ -1429,7 +1429,7 @@ static int ext3_dx_add_entry(handle_t *handle, struct dentry *dentry,
struct ext3_dir_entry_2 *de;
int err;
frame = dx_probe(dentry, 0, &hinfo, frames, &err);
frame = dx_probe(dentry, NULL, &hinfo, frames, &err);
if (!frame)
return err;
entries = frame->entries;
......@@ -1443,9 +1443,9 @@ static int ext3_dx_add_entry(handle_t *handle, struct dentry *dentry,
if (err)
goto journal_error;
err = add_dirent_to_buf(handle, dentry, inode, 0, bh);
err = add_dirent_to_buf(handle, dentry, inode, NULL, bh);
if (err != -ENOSPC) {
bh = 0;
bh = NULL;
goto cleanup;
}
......@@ -1537,7 +1537,7 @@ static int ext3_dx_add_entry(handle_t *handle, struct dentry *dentry,
if (!de)
goto cleanup;
err = add_dirent_to_buf(handle, dentry, inode, de, bh);
bh = 0;
bh = NULL;
goto cleanup;
journal_error:
......
......@@ -356,7 +356,7 @@ static int ext3_blkdev_remove(struct ext3_sb_info *sbi)
bdev = sbi->journal_bdev;
if (bdev) {
ret = ext3_blkdev_put(bdev);
sbi->journal_bdev = 0;
sbi->journal_bdev = NULL;
}
return ret;
}
......@@ -1201,7 +1201,7 @@ static unsigned long descriptor_loc(struct super_block *sb,
static int ext3_fill_super (struct super_block *sb, void *data, int silent)
{
struct buffer_head * bh;
struct ext3_super_block *es = 0;
struct ext3_super_block *es = NULL;
struct ext3_sb_info *sbi;
unsigned long block;
unsigned long sb_block = get_sb_block(&data);
......@@ -1473,7 +1473,7 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent)
#endif
INIT_LIST_HEAD(&sbi->s_orphan); /* unlinked but open files */
sb->s_root = 0;
sb->s_root = NULL;
needs_recovery = (es->s_last_orphan != 0 ||
EXT3_HAS_INCOMPAT_FEATURE(sb,
......
......@@ -786,8 +786,8 @@ ext3_xattr_set_handle2(handle_t *handle, struct inode *inode,
EXT3_SB(sb)->s_es->s_first_data_block) +
EXT3_I(inode)->i_block_group *
EXT3_BLOCKS_PER_GROUP(sb);
int block = ext3_new_block(handle,
inode, goal, 0, 0, &error);
int block = ext3_new_block(handle, inode, goal,
NULL, NULL, &error);
if (error)
goto cleanup;
ea_idebug(inode, "creating block %d", block);
......
......@@ -41,7 +41,7 @@
#define CONTINUE_DECLS \
int cont_extent = 0, cont_offset = 0, cont_size = 0; \
void * buffer = 0
void *buffer = NULL
#define CHECK_CE \
{cont_extent = isonum_733(rr->u.CE.extent); \
......
......@@ -362,7 +362,7 @@ void journal_commit_transaction(journal_t *journal)
*/
commit_transaction->t_state = T_COMMIT;
descriptor = 0;
descriptor = NULL;
bufs = 0;
while (commit_transaction->t_buffers) {
......
......@@ -1617,7 +1617,7 @@ static void journal_destroy_journal_head_cache(void)
{
J_ASSERT(journal_head_cache != NULL);
kmem_cache_destroy(journal_head_cache);
journal_head_cache = 0;
journal_head_cache = NULL;
}
/*
......
......@@ -187,9 +187,9 @@ int __init journal_init_revoke_caches(void)
void journal_destroy_revoke_caches(void)
{
kmem_cache_destroy(revoke_record_cache);
revoke_record_cache = 0;
revoke_record_cache = NULL;
kmem_cache_destroy(revoke_table_cache);
revoke_table_cache = 0;
revoke_table_cache = NULL;
}
/* Initialise the revoke table for a given journal to a given size. */
......
......@@ -1480,7 +1480,7 @@ __blist_del_buffer(struct journal_head **list, struct journal_head *jh)
if (*list == jh) {
*list = jh->b_tnext;
if (*list == jh)
*list = 0;
*list = NULL;
}
jh->b_tprev->b_tnext = jh->b_tnext;
jh->b_tnext->b_tprev = jh->b_tprev;
......@@ -1499,7 +1499,7 @@ __blist_del_buffer(struct journal_head **list, struct journal_head *jh)
*/
void __journal_unfile_buffer(struct journal_head *jh)
{
struct journal_head **list = 0;
struct journal_head **list = NULL;
transaction_t *transaction;
struct buffer_head *bh = jh2bh(jh);
......@@ -1930,7 +1930,7 @@ int journal_invalidatepage(journal_t *journal,
void __journal_file_buffer(struct journal_head *jh,
transaction_t *transaction, int jlist)
{
struct journal_head **list = 0;
struct journal_head **list = NULL;
int was_dirty = 0;
struct buffer_head *bh = jh2bh(jh);
......
......@@ -190,7 +190,7 @@ nlm_encode_testres(u32 *p, struct nlm_res *resp)
s32 start, len;
if (!(p = nlm_encode_cookie(p, &resp->cookie)))
return 0;
return NULL;
*p++ = resp->status;
if (resp->status == nlm_lck_denied) {
......@@ -201,7 +201,7 @@ nlm_encode_testres(u32 *p, struct nlm_res *resp)
/* Encode owner handle. */
if (!(p = xdr_encode_netobj(p, &resp->lock.oh)))
return 0;
return NULL;
start = loff_t_to_s32(fl->fl_start);
if (fl->fl_end == OFFSET_MAX)
......
......@@ -470,7 +470,7 @@ static int __init init_nfsd(void)
#ifdef CONFIG_NFSD_V4
nfsd_idmap_init(); /* Name to ID mapping */
#endif /* CONFIG_NFSD_V4 */
if (proc_mkdir("fs/nfs", 0)) {
if (proc_mkdir("fs/nfs", NULL)) {
struct proc_dir_entry *entry;
entry = create_proc_entry("fs/nfs/exports", 0, NULL);
if (entry)
......
......@@ -82,7 +82,7 @@ kclist_del(void *addr)
}
}
write_unlock(&kclist_lock);
return 0;
return NULL;
}
static size_t get_kcore_size(int *nphdr, size_t *elf_buflen)
......
......@@ -33,7 +33,7 @@ static int kmsg_release(struct inode * inode, struct file * file)
static ssize_t kmsg_read(struct file *file, char __user *buf,
size_t count, loff_t *ppos)
{
if ((file->f_flags & O_NONBLOCK) && !do_syslog(9, 0, 0))
if ((file->f_flags & O_NONBLOCK) && !do_syslog(9, NULL, 0))
return -EAGAIN;
return do_syslog(2, buf, count);
}
......@@ -41,7 +41,7 @@ static ssize_t kmsg_read(struct file *file, char __user *buf,
static unsigned int kmsg_poll(struct file *file, poll_table *wait)
{
poll_wait(file, &log_wait, wait);
if (do_syslog(9, 0, 0))
if (do_syslog(9, NULL, 0))
return POLLIN | POLLRDNORM;
return 0;
}
......
......@@ -217,7 +217,7 @@ void proc_tty_unregister_driver(struct tty_driver *driver)
remove_proc_entry(driver->driver_name, proc_tty_driver);
driver->proc_entry = 0;
driver->proc_entry = NULL;
}
/*
......@@ -226,18 +226,18 @@ void proc_tty_unregister_driver(struct tty_driver *driver)
void __init proc_tty_init(void)
{
struct proc_dir_entry *entry;
if (!proc_mkdir("tty", 0))
if (!proc_mkdir("tty", NULL))
return;
proc_tty_ldisc = proc_mkdir("tty/ldisc", 0);
proc_tty_ldisc = proc_mkdir("tty/ldisc", NULL);
/*
* /proc/tty/driver/serial reveals the exact character counts for
* serial links which is just too easy to abuse for inferring
* password lengths and inter-keystroke timings during password
* entry.
*/
proc_tty_driver = proc_mkdir_mode("tty/driver", S_IRUSR | S_IXUSR, 0);
proc_tty_driver = proc_mkdir_mode("tty/driver", S_IRUSR | S_IXUSR, NULL);
create_proc_read_entry("tty/ldiscs", 0, 0, tty_ldiscs_read_proc,NULL);
create_proc_read_entry("tty/ldiscs", 0, NULL, tty_ldiscs_read_proc, NULL);
entry = create_proc_entry("tty/drivers", 0, NULL);
if (entry)
entry->proc_fops = &proc_tty_drivers_operations;
......
......@@ -52,29 +52,29 @@ void __init proc_root_init(void)
return;
}
proc_misc_init();
proc_net = proc_mkdir("net", 0);
proc_net = proc_mkdir("net", NULL);
#ifdef CONFIG_SYSVIPC
proc_mkdir("sysvipc", 0);
proc_mkdir("sysvipc", NULL);
#endif
#ifdef CONFIG_SYSCTL
proc_sys_root = proc_mkdir("sys", 0);
proc_sys_root = proc_mkdir("sys", NULL);
#endif
#if defined(CONFIG_BINFMT_MISC) || defined(CONFIG_BINFMT_MISC_MODULE)
proc_mkdir("sys/fs", 0);
proc_mkdir("sys/fs/binfmt_misc", 0);
proc_mkdir("sys/fs", NULL);
proc_mkdir("sys/fs/binfmt_misc", NULL);
#endif
proc_root_fs = proc_mkdir("fs", 0);
proc_root_driver = proc_mkdir("driver", 0);
proc_mkdir("fs/nfsd", 0); /* somewhere for the nfsd filesystem to be mounted */
proc_root_fs = proc_mkdir("fs", NULL);
proc_root_driver = proc_mkdir("driver", NULL);
proc_mkdir("fs/nfsd", NULL); /* somewhere for the nfsd filesystem to be mounted */
#if defined(CONFIG_SUN_OPENPROMFS) || defined(CONFIG_SUN_OPENPROMFS_MODULE)
/* just give it a mountpoint */
proc_mkdir("openprom", 0);
proc_mkdir("openprom", NULL);
#endif
proc_tty_init();
#ifdef CONFIG_PROC_DEVICETREE
proc_device_tree_init();
#endif
proc_bus = proc_mkdir("bus", 0);
proc_bus = proc_mkdir("bus", NULL);
}
static struct dentry *proc_root_lookup(struct inode * dir, struct dentry * dentry, struct nameidata *nd)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment