#include <linux/string.h>
+extern int ceph_debug;
+extern int ceph_debug_mask;
+extern int ceph_debug_console;
+
+/* different debug level for the different modules */
+extern int ceph_debug_addr;
+extern int ceph_debug_caps;
+extern int ceph_debug_dir;
+extern int ceph_debug_export;
+extern int ceph_debug_file;
+extern int ceph_debug_inode;
+extern int ceph_debug_ioctl;
+extern int ceph_debug_mdsc;
+extern int ceph_debug_mdsmap;
+extern int ceph_debug_msgr;
+extern int ceph_debug_mon;
+extern int ceph_debug_osdc;
+extern int ceph_debug_osdmap;
+extern int ceph_debug_snap;
+extern int ceph_debug_super;
+extern int ceph_debug_protocol;
+extern int ceph_debug_proc;
+
#define DOUT_MASK_ADDR 0x00000001
#define DOUT_MASK_CAPS 0x00000002
#define DOUT_MASK_DIR 0x00000004
{DOUT_MASK_SUPER, "super"},
{DOUT_MASK_PROTOCOL, "protocol"},
{DOUT_MASK_PROC, "proc"},
- {0, 0}
+ {0, NULL}
};
static inline int ceph_get_debug_mask(char *name)
int op = ceph_snap(inode) == CEPH_SNAPDIR ?
CEPH_MDS_OP_LSSNAP:CEPH_MDS_OP_READDIR;
- frag = ceph_choose_frag(ceph_inode(inode), frag, 0, 0);
+ frag = ceph_choose_frag(ceph_inode(inode), frag, NULL, NULL);
/* query mds */
dout(10, "dir_readdir querying mds for ino %llx.%llx frag %x\n",
path = ceph_build_dentry_path(filp->f_dentry, &pathlen,
&pathbase, 1);
req = ceph_mdsc_create_request(mdsc, op,
- pathbase, path, 0, 0,
+ pathbase, path, 0, NULL,
filp->f_dentry, USE_AUTH_MDS);
kfree(path);
if (IS_ERR(req))
return 0;
}
-loff_t ceph_dir_llseek(struct file *file, loff_t offset, int origin)
+static loff_t ceph_dir_llseek(struct file *file, loff_t offset, int origin)
{
struct ceph_file_info *fi = file->private_data;
struct inode *inode = file->f_mapping->host;
if (offset == 0 && fi->last_readdir) {
dout(10, "llseek dropping %p readdir content\n", file);
ceph_mdsc_put_request(fi->last_readdir);
- fi->last_readdir = 0;
+ fi->last_readdir = NULL;
}
}
mutex_unlock(&inode->i_mutex);
dentry = req->r_last_dentry; /* we got spliced */
dget(dentry);
} else
- dentry = 0;
+ dentry = NULL;
return dentry;
}
/* stat ino directly */
WARN_ON(ceph_snap(dentry->d_inode) != CEPH_NOSNAP);
req = ceph_mdsc_create_request(mdsc, CEPH_MDS_OP_LSTAT,
- ceph_ino(dentry->d_inode), 0,
- 0, 0,
+ ceph_ino(dentry->d_inode), NULL,
+ 0, NULL,
dentry, USE_CAP_MDS);
} else {
/* build path */
if (IS_ERR(path))
return ERR_PTR(PTR_ERR(path));
req = ceph_mdsc_create_request(mdsc, CEPH_MDS_OP_LSTAT,
- pathbase, path, 0, 0,
+ pathbase, path, 0, NULL,
dentry, USE_ANY_MDS);
kfree(path);
}
if (IS_ERR(path))
return PTR_ERR(path);
req = ceph_mdsc_create_request(mdsc, CEPH_MDS_OP_MKNOD,
- pathbase, path, 0, 0,
+ pathbase, path, 0, NULL,
dentry, USE_AUTH_MDS);
kfree(path);
if (IS_ERR(req)) {
rhead = req->r_request->front.iov_base;
rhead->args.mknod.mode = cpu_to_le32(mode);
rhead->args.mknod.rdev = cpu_to_le32(rdev);
- ceph_mdsc_lease_release(mdsc, dir, 0, CEPH_LOCK_ICONTENT);
+ ceph_mdsc_lease_release(mdsc, dir, NULL, CEPH_LOCK_ICONTENT);
err = ceph_mdsc_do_request(mdsc, req);
if (!err && req->r_reply_info.trace_numd == 0) {
/* no trace. do lookup, in case we are called from create. */
/* ick. this is untested... */
dput(d);
err = -ESTALE;
- dentry = 0;
+ dentry = NULL;
}
}
ceph_mdsc_put_request(req);
return PTR_ERR(req);
}
req->r_locked_dir = dir;
- ceph_mdsc_lease_release(mdsc, dir, 0, CEPH_LOCK_ICONTENT);
+ ceph_mdsc_lease_release(mdsc, dir, NULL, CEPH_LOCK_ICONTENT);
err = ceph_mdsc_do_request(mdsc, req);
ceph_mdsc_put_request(req);
if (err) {
int pathlen;
u64 pathbase;
int err;
- char *snap = 0;
+ char *snap = NULL;
int snaplen;
struct dentry *pathdentry = dentry;
int op = CEPH_MDS_OP_MKDIR;
rhead = req->r_request->front.iov_base;
rhead->args.mkdir.mode = cpu_to_le32(mode);
- ceph_mdsc_lease_release(mdsc, dir, 0, CEPH_LOCK_ICONTENT);
+ ceph_mdsc_lease_release(mdsc, dir, NULL, CEPH_LOCK_ICONTENT);
err = ceph_mdsc_do_request(mdsc, req);
ceph_mdsc_put_request(req);
if (err < 0) {
req->r_last_dentry = dentry; /* use this dentry in fill_trace */
req->r_locked_dir = old_dentry->d_inode;
- ceph_mdsc_lease_release(mdsc, dir, 0, CEPH_LOCK_ICONTENT);
+ ceph_mdsc_lease_release(mdsc, dir, NULL, CEPH_LOCK_ICONTENT);
err = ceph_mdsc_do_request(mdsc, req);
ceph_mdsc_put_request(req);
if (err) {
char *path;
int pathlen;
u64 pathbase;
- char *snap = 0;
+ char *snap = NULL;
int snaplen;
int err;
int op = ((dentry->d_inode->i_mode & S_IFMT) == S_IFDIR) ?
ceph_mdsc_lease_release(mdsc, dir, dentry,
CEPH_LOCK_DN|CEPH_LOCK_ICONTENT);
- ceph_mdsc_lease_release(mdsc, inode, 0, CEPH_LOCK_ILINK);
+ ceph_mdsc_lease_release(mdsc, inode, NULL, CEPH_LOCK_ILINK);
err = ceph_mdsc_do_request(mdsc, req);
ceph_mdsc_put_request(req);
ceph_mdsc_lease_release(mdsc, old_dir, old_dentry,
CEPH_LOCK_DN|CEPH_LOCK_ICONTENT);
if (new_dentry->d_inode)
- ceph_mdsc_lease_release(mdsc, new_dentry->d_inode, 0,
+ ceph_mdsc_lease_release(mdsc, new_dentry->d_inode, NULL,
CEPH_LOCK_ILINK);
err = ceph_mdsc_do_request(mdsc, req);
if (!err && req->r_reply_info.trace_numd == 0) {