[4429] in arla-drinkers

home help back first fref pref prev next nref lref last post

Arla on Linux 2.6.27

daemon@ATHENA.MIT.EDU (=?ISO-8859-1?Q?Bo_Brant=E9n?=)
Mon Oct 6 15:29:01 2008

From arla-drinkers-bounces@stacken.kth.se Mon Oct 06 19:29:01 2008
Return-Path: <arla-drinkers-bounces@stacken.kth.se>
Delivered-To: arla-drinkers-mtg@bloom-picayune.mit.edu
Received: (qmail 21779 invoked from network); 6 Oct 2008 19:29:01 -0000
Received: from mx2.kth.se (130.237.48.98)
  by charon.mit.edu with SMTP; 6 Oct 2008 19:29:01 -0000
Received: from localhost (localhost [127.0.0.1])
	by mx2.kth.se (Postfix) with ESMTP id 9305010A1CA;
	Mon,  6 Oct 2008 21:28:58 +0200 (CEST)
X-Virus-Scanned: by amavisd-new at kth.se
Received: from mx2.kth.se ([127.0.0.1])
	by localhost (mx2.kth.se [127.0.0.1]) (amavisd-new, port 10024)
	with LMTP id mrXSxLATKmiH; Mon,  6 Oct 2008 21:28:56 +0200 (CEST)
Received: from tapas.stacken.kth.se (tapas.stacken.kth.se [130.237.234.140])
	by mx2.kth.se (Postfix) with ESMTP id DA1C710A1C8;
	Mon,  6 Oct 2008 21:28:38 +0200 (CEST)
Received: from tapas.stacken.kth.se (localhost [127.0.0.1])
	by tapas.stacken.kth.se (Postfix) with ESMTP id B8EE651D5E;
	Mon,  6 Oct 2008 21:28:37 +0200 (CEST)
X-Original-To: arla-drinkers@tapas.stacken.kth.se
Delivered-To: arla-drinkers@tapas.stacken.kth.se
Received: from brev.stacken.kth.se (brev.stacken.kth.se [130.237.234.84])
	by tapas.stacken.kth.se (Postfix) with ESMTP id 3ABEE51D5E
	for <arla-drinkers@tapas.stacken.kth.se>;
	Mon,  6 Oct 2008 21:28:36 +0200 (CEST)
Received: from mx2.kth.se (mx2.kth.se [130.237.48.98])
	by brev.stacken.kth.se (8.12.10/8.12.10) with ESMTP id m96JSZvG009021
	for <arla-drinkers@stacken.kth.se>;
	Mon, 6 Oct 2008 21:28:35 +0200 (MET DST)
Received: from localhost (localhost [127.0.0.1])
	by mx2.kth.se (Postfix) with ESMTP id 7C89510A1B4
	for <arla-drinkers@stacken.kth.se>;
	Mon,  6 Oct 2008 21:28:30 +0200 (CEST)
X-Virus-Scanned: by amavisd-new at kth.se
Received: from mx2.kth.se ([127.0.0.1])
	by localhost (mx2.kth.se [127.0.0.1]) (amavisd-new, port 10024)
	with LMTP id ckWEFGN26fP4 for <arla-drinkers@stacken.kth.se>;
	Mon,  6 Oct 2008 21:28:25 +0200 (CEST)
Received: from mail.acc.umu.se (mail.acc.umu.se [IPv6:2001:6b0:e:2018::156])
	by mx2.kth.se (Postfix) with ESMTP id AAEC8109757
	for <arla-drinkers@stacken.kth.se>;
	Mon,  6 Oct 2008 21:28:25 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
	by amavisd-new (Postfix) with ESMTP id 51B93A36
	for <arla-drinkers@stacken.kth.se>;
	Mon,  6 Oct 2008 21:28:21 +0200 (MEST)
X-Virus-Scanned: amavisd-new at acc.umu.se
Received: from stalin.acc.umu.se (stalin.acc.umu.se [130.239.18.135])
	by mail.acc.umu.se (Postfix) with ESMTP id 13D39A35
	for <arla-drinkers@stacken.kth.se>;
	Mon,  6 Oct 2008 21:28:18 +0200 (MEST)
Received: by stalin.acc.umu.se (Postfix, from userid 10005)
	id E57232C; Mon,  6 Oct 2008 21:28:17 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
	by stalin.acc.umu.se (Postfix) with ESMTP id D53DE2B
	for <arla-drinkers@stacken.kth.se>;
	Mon,  6 Oct 2008 21:28:17 +0200 (CEST)
Date: Mon, 6 Oct 2008 21:28:17 +0200 (CEST)
From: =?ISO-8859-1?Q?Bo_Brant=E9n?= <bosse@acc.umu.se>
To: arla-drinkers@stacken.kth.se
Subject: Arla on Linux 2.6.27
Message-ID: <Pine.A41.4.64.0810062122530.803014@stalin.acc.umu.se>
MIME-Version: 1.0
X-BeenThere: arla-drinkers@stacken.kth.se
X-Mailman-Version: 2.1.6
Precedence: list
List-Id: Arla discussions <arla-drinkers.stacken.kth.se>
List-Unsubscribe: <https://lists.stacken.kth.se/mailman/listinfo/arla-drinkers>, 
	<mailto:arla-drinkers-request@stacken.kth.se?subject=unsubscribe>
List-Archive: <http://lists.stacken.kth.se/pipermail/arla-drinkers>
List-Post: <mailto:arla-drinkers@stacken.kth.se>
List-Help: <mailto:arla-drinkers-request@stacken.kth.se?subject=help>
List-Subscribe: <https://lists.stacken.kth.se/mailman/listinfo/arla-drinkers>, 
	<mailto:arla-drinkers-request@stacken.kth.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: arla-drinkers-bounces@stacken.kth.se
Errors-To: arla-drinkers-bounces@stacken.kth.se


Hello,

here is a new patch to get nnpfs to compile on Linux 2.6.27 (it includes 
my last patch for Linux 2.6.24)

diff -cr arla/nnpfs/linux/nnpfs_blocks.c arla-bo/nnpfs/linux/nnpfs_blocks.c
*** arla/nnpfs/linux/nnpfs_blocks.c	2008-03-08 22:38:16.000000000 +0100
--- arla-bo/nnpfs/linux/nnpfs_blocks.c	2008-10-06 19:13:20.000000000 +0200
***************
*** 403,414 ****
--- 403,423 ----
   	if (IS_ERR(dentry)) {
   	    ret = PTR_ERR(dentry);
   	} else {
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
   	    ret = vfs_create(nd.dentry->d_inode, dentry, S_IRUSR|S_IWUSR, &nd);
+ #else
+ 	    ret = vfs_create(nd.path.dentry->d_inode, dentry, S_IRUSR|S_IWUSR, &nd);
+ #endif
   	    dput(dentry);
   	}

+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
   	mutex_unlock(&nd.dentry->d_inode->i_mutex);
   	path_release(&nd);
+ #else
+ 	mutex_unlock(&nd.path.dentry->d_inode->i_mutex);
+ 	path_put(&nd.path);
+ #endif

   	if (ret) {
   	    printk("nnpfs_block_open(%s) create failed: %d\n", cachename, -ret);
***************
*** 422,433 ****
--- 431,450 ----
   	    ret = nnpfs_block_extend(node, offset);
   	}
       } else {
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
   	struct file *f = dentry_open(nd.dentry, nd.mnt, flags);
+ #else
+ 	struct file *f = dentry_open(nd.path.dentry, nd.path.mnt, flags);
+ #endif
   	if (IS_ERR(f)) {
   	    ret = PTR_ERR(f);
   	    printk("nnpfs_block_open(%s) open failed: %d\n", cachename, -ret);
   	    nnpfs_debug_oops();
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
   	    path_release(&nd);
+ #else
+ 	    path_put(&nd.path);
+ #endif
   	} else {
   	    *file = f;
   	}
diff -cr arla/nnpfs/linux/nnpfs_inodeops.c arla-bo/nnpfs/linux/nnpfs_inodeops.c
*** arla/nnpfs/linux/nnpfs_inodeops.c	2008-03-08 22:40:10.000000000 +0100
--- arla-bo/nnpfs/linux/nnpfs_inodeops.c	2008-10-06 21:03:57.000000000 +0200
***************
*** 138,149 ****
--- 138,151 ----
    *
    */

+ #if 0
   void
   nnpfs_print_lock(char *s, struct semaphore *sem)
   {
       NNPFSDEB(XDEBLOCK, ("lock: %s sem: %p count: %d\n",
   		      s, sem, (int)atomic_read(&sem->count)));
   }
+ #endif

   /*
    *
***************
*** 596,603 ****
--- 598,610 ----
    * We don't hold i_mutex.
    */

+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
   static int
   nnpfs_permission(struct inode *inode, int mode, struct nameidata *nd)
+ #else
+ static int
+ nnpfs_permission(struct inode *inode, int mode)
+ #endif
   {
       int error = 0;
       nnpfs_pag_t pag = nnpfs_get_pag();
diff -cr arla/nnpfs/linux/nnpfs_message.c arla-bo/nnpfs/linux/nnpfs_message.c
*** arla/nnpfs/linux/nnpfs_message.c	2006-12-11 17:40:24.000000000 +0100
--- arla-bo/nnpfs/linux/nnpfs_message.c	2008-10-06 19:51:49.000000000 +0200
***************
*** 735,743 ****
--- 735,749 ----
   		   "nnpfs_message_version failed path_lookup, "
   		   "errno: %d\n", error);
   	} else {
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
   	    nnpfsp->cacheroot = mntget(nd.mnt);
   	    nnpfsp->cachedir = dget(nd.dentry);
   	    path_release(&nd);
+ #else
+ 	    nnpfsp->cacheroot = mntget(nd.path.mnt);
+ 	    nnpfsp->cachedir = dget(nd.path.dentry);
+ 	    path_put(&nd.path);
+ #endif

   	    nnpfsp->uid = current->fsuid;
   	    nnpfsp->gid = current->fsgid;
diff -cr arla/nnpfs/linux/nnpfs_syscalls.c arla-bo/nnpfs/linux/nnpfs_syscalls.c
*** arla/nnpfs/linux/nnpfs_syscalls.c	2007-01-03 15:26:27.000000000 +0100
--- arla-bo/nnpfs/linux/nnpfs_syscalls.c	2008-10-06 20:09:04.000000000 +0200
***************
*** 147,152 ****
--- 147,154 ----
   #define SEC2PAG(s) (nnpfs_pag_t)(unsigned long)(s)
   #define PAG2SEC(p) (void *)(unsigned long)(p)

+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
+
   static int
   nnpfs_sec_task_alloc(struct task_struct *p)
   {
***************
*** 164,169 ****
--- 166,173 ----
   	p->security = NULL;
   }

+ #endif
+
   static nnpfs_pag_t
   nnpfs_get_pag_sec(void)
   {
***************
*** 188,198 ****
--- 192,204 ----
       return 0;
   }

+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
   static struct security_operations nnpfs_sec_ops = {
       .task_alloc_security = nnpfs_sec_task_alloc,
       .task_free_security = nnpfs_sec_task_free,
   //    .task_reparent_to_init = nnpfs_sec_reparent_to_init,
   };
+ #endif

   #endif /* CONFIG_SECURITY */

***************
*** 244,250 ****
--- 250,260 ----
   {
       struct group_info *old_gi = current->group_info;
       struct group_info *new_gi;
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
       int nblocks, count;
+ #else
+     unsigned int nblocks, count;
+ #endif
       int found = 0;
       int i, k;

***************
*** 528,534 ****
--- 538,548 ----
       putname(kname);
       if (error)
   	return ERR_PTR(error);
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
       return nd->dentry;
+ #else
+     return nd->path.dentry;
+ #endif
   }

   asmlinkage long
***************
*** 675,681 ****
--- 689,699 ----

    unlock:
       if (dentry)
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
   	path_release(&nd);
+ #else
+ 	path_put(&nd.path);
+ #endif

       NNPFSDEB(XDEBSYS, ("nnpfs_syscall returns error: %ld\n", error));

***************
*** 779,786 ****
   static int nnpfs_init_procfs(void)
   {
       struct proc_dir_entry *entry;
!
       nnpfs_procfs_dir = proc_mkdir(NNPFS_PROC_DIR, proc_root_fs);
       if (nnpfs_procfs_dir == NULL)
   	return -ENOMEM;

--- 797,808 ----
   static int nnpfs_init_procfs(void)
   {
       struct proc_dir_entry *entry;
! 
! #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)
       nnpfs_procfs_dir = proc_mkdir(NNPFS_PROC_DIR, proc_root_fs);
+ #else
+     nnpfs_procfs_dir = proc_mkdir("fs/" NNPFS_PROC_DIR, NULL);
+ #endif
       if (nnpfs_procfs_dir == NULL)
   	return -ENOMEM;

***************
*** 789,795 ****
--- 811,821 ----
       entry = create_proc_entry(NNPFS_PROC_NODE, 0666, nnpfs_procfs_dir);
       if (entry == NULL) {
   	NNPFSDEB(XDEBSYS, ("nnpfs_init_procfs: no node\n"));
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)
   	remove_proc_entry(NNPFS_PROC_DIR, proc_root_fs);
+ #else
+ 	remove_proc_entry("fs/" NNPFS_PROC_DIR, NULL);
+ #endif
   	return -ENOMEM;
       }

***************
*** 815,821 ****
--- 841,851 ----
       }
   #endif /* SYSCALLCOMPAT */
       remove_proc_entry(NNPFS_PROC_NODE, nnpfs_procfs_dir);
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)
       remove_proc_entry(NNPFS_PROC_DIR, proc_root_fs);
+ #else
+     remove_proc_entry("fs/" NNPFS_PROC_DIR, NULL);
+ #endif
   }

   #ifdef GROUPPAGS
***************
*** 840,851 ****
--- 870,883 ----
   install_afs_syscall(void)
   {
   #ifdef CONFIG_SECURITY
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
       if (register_security(&nnpfs_sec_ops))
   	NNPFSDEB(XDEBSYS,
   		 ("install_afs_syscall: nnpfs_init_sec failed\n"));
       else
   	nnpfs_sec_registered = 1;
   #endif
+ #endif

       nnpfs_init_procfs();

***************
*** 888,896 ****
--- 920,930 ----
   #endif /* SYSCALLHACK */

   #ifdef CONFIG_SECURITY
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
       if (nnpfs_sec_registered)
   	if (unregister_security(&nnpfs_sec_ops))
   	    printk(KERN_EMERG "nnpfs_exit_sec: couldn't unregister\n");
+ #endif
   #endif /* !CONFIG_SECURITY */

   #ifdef GROUPPAGS
diff -cr arla/nnpfs/linux/nnpfs_syscalls-lossage.c arla-bo/nnpfs/linux/nnpfs_syscalls-lossage.c
*** arla/nnpfs/linux/nnpfs_syscalls-lossage.c	2006-12-11 17:31:45.000000000 +0100
--- arla-bo/nnpfs/linux/nnpfs_syscalls-lossage.c	2008-10-06 19:17:03.000000000 +0200
***************
*** 63,68 ****
--- 63,73 ----
   		    unsigned long *offset,
   		    char **modname, char *namebuf);

+ #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,18)
+ #ifdef __x86_64__
+ extern rwlock_t tasklist_lock __attribute__((weak));
+ #endif
+ #endif
   static void **
   get_start_addr(void) {
   #ifdef __x86_64__
diff -cr arla/nnpfs/linux/nnpfs_vfsops.c arla-bo/nnpfs/linux/nnpfs_vfsops.c
*** arla/nnpfs/linux/nnpfs_vfsops.c	2006-12-11 17:43:35.000000000 +0100
--- arla-bo/nnpfs/linux/nnpfs_vfsops.c	2008-10-06 20:50:41.000000000 +0200
***************
*** 49,57 ****
--- 49,61 ----

   struct nnpfs nnpfs[NNNPFS];

+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
   static void nnpfs_read_inode(struct inode *inode);
+ #endif
   static void nnpfs_put_super(struct super_block *sb);
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
   static void nnpfs_put_inode(struct inode *inode);
+ #endif
   static void nnpfs_write_super(struct super_block * sb);

   #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
***************
*** 61,68 ****
--- 65,74 ----
   #endif

   static struct super_operations nnpfs_sops = { 
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
       read_inode		: nnpfs_read_inode,
       put_inode		: nnpfs_put_inode,
+ #endif
       alloc_inode		: nnpfs_node_alloc,
       destroy_inode	: nnpfs_node_free,
       drop_inode		: generic_delete_inode,
***************
*** 189,195 ****
--- 195,205 ----
   	if (error)
   	    ddev = ERR_PTR(error);
   	else
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
   	    ddev = nd.dentry;
+ #else
+ 	    ddev = nd.path.dentry;
+ #endif

   	if (!IS_ERR(ddev)) {
   	    minordevice = MINOR(ddev->d_inode->i_rdev);
***************
*** 273,278 ****
--- 283,289 ----
       NNPFSDEB(XDEBVFOPS, ("nnpfs_put_super exiting\n"));
   }

+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
   static void
   nnpfs_read_inode(struct inode *inode)
   {
***************
*** 339,344 ****
--- 350,356 ----

       up(&nnpfsp->inactive_sem);
   }
+ #endif // LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)

   static int
   nnpfs_statfs_int(struct super_block *sb, struct kstatfs *buf)
***************
*** 352,358 ****
--- 364,378 ----
       tmp.f_bavail  = 1024*1024*2-50;
       tmp.f_files   = 1024*1024;
       tmp.f_ffree   = 1024*1024-100;
+     tmp.f_fsid.val[0] = 0;
+     tmp.f_fsid.val[1] = 0;
       tmp.f_namelen = NAME_MAX;
+     tmp.f_frsize  = 0;
+     tmp.f_spare[0] = 0;
+     tmp.f_spare[1] = 0;
+     tmp.f_spare[2] = 0;
+     tmp.f_spare[3] = 0;
+     tmp.f_spare[4] = 0;
       *buf = tmp;
       return 0;
   }
_______________________________________________
Arla-drinkers mailing list
Arla-drinkers@stacken.kth.se
https://lists.stacken.kth.se/mailman/listinfo/arla-drinkers

home help back first fref pref prev next nref lref last post