]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
kclient: strip out kernel version compatibility cruft v0.9
authorSage Weil <sage@newdream.net>
Thu, 18 Jun 2009 21:58:17 +0000 (14:58 -0700)
committerSage Weil <sage@newdream.net>
Fri, 19 Jun 2009 22:03:18 +0000 (15:03 -0700)
src/kernel/addr.c
src/kernel/export.c
src/kernel/import_patch_set_into_linux_git.sh
src/kernel/inode.c
src/kernel/mds_client.c
src/kernel/osd_client.c
src/kernel/super.c

index d43a19bb0627f691bb0030fe499fffa154f9410b..e5842fa6f0935f47cf16a8af8595dbd07bd47cdd 100644 (file)
@@ -104,11 +104,7 @@ static int ceph_set_page_dirty(struct page *page)
        spin_unlock(&inode->i_lock);
 
        /* now adjust page */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
        spin_lock_irq(&mapping->tree_lock);
-#else
-       write_lock_irq(&mapping->tree_lock);
-#endif
        if (page->mapping) {    /* Race with truncate? */
                WARN_ON_ONCE(!PageUptodate(page));
 
@@ -132,11 +128,7 @@ static int ceph_set_page_dirty(struct page *page)
                undo = 1;
        }
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
        spin_unlock_irq(&mapping->tree_lock);
-#else
-       write_unlock_irq(&mapping->tree_lock);
-#endif
 
        if (undo)
                ceph_put_wrbuffer_cap_refs(ci, 1, snapc);
@@ -315,17 +307,9 @@ static int ceph_readpages(struct file *file, struct address_space *mapping,
                SetPageUptodate(page);
                unlock_page(page);
                if (pagevec_add(&pvec, page) == 0)
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28)
                        pagevec_lru_add_file(&pvec);   /* add to lru */
-#else
-                       pagevec_lru_add(&pvec);   /* add to lru */
-#endif
        }
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28)
        pagevec_lru_add_file(&pvec);
-#else
-       pagevec_lru_add(&pvec);
-#endif
        rc = 0;
 
 out:
@@ -676,11 +660,7 @@ get_more_pages:
                        dout(20, "? %p idx %lu\n", page, page->index);
                        if (locked_pages == 0)
                                lock_page(page);  /* first page */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
                        else if (!trylock_page(page))
-#else
-                       else if (TestSetPageLocked(page))
-#endif
                                break;
 
                        /* only dirty pages, or our accounting breaks */
@@ -893,11 +873,7 @@ static int ceph_write_begin(struct file *file, struct address_space *mapping,
 
        /* get a page*/
 retry:
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29)
        page = grab_cache_page_write_begin(mapping, index, 0);
-#else
-       page = __grab_cache_page(mapping, index);
-#endif
        if (!page)
                return -ENOMEM;
        *pagep = page;
@@ -973,13 +949,9 @@ retry_locked:
             end_in_page - pos_in_page != PAGE_CACHE_SIZE)) {
                dout(20, " zeroing %p 0 - %d and %d - %d\n",
                     page, pos_in_page, end_in_page, (int)PAGE_CACHE_SIZE);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
                zero_user_segments(page,
                                   0, pos_in_page,
                                   end_in_page, PAGE_CACHE_SIZE);
-#else
-               simple_prepare_write(file, page, pos_in_page, end_in_page);
-#endif
                return 0;
        }
 
@@ -1015,13 +987,8 @@ static int ceph_write_end(struct file *file, struct address_space *mapping,
             inode, page, (int)pos, (int)copied, (int)len);
 
        /* zero the stale part of the page if we did a short copy */
-       if (copied < len) {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)
+       if (copied < len)
                zero_user_segment(page, from+copied, len);
-#else
-               zero_user_page(page, from+copied, len-copied, KM_USER0);
-#endif
-       }
 
        /* did file size increase? */
        /* (no need for i_size_read(); we caller holds i_mutex */
@@ -1077,17 +1044,11 @@ const struct address_space_operations ceph_aops = {
 /*
  * Reuse write_{begin,end} here for simplicity.
  */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30)
 static int ceph_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
-#else
-static int ceph_page_mkwrite(struct vm_area_struct *vma, struct page *page)
-#endif
 {
        struct inode *inode = vma->vm_file->f_dentry->d_inode;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30)
        struct page *page = vmf->page;
        struct ceph_mds_client *mdsc = &ceph_inode_to_client(inode)->mdsc;
-#endif
        loff_t off = page->index << PAGE_CACHE_SHIFT;
        loff_t size, len;
        struct page *locked_page = NULL;
@@ -1105,7 +1066,6 @@ static int ceph_page_mkwrite(struct vm_area_struct *vma, struct page *page)
        ret = ceph_write_begin(vma->vm_file, inode->i_mapping, off, len, 0,
                               &locked_page, &fsdata);
        WARN_ON(page != locked_page);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30)
        if (!ret) {
                /*
                 * doing the following, instead of calling
@@ -1119,11 +1079,6 @@ static int ceph_page_mkwrite(struct vm_area_struct *vma, struct page *page)
        } else {
                ret = VM_FAULT_SIGBUS;
        }
-#else
-       if (!ret)
-               ceph_write_end(vma->vm_file, inode->i_mapping, off, len, len,
-                              locked_page, fsdata);
-#endif
        dout(10, "page_mkwrite %p %llu~%llu = %d\n", inode, off, len, ret);
        return ret;
 }
index 842a306d8dab7c68c8d644c103ed01a52ca57cf4..9e87065d96d7869d27f07d092fe3f98061e905d7 100644 (file)
@@ -105,11 +105,7 @@ static struct dentry *__fh_to_dentry(struct super_block *sb,
                        return ERR_PTR(err ? err : -ESTALE);
        }
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28)
        dentry = d_obtain_alias(inode);
-#else
-       dentry = d_alloc_anon(inode);
-#endif
 
        if (!dentry) {
                derr(10, "fh_to_dentry %llx.%x -- inode %p but ENOMEM\n",
index 6e5fe28246e78ce56138978fc0c9eb99402cb55c..7c45abd7cd1460b3cbc655d9cb55ad32e64148b3 100755 (executable)
@@ -26,7 +26,7 @@ git branch series_start
 git cherry-pick 5556036065d8b04b2f7dd439fbf0d710e295cd44
 
 git add Documentation/filesystems/ceph.txt
-git commit -F - <<EOF
+git commit -s -F - <<EOF
 ceph: documentation
 
 Mount options, syntax.
@@ -36,7 +36,7 @@ EOF
 git add $target/ceph/ceph_fs.h
 git add $target/ceph/msgr.h
 git add $target/ceph/rados.h
-git commit -F - <<EOF
+git commit -s -F - <<EOF
 ceph: on-wire types
 
 These headers describe the types used to exchange messages between the
@@ -52,7 +52,7 @@ EOF
 git add $target/ceph/types.h
 git add $target/ceph/super.h
 git add $target/ceph/ceph_ver.h
-git commit -F - <<EOF
+git commit -s -F - <<EOF
 ceph: client types
 
 We first define constants, types, and prototypes for the kernel client
@@ -64,7 +64,7 @@ monitor clients, and the messaging layer.
 EOF
 
 git add $target/ceph/super.c
-git commit -F - <<EOF
+git commit -s -F - <<EOF
 ceph: super.c
 
 Mount option parsing, client setup and teardown, and a few odds and
@@ -74,7 +74,7 @@ EOF
 
 
 git add $target/ceph/inode.c
-git commit -F - <<EOF
+git commit -s -F - <<EOF
 ceph: inode operations
 
 Inode cache and inode operations.  We also include routines to
@@ -93,7 +93,7 @@ to reattach it in the correct position in the hierarchy.
 EOF
 
 git add $target/ceph/dir.c
-git commit -F - <<EOF
+git commit -s -F - <<EOF
 ceph: directory operations
 
 Directory operations, including lookup, are defined here.  We take
@@ -110,7 +110,7 @@ may be needed.
 EOF
 
 git add $target/ceph/file.c
-git commit -F - <<EOF
+git commit -s -F - <<EOF
 ceph: file operations
 
 File open and close operations, and read and write methods that ensure
@@ -122,7 +122,7 @@ back to the MDS.
 EOF
 
 git add $target/ceph/addr.c
-git commit -F - <<EOF
+git commit -s -F - <<EOF
 ceph: address space operations
 
 The ceph address space methods are concerned primarily with managing
@@ -141,7 +141,7 @@ git add $target/ceph/mds_client.h
 git add $target/ceph/mds_client.c
 git add $target/ceph/mdsmap.h
 git add $target/ceph/mdsmap.c
-git commit -F - <<EOF
+git commit -s -F - <<EOF
 ceph: MDS client
 
 The MDS client is responsible for submitting requests to the MDS
@@ -168,7 +168,7 @@ git add $target/ceph/osd_client.h
 git add $target/ceph/osd_client.c
 git add $target/ceph/osdmap.h
 git add $target/ceph/osdmap.c
-git commit -F - <<EOF
+git commit -s -F - <<EOF
 ceph: OSD client
 
 The OSD client is responsible for reading and writing data from/to the
@@ -189,7 +189,7 @@ git add $target/ceph/crush/crush.c
 git add $target/ceph/crush/mapper.h
 git add $target/ceph/crush/mapper.c
 git add $target/ceph/crush/hash.h
-git commit -F - <<EOF
+git commit -s -F - <<EOF
 ceph: CRUSH mapping algorithm
 
 CRUSH is a fancy hash function designed to map inputs onto a dynamic
@@ -208,7 +208,7 @@ EOF
 
 git add $target/ceph/mon_client.h
 git add $target/ceph/mon_client.c
-git commit -F - <<EOF
+git commit -s -F - <<EOF
 ceph: monitor client
 
 The monitor cluster is responsible for managing cluster membership
@@ -219,7 +219,7 @@ MDS and OSD maps, and getting statfs() information.
 EOF
 
 git add $target/ceph/caps.c
-git commit -F - <<EOF
+git commit -s -F - <<EOF
 ceph: capability management
 
 The Ceph metadata servers control client access to data by issuing
@@ -243,7 +243,7 @@ those that are "wanted" due to an open file) are explicitly released.
 EOF
 
 git add $target/ceph/snap.c
-git commit -F - <<EOF
+git commit -s -F - <<EOF
 ceph: snapshot management
 
 Ceph snapshots rely on client cooperation in determining which
@@ -262,7 +262,7 @@ EOF
 git add $target/ceph/decode.h
 git add $target/ceph/messenger.h
 git add $target/ceph/messenger.c
-git commit -F - <<EOF
+git commit -s -F - <<EOF
 ceph: messenger library
 
 A generic message passing library is used to communicate with all
@@ -275,7 +275,7 @@ This implementation is based on TCP.
 EOF
 
 git add $target/ceph/export.c
-git commit -F - <<EOF
+git commit -s -F - <<EOF
 ceph: nfs re-export support
 
 Basic NFS re-export support is included.  This mostly works.  However,
@@ -286,7 +286,7 @@ EOF
 
 git add $target/ceph/ioctl.h
 git add $target/ceph/ioctl.c
-git commit -F - <<EOF
+git commit -s -F - <<EOF
 ceph: ioctls
 
 A few Ceph ioctls for getting and setting file layout (striping)
@@ -295,7 +295,7 @@ parameters.
 EOF
 
 git add $target/ceph/ceph_debug.h
-git commit -F - <<EOF
+git commit -s -F - <<EOF
 ceph: debugging
 
 Some debugging infrastructure, including the ability to adjust the
@@ -304,7 +304,7 @@ level of debug output on a per-file basis.
 EOF
 
 git add $target/ceph/debugfs.c
-git commit -F - <<EOF
+git commit -s -F - <<EOF
 ceph: debugfs
 
 Basic state information is available via /debug/ceph, including
@@ -316,7 +316,7 @@ EOF
 git apply $cephtree/src/kernel/kbuild.staging.patch
 git add $target/ceph/Makefile
 git add $target/ceph/Kconfig
-git commit -F - <<EOF $target/Kconfig $target/ceph/Kconfig $target/Makefile $target/ceph/Makefile
+git commit -s -F - <<EOF $target/Kconfig $target/ceph/Kconfig $target/Makefile $target/ceph/Makefile
 ceph: Kconfig, Makefile
 
 Kconfig options and Makefile.
index 673373bc00acf8c9b57767289c09c679c5b1ad95..06b062d3605e8d55c1ba88f54b34ef7dbda3515c 100644 (file)
@@ -1274,13 +1274,8 @@ retry:
                dout(10, "__do_pending_vmtruncate %p flushing snaps first\n",
                     inode);
                spin_unlock(&inode->i_lock);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30)
                filemap_write_and_wait_range(&inode->i_data, 0,
                                             CEPH_FILE_MAX_SIZE);
-#else
-# warning i may not flush all data after a snapshot + truncate.. i export need 2.6.30
-               filemap_write_and_wait(&inode->i_data);
-#endif
                goto retry;
        }
 
index 9332578b7eac2bf3242bfd59674674cc4a46606b..6d0d3d68a54257cea3d6aebc168b7aaa82c82ba3 100644 (file)
@@ -1197,13 +1197,8 @@ static struct ceph_msg *create_request_message(struct ceph_mds_client *mdsc,
 
        head->mdsmap_epoch = cpu_to_le32(mdsc->mdsmap->m_epoch);
        head->op = cpu_to_le32(req->r_op);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29)
        head->caller_uid = cpu_to_le32(current_fsuid());
        head->caller_gid = cpu_to_le32(current_fsgid());
-#else
-       head->caller_uid = cpu_to_le32(current->fsuid);
-       head->caller_gid = cpu_to_le32(current->fsgid);
-#endif
        head->args = req->r_args;
 
        ceph_encode_filepath(&p, end, ino1, path1);
index 040ceb82be38661c0b8fc29a23be38b61c7118fb..ddad5c12a6de2f2bab4c0163d478762413a5a26c 100644 (file)
@@ -927,24 +927,14 @@ int ceph_osdc_readpages(struct ceph_osd_client *osdc,
                        page = pages[i];
                        dout(20, "readpages zeroing %d %p from %d\n", i, page,
                             (int)(read & ~PAGE_CACHE_MASK));
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)
                        zero_user_segment(page, read & ~PAGE_CACHE_MASK,
                                          PAGE_CACHE_SIZE);
-#else
-                       zero_user_page(page, read & ~PAGE_CACHE_MASK,
-                              PAGE_CACHE_SIZE - (read & ~PAGE_CACHE_MASK),
-                              KM_USER0);
-#endif
                        read += PAGE_CACHE_SIZE;
                }
                for (i = read >> PAGE_CACHE_SHIFT; i < num_pages; i++) {
                        page = req->r_pages[i];
                        dout(20, "readpages zeroing %d %p\n", i, page);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)
                        zero_user_segment(page, 0, PAGE_CACHE_SIZE);
-#else
-                       zero_user_page(page, 0, PAGE_CACHE_SIZE, KM_USER0);
-#endif
                }
        }
 
index f1383f135fc24a682bbea8d12acadcf9917536c9..d39f8e4c8962e56ad838e808697038303dcf16f7 100644 (file)
@@ -154,11 +154,7 @@ static int ceph_show_options(struct seq_file *m, struct vfsmount *mnt)
 struct kmem_cache *ceph_inode_cachep;
 struct kmem_cache *ceph_cap_cachep;
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
 static void ceph_inode_init_once(void *foo)
-#else
-static void ceph_inode_init_once(struct kmem_cache *cachep, void *foo)
-#endif
 {
        struct ceph_inode_info *ci = foo;
        inode_init_once(&ci->vfs_inode);
@@ -193,28 +189,13 @@ static void destroy_caches(void)
        kmem_cache_destroy(ceph_cap_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;
-
        client->mount_state = CEPH_MOUNT_SHUTDOWN;
        return;
 }
@@ -801,11 +782,7 @@ static struct dentry *open_root_dentry(struct ceph_client *client,
                    client->sb->s_root == NULL)
                        root = d_alloc_root(req->r_target_inode);
                else
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28)
                        root = d_obtain_alias(req->r_target_inode);
-#else
-                       root = d_alloc_anon(req->r_target_inode);
-#endif
                req->r_target_inode = NULL;
                dout(30, "open_root_inode success, root dentry is %p\n", root);
        } else {
@@ -1077,13 +1054,10 @@ static int ceph_init_bdi(struct super_block *sb, struct ceph_client *client)
 
        err = bdi_init(&client->backing_dev_info);
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26)
        if (err < 0)
                return err;
 
        err = bdi_register_dev(&client->backing_dev_info, sb->s_dev);
-#endif
-
        return err;
 }
 
@@ -1153,9 +1127,7 @@ static void ceph_kill_sb(struct super_block *s)
        struct ceph_client *client = ceph_sb_to_client(s);
        dout(1, "kill_sb %p\n", s);
        ceph_mdsc_pre_umount(&client->mdsc);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26)
        bdi_unregister(&client->backing_dev_info);
-#endif
        kill_anon_super(s);    /* will call put_super after sb is r/o */
        bdi_destroy(&client->backing_dev_info);
        ceph_destroy_client(client);