packages: submount/submount-subfs.patch - refreshed and updated (for kernel...

charles charles at pld-linux.org
Tue Jun 9 09:21:02 CEST 2009


Author: charles                      Date: Tue Jun  9 07:21:02 2009 GMT
Module: packages                      Tag: HEAD
---- Log message:
- refreshed and updated (for kernel >= 2.6.27)

---- Files affected:
packages/submount:
   submount-subfs.patch (1.2 -> 1.3) 

---- Diffs:

================================================================
Index: packages/submount/submount-subfs.patch
diff -u packages/submount/submount-subfs.patch:1.2 packages/submount/submount-subfs.patch:1.3
--- packages/submount/submount-subfs.patch:1.2	Fri Oct 20 02:31:25 2006
+++ packages/submount/submount-subfs.patch	Tue Jun  9 09:20:57 2009
@@ -1,15 +1,66 @@
---- submount-0.9/subfs-0.9/subfs.c.orig	2004-02-26 23:54:58.000000000 +0100
-+++ submount-0.9/subfs-0.9/subfs.c	2006-10-19 02:24:11.987932309 +0200
-@@ -25,6 +25,8 @@
+diff -U 3 -H -d -r -N -- submount-0.9~/subfs-0.9/subfs.c submount-0.9/subfs-0.9/subfs.c
+--- submount-0.9~/subfs-0.9/subfs.c	2004-02-26 23:54:58.000000000 +0100
++++ submount-0.9/subfs-0.9/subfs.c	2009-06-09 07:45:12.000000000 +0200
+@@ -17,14 +17,26 @@
+ #include <asm/uaccess.h>
+ #include <linux/list.h>
+ #include <linux/mount.h>
+-#include <linux/namespace.h>
++#include <linux/version.h>
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
++ #include <linux/nsproxy.h>
++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
++ #include <linux/mnt_namespace.h>
++#else
++ #include <linux/namespace.h>
++#endif
+ #include <linux/namei.h>
+ #include <linux/dcache.h>
+ #include <linux/sysfs.h>
+-#include <asm/semaphore.h>
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
++ #include <linux/semaphore.h>
++#else
++ #include <asm/semaphore.h>
++#endif
  #include <asm/signal.h>
  #include <linux/signal.h>
  #include <linux/sched.h>
-+#include <linux/version.h>
 +#include <linux/rcupdate.h>
  
  #include "subfs.h"
  
-@@ -94,11 +96,19 @@
+@@ -47,7 +59,11 @@
+ 	/* Get the head of the global mount list from the init process. */
+ 	/* Is there a better way? */
+ 	init_fs = init_task.fs;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25)
++	head = &init_fs->root.mnt->mnt_list;
++#else
+ 	head = &init_fs->rootmnt->mnt_list;
++#endif
+ 
+ 	/* Go through the list and look for a superblock pointer match. */
+ 	list_for_each_safe(entry, lh, head) {
+@@ -72,10 +88,17 @@
+ 	struct vfsmount *old_pwdmnt;
+ 
+ 	write_lock(&fs->lock);
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25)
++	old_pwd = fs->pwd.dentry;
++	old_pwdmnt = fs->pwd.mnt;
++	fs->pwd.mnt = mntget(mnt);
++	fs->pwd.dentry = dget(dentry);
++#else
+ 	old_pwd = fs->pwd;
+ 	old_pwdmnt = fs->pwdmnt;
+ 	fs->pwdmnt = mntget(mnt);
+ 	fs->pwd = dget(dentry);
++#endif
+ 	write_unlock(&fs->lock);
+ 
+ 	if (old_pwd) {
+@@ -94,11 +117,19 @@
  	struct task_struct *task = current;
  	int signal = SIGCONT;
  
@@ -29,7 +80,31 @@
  	set_tsk_thread_flag(task, TIF_SIGPENDING);
  	return;
  }
-@@ -187,11 +197,11 @@
+@@ -134,14 +165,23 @@
+ 	char *envp[2] = { "HOME=/", NULL };
+ 	char *path_buf;
+ 	int result, len = 0;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25)
++	struct path p;
++#endif
+ 
+ 	argv[1] = sfs_mnt->device;
+ 	path_buf = (char *) __get_free_page(GFP_KERNEL);
+ 	if (!path_buf)
+ 		return -ENOMEM;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25)
++	p.mnt = sfs_mnt->mount;
++	p.dentry = p.mnt->mnt_root;
++	argv[2] = d_path(&p, path_buf, PAGE_SIZE);
++#else
+ 	argv[2] =
+ 	    d_path(sfs_mnt->mount->mnt_mountpoint,
+ 		   sfs_mnt->mount->mnt_parent, path_buf, PAGE_SIZE);
++#endif
+ 	argv[3] = sfs_mnt->req_fs;
+ 	if (!(argv[4] = kmalloc(17, GFP_KERNEL))) {
+ 		free_page((unsigned long) path_buf);
+@@ -187,11 +227,11 @@
  	if (&sfs_mnt->mount->mnt_mounts == sfs_mnt->mount->mnt_mounts.next) {
  		result = mount_real_fs(sfs_mnt);
  		if (result) {
@@ -44,32 +119,56 @@
  			return ERR_PTR(-ENOMEDIUM);
  		}
  		if (&sfs_mnt->mount->mnt_mounts
-@@ -221,6 +231,7 @@
+@@ -221,18 +261,35 @@
  	struct vfsmount *child;
  
  	/* This is ugly, but prevents a lockup during mount. */
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 16)
++	mutex_unlock(&dir->i_mutex);
++#else
  	up(&dir->i_sem);
++#endif
  	if (down_interruptible(&sfs_mnt->sem)) {
- 		down(&dir->i_sem);/*put the dir sem back down if interrupted*/
-@@ -229,6 +240,16 @@
+-		down(&dir->i_sem);/*put the dir sem back down if interrupted*/
++		/*put the dir sem back down if interrupted*/
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
++		mutex_lock(&dir->i_mutex);
++#else
++		down(&dir->i_sem);
++#endif
+ 		return ERR_PTR(-ERESTARTSYS);
+ 	}
  	child = get_child_mount(sfs_mnt);
  	up(&sfs_mnt->sem);
- 	down(&dir->i_sem);
-+#else
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
 +	mutex_lock(&dir->i_mutex);
-+	if (down_interruptible(&sfs_mnt->sem)) {
-+		mutex_unlock(&dir->i_mutex);
-+		return ERR_PTR(-ERESTARTSYS);
-+	}
-+	child = get_child_mount(sfs_mnt);
-+	up(&sfs_mnt->sem);
-+	mutex_unlock(&dir->i_mutex);
++#else
+ 	down(&dir->i_sem);
 +#endif
  	if (IS_ERR(child))
  		return (void *) child;
  	subfs_send_signal();
-@@ -262,9 +283,15 @@
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25)
++	if (sfs_mnt->mount == current->fs->pwd.mnt)
++#else
+ 	if (sfs_mnt->mount == current->fs->pwdmnt)
++#endif
+ 		subfs_set_fs_pwd(current->fs, child, child->mnt_root);
+ 	return ERR_PTR(-ERESTARTSYS);
+ }
+@@ -254,7 +311,11 @@
+ 	if (IS_ERR(child))
+ 		return PTR_ERR(child);
+ 	subfs_send_signal();
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25)
++	if (sfs_mnt->mount == current->fs->pwd.mnt)
++#else
+ 	if (sfs_mnt->mount == current->fs->pwdmnt)
++#endif
+ 		subfs_set_fs_pwd(current->fs, child, child->mnt_root);
+ 	return -ERESTARTSYS;
+ }
+@@ -262,9 +323,15 @@
  
  /*  Implements the statfs method so df and such will work on the mountpoint.
   */
@@ -85,7 +184,17 @@
  	struct vfsmount *child;
  	if (down_interruptible(&sfs_mnt->sem))
  		return -ERESTARTSYS;
-@@ -388,6 +415,7 @@
+@@ -286,7 +353,9 @@
+ 	if (ret) {
+ 		ret->i_mode = mode;
+ 		ret->i_uid = ret->i_gid = 0;
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
+ 		ret->i_blksize = PAGE_CACHE_SIZE;
++#endif
+ 		ret->i_blocks = 0;
+ 		ret->i_atime = ret->i_mtime = ret->i_ctime = CURRENT_TIME;
+ 		ret->i_fop = &subfs_file_ops;
+@@ -388,6 +457,7 @@
   * subfs_mount structure is pointed to by the s_fs_info field of the
   * superblock structure.
   */
@@ -93,7 +202,7 @@
  static struct super_block *subfs_get_super(struct file_system_type *fst,
  				int flags, const char *devname, void *data)
  {
-@@ -416,7 +444,39 @@
+@@ -416,7 +486,39 @@
  	newmount->sb->s_fs_info = newmount;
  	return newmount->sb;
  }
@@ -133,8 +242,9 @@
  
  /* subfs_kill_super is the subfs implementation of the kill_sb method.
   * It should be called only on umount.  It cleans up the appropriate
---- submount-0.9/subfs-0.9/subfs.h.orig	2004-02-26 23:54:58.000000000 +0100
-+++ submount-0.9/subfs-0.9/subfs.h	2006-10-19 02:14:56.944311764 +0200
+diff -U 3 -H -d -r -N -- submount-0.9~/subfs-0.9/subfs.h submount-0.9/subfs-0.9/subfs.h
+--- submount-0.9~/subfs-0.9/subfs.h	2004-02-26 23:54:58.000000000 +0100
++++ submount-0.9/subfs-0.9/subfs.h	2009-06-09 06:55:59.000000000 +0200
 @@ -33,8 +33,17 @@
  
  
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/submount/submount-subfs.patch?r1=1.2&r2=1.3&f=u



More information about the pld-cvs-commit mailing list