]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
kclient: fix umount_begin for 2.6.26+
authorYehuda Sadeh <yehuda@hq.newdream.net>
Wed, 15 Oct 2008 18:52:20 +0000 (11:52 -0700)
committerYehuda Sadeh <yehuda@hq.newdream.net>
Wed, 15 Oct 2008 18:52:20 +0000 (11:52 -0700)
src/kernel/ceph_debug.h
src/kernel/dir.c
src/kernel/super.c

index 4e191dc862ffc4d1532462d6540c8982aa88d52c..e8fe0e6c58d87817760f2ddcaad4fc547abe183d 100644 (file)
@@ -3,6 +3,29 @@
 
 #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
@@ -46,7 +69,7 @@ static struct _debug_mask_name _debug_mask_names[] = {
                {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)
index f15c24816f1f8600a6b6d1a45f7f1b71092da70c..c974fc162f65b7a8b79b969a4c33fe47952aae92 100644 (file)
@@ -153,7 +153,7 @@ nextfrag:
                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",
@@ -161,7 +161,7 @@ nextfrag:
                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))
@@ -241,7 +241,7 @@ nextfrag:
        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;
@@ -265,7 +265,7 @@ loff_t ceph_dir_llseek(struct file *file, loff_t offset, int origin)
                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);
@@ -312,7 +312,7 @@ struct dentry *ceph_finish_lookup(struct ceph_mds_request *req,
                dentry = req->r_last_dentry;   /* we got spliced */
                dget(dentry);
        } else
-               dentry = 0;
+               dentry = NULL;
        return dentry;
 }
 
@@ -340,8 +340,8 @@ struct dentry *ceph_do_lookup(struct super_block *sb, struct dentry *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 */
@@ -350,7 +350,7 @@ struct dentry *ceph_do_lookup(struct super_block *sb, struct dentry *dentry,
                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);
        }
@@ -407,7 +407,7 @@ static int ceph_mknod(struct inode *dir, struct dentry *dentry,
        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)) {
@@ -419,7 +419,7 @@ static int ceph_mknod(struct inode *dir, struct dentry *dentry,
        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. */
@@ -430,7 +430,7 @@ static int ceph_mknod(struct inode *dir, struct dentry *dentry,
                        /* ick.  this is untested... */
                        dput(d);
                        err = -ESTALE;
-                       dentry = 0;
+                       dentry = NULL;
                }
        }
        ceph_mdsc_put_request(req);
@@ -491,7 +491,7 @@ static int ceph_symlink(struct inode *dir, struct dentry *dentry,
                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) {
@@ -511,7 +511,7 @@ static int ceph_mkdir(struct inode *dir, struct dentry *dentry, int mode)
        int pathlen;
        u64 pathbase;
        int err;
-       char *snap = 0;
+       char *snap = NULL;
        int snaplen;
        struct dentry *pathdentry = dentry;
        int op = CEPH_MDS_OP_MKDIR;
@@ -549,7 +549,7 @@ static int ceph_mkdir(struct inode *dir, struct dentry *dentry, int mode)
        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) {
@@ -600,7 +600,7 @@ static int ceph_link(struct dentry *old_dentry, struct inode *dir,
        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) {
@@ -626,7 +626,7 @@ static int ceph_unlink(struct inode *dir, struct dentry *dentry)
        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) ?
@@ -662,7 +662,7 @@ static int ceph_unlink(struct inode *dir, struct dentry *dentry)
 
        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);
 
@@ -721,7 +721,7 @@ static int ceph_rename(struct inode *old_dir, struct dentry *old_dentry,
        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) {
index 0a7555f3f249e3c3c21ab3f6ec535860dc190442..41038425feda2ed79486620b633eea9d3029bc72 100644 (file)
@@ -258,14 +258,24 @@ static void destroy_inodecache(void)
        kmem_cache_destroy(ceph_inode_cachep);
 }
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)
 static void ceph_umount_begin(struct vfsmount *vfsmnt, int flags)
+#else
+static void ceph_umount_begin(struct super_block *sb)
+#endif
 {
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)
        struct ceph_client *client = ceph_sb_to_client(vfsmnt->mnt_sb);
+#else
+       struct ceph_client *client = ceph_sb_to_client(sb);
+#endif
 
        dout(30, "ceph_umount_begin\n");
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)
        if (!(flags & MNT_FORCE))
                return;
+#endif
 
        if (!client)
                return;