/* debug levels; defined in super.h */
+#include "ceph_debug.h"
+
/*
* global debug value.
* 0 = quiet.
/* for this file */
int ceph_debug_super = -1;
-#include "ceph_debug.h"
-
#define DOUT_MASK DOUT_MASK_SUPER
#define DOUT_VAR ceph_debug_super
#define DOUT_PREFIX "super: "
ci->i_version = 0;
ci->i_truncate_seq = 0;
ci->i_time_warp_seq = 0;
- ci->i_symlink = 0;
+ ci->i_symlink = NULL;
- ci->i_lease_session = 0;
+ ci->i_lease_session = NULL;
ci->i_lease_mask = 0;
ci->i_lease_ttl = 0;
INIT_LIST_HEAD(&ci->i_lease_item);
mutex_init(&ci->i_fragtree_mutex);
ci->i_xattr_len = 0;
- ci->i_xattr_data = 0;
+ ci->i_xattr_data = NULL;
ci->i_caps = RB_ROOT;
for (i = 0; i < CEPH_FILE_MODE_NUM; i++)
ci->i_hold_caps_until = 0;
INIT_LIST_HEAD(&ci->i_cap_delay_list);
- ci->i_snap_realm = 0;
+ ci->i_snap_realm = NULL;
INIT_WORK(&ci->i_wb_work, ceph_inode_writeback);
dout(30, "destroy_inode %p ino %llx.%llx\n", inode, ceph_vinop(inode));
kfree(ci->i_symlink);
- while ((n = rb_first(&ci->i_fragtree)) != 0) {
+ while ((n = rb_first(&ci->i_fragtree)) != NULL) {
frag = rb_entry(n, struct ceph_inode_frag, node);
rb_erase(n, &ci->i_fragtree);
kfree(frag);
dout(30, "ceph_peer_reset %s%d\n", ENTITY_NAME(*peer_name));
switch (le32_to_cpu(peer_name->type)) {
case CEPH_ENTITY_TYPE_MDS:
- return ceph_mdsc_handle_reset(&client->mdsc,
+ ceph_mdsc_handle_reset(&client->mdsc,
le32_to_cpu(peer_name->num));
+ break;
case CEPH_ENTITY_TYPE_OSD:
- return ceph_osdc_handle_reset(&client->osdc, peer_addr);
+ ceph_osdc_handle_reset(&client->osdc, peer_addr);
+ break;
}
}
/* parse mount options */
while ((c = strsep(&options, ",")) != NULL) {
- int token, intval, ret, i;
+ int token, intval, ret;
if (!*c)
continue;
token = match_token(c, arg_tokens, argstr);
/*
* create a fresh client instance
*/
-struct ceph_client *ceph_create_client(void)
+static struct ceph_client *ceph_create_client(void)
{
struct ceph_client *client;
int err = -ENOMEM;
init_waitqueue_head(&client->mount_wq);
- client->sb = 0;
+ client->sb = NULL;
client->mount_state = CEPH_MOUNT_MOUNTING;
client->whoami = -1;
- client->msgr = 0;
+ client->msgr = NULL;
client->wb_wq = create_workqueue("ceph-writeback");
- if (client->wb_wq == 0)
+ if (client->wb_wq == NULL)
goto fail;
client->trunc_wq = create_workqueue("ceph-trunc");
- if (client->trunc_wq == 0)
+ if (client->trunc_wq == NULL)
goto fail;
/* subsystems */
return ERR_PTR(-ENOMEM);
}
-void ceph_destroy_client(struct ceph_client *client)
+static void ceph_destroy_client(struct ceph_client *client)
{
dout(10, "destroy_client %p\n", client);
unsigned long started)
{
struct ceph_mds_client *mdsc = &client->mdsc;
- struct ceph_mds_request *req = 0;
+ struct ceph_mds_request *req = NULL;
struct ceph_mds_request_head *reqhead;
int err;
struct dentry *root;
/* open dir */
dout(30, "open_root_inode opening '%s'\n", path);
req = ceph_mdsc_create_request(mdsc, CEPH_MDS_OP_OPEN,
- 1, path, 0, 0,
+ 1, path, 0, NULL,
NULL, USE_ANY_MDS);
if (IS_ERR(req))
return ERR_PTR(PTR_ERR(req));
/*
* mount: join the ceph cluster.
*/
-int ceph_mount(struct ceph_client *client, struct vfsmount *mnt,
+static int ceph_mount(struct ceph_client *client, struct vfsmount *mnt,
const char *path)
{
- struct ceph_entity_addr *myaddr = 0;
+ struct ceph_entity_addr *myaddr = NULL;
struct ceph_msg *mount_msg;
struct dentry *root;
int err;
client->msgr = ceph_messenger_create(myaddr);
if (IS_ERR(client->msgr)) {
err = PTR_ERR(client->msgr);
- client->msgr = 0;
+ client->msgr = NULL;
goto out;
}
client->msgr->parent = client;
dout(10, "mount sending mount request\n");
get_random_bytes(&r, 1);
which = r % client->mount_args.num_mon;
- mount_msg = ceph_msg_new(CEPH_MSG_CLIENT_MOUNT, 0, 0, 0, 0);
+ mount_msg = ceph_msg_new(CEPH_MSG_CLIENT_MOUNT, 0, 0, 0, NULL);
if (IS_ERR(mount_msg)) {
err = PTR_ERR(mount_msg);
goto out;
/* set time granularity */
s->s_time_gran = 1000; /* 1000 ns == 1 us */
- ret = set_anon_super(s, 0); /* what is the second arg for? */
+ ret = set_anon_super(s, NULL); /* what is the second arg for? */
if (ret != 0)
goto bail;
return ret;
bail:
- s->s_fs_info = 0;
- client->sb = 0;
+ s->s_fs_info = NULL;
+ client->sb = NULL;
return ret;
}
goto out;
if (client->mount_args.flags & CEPH_MOUNT_NOSHARE)
- compare_super = 0;
+ compare_super = NULL;
/* superblock */
sb = sget(fs_type, compare_super, ceph_set_super, client);