[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dazuko-devel] Patch for vanilla kernel 2.6.22
From: |
Lino Sanfilippo |
Subject: |
[Dazuko-devel] Patch for vanilla kernel 2.6.22 |
Date: |
Tue, 10 Feb 2009 12:03:10 +0100 |
User-agent: |
IceDove 1.5.0.14eol (X11/20090105) |
Geschäftsführender Gesellschafter: Tjark Auerbach
Sitz der Gesellschaft: Tettnang
Handelsregister: Amtsgericht Ulm, HRB 630992
ALLGEMEINE GESCHÄFTSBEDINGUNGEN
Es gelten unsere Allgemeinen Geschäftsbedingungen
(AGB). Sie finden sie in der jeweils gültigen Fassung
im Internet unter http://www.avira.de/agb
***************************************************
diff -rup dazukofs-3.0.0-rc4/ctrl_dev.c dazukofs-3.0.0-rc4_2.6.22/ctrl_dev.c
--- dazukofs-3.0.0-rc4/ctrl_dev.c 2009-02-10 10:43:29.000000000 +0100
+++ dazukofs-3.0.0-rc4_2.6.22/ctrl_dev.c 2009-02-10 10:43:58.000000000
+0100
@@ -183,7 +183,7 @@ int dazukofs_ctrl_dev_init(int dev_major
/* create control device */
dev = device_create(dazukofs_class, NULL, MKDEV(dev_major, dev_minor),
- NULL, "%s.ctrl", DEVICE_NAME);
+ "%s.ctrl", DEVICE_NAME);
if (IS_ERR(dev)) {
err = PTR_ERR(dev);
goto error_out2;
diff -rup dazukofs-3.0.0-rc4/dentry.c dazukofs-3.0.0-rc4_2.6.22/dentry.c
--- dazukofs-3.0.0-rc4/dentry.c 2009-02-10 10:43:29.000000000 +0100
+++ dazukofs-3.0.0-rc4_2.6.22/dentry.c 2009-02-10 10:43:58.000000000 +0100
@@ -65,19 +65,19 @@ static int dazukofs_d_revalidate(struct
lower_mnt = GET_LOWER_MNT(dentry);
- vfsmount_save = nd->path.mnt;
- dentry_save = nd->path.dentry;
+ vfsmount_save = nd->mnt;
+ dentry_save = nd->dentry;
- nd->path.mnt = mntget(lower_mnt);
- nd->path.dentry = dget(lower_dentry);
+ nd->mnt = mntget(lower_mnt);
+ nd->dentry = dget(lower_dentry);
valid = lower_dentry->d_op->d_revalidate(lower_dentry, nd);
mntput(lower_mnt);
dput(lower_dentry);
- nd->path.mnt = vfsmount_save;
- nd->path.dentry = dentry_save;
+ nd->mnt = vfsmount_save;
+ nd->dentry = dentry_save;
/* update the inode, even if d_revalidate() != 1 */
if (dentry->d_inode) {
diff -rup dazukofs-3.0.0-rc4/event.c dazukofs-3.0.0-rc4_2.6.22/event.c
--- dazukofs-3.0.0-rc4/event.c 2009-02-10 10:43:29.000000000 +0100
+++ dazukofs-3.0.0-rc4_2.6.22/event.c 2009-02-10 10:43:58.000000000 +0100
@@ -23,7 +23,7 @@
#include <linux/file.h>
#include <linux/fs.h>
#include <linux/mount.h>
-#include <linux/freezer.h>
+
#include "dev.h"
#include "dazukofs_fs.h"
@@ -113,21 +113,21 @@ int dazukofs_init_events(void)
dazukofs_group_cachep =
kmem_cache_create("dazukofs_group_cache",
sizeof(struct dazukofs_group), 0,
- SLAB_HWCACHE_ALIGN, NULL);
+ SLAB_HWCACHE_ALIGN, NULL, NULL);
if (!dazukofs_group_cachep)
goto error_out;
dazukofs_event_container_cachep =
kmem_cache_create("dazukofs_event_container_cache",
sizeof(struct dazukofs_event_container), 0,
- SLAB_HWCACHE_ALIGN, NULL);
+ SLAB_HWCACHE_ALIGN, NULL, NULL);
if (!dazukofs_event_container_cachep)
goto error_out;
dazukofs_event_cachep =
kmem_cache_create("dazukofs_event_cache",
sizeof(struct dazukofs_event), 0,
- SLAB_HWCACHE_ALIGN, NULL);
+ SLAB_HWCACHE_ALIGN, NULL, NULL);
if (!dazukofs_event_cachep)
goto error_out;
@@ -165,8 +165,8 @@ static int capture_group_count(int *cach
static int get_group_count(void)
{
int cache = 0;
- int ret = wait_event_freezable(__group_count_queue,
- capture_group_count(&cache) == 0);
+ int ret = wait_event_interruptible(__group_count_queue,
+ capture_group_count(&cache) == 0);
if (ret == 0)
ret = __group_count;
return ret;
@@ -729,7 +729,7 @@ int dazukofs_check_access(struct dentry
put_group_count();
/* wait until event completely processed or signal */
- err = wait_event_freezable(evt->queue, event_assigned(evt) == 0);
+ err = wait_event_interruptible(evt->queue, event_assigned(evt) == 0);
if (evt->deny)
err = -EPERM;
@@ -1004,9 +1004,9 @@ int dazukofs_get_event(unsigned long gro
}
while (1) {
- ret = wait_event_freezable(grp->queue,
- is_event_available(grp) ||
- grp->deprecated);
+ ret = wait_event_interruptible(grp->queue,
+ is_event_available(grp) ||
+ grp->deprecated);
if (ret != 0)
break;
diff -rup dazukofs-3.0.0-rc4/group_dev.c dazukofs-3.0.0-rc4_2.6.22/group_dev.c
--- dazukofs-3.0.0-rc4/group_dev.c 2009-02-10 10:43:29.000000000 +0100
+++ dazukofs-3.0.0-rc4_2.6.22/group_dev.c 2009-02-10 10:43:58.000000000
+0100
@@ -210,7 +210,7 @@ int dazukofs_group_dev_init(int dev_majo
/* create group devices */
for (i = 0; i < GROUP_COUNT; i++) {
dev = device_create(dazukofs_class, NULL,
- MKDEV(dev_major, dev_minor_end), NULL,
+ MKDEV(dev_major, dev_minor_end),
"%s.%d", DEVICE_NAME, i);
if (IS_ERR(dev)) {
err = PTR_ERR(dev);
diff -rup dazukofs-3.0.0-rc4/ign_dev.c dazukofs-3.0.0-rc4_2.6.22/ign_dev.c
--- dazukofs-3.0.0-rc4/ign_dev.c 2009-02-10 10:43:29.000000000 +0100
+++ dazukofs-3.0.0-rc4_2.6.22/ign_dev.c 2009-02-10 10:43:58.000000000 +0100
@@ -144,7 +144,7 @@ int dazukofs_ign_dev_init(int dev_major,
dazukofs_ign_cachep =
kmem_cache_create("dazukofs_ign_cache",
sizeof(struct dazukofs_proc), 0,
- SLAB_HWCACHE_ALIGN, NULL);
+ SLAB_HWCACHE_ALIGN, NULL, NULL);
if (!dazukofs_ign_cachep) {
err = -ENOMEM;
goto error_out1;
@@ -159,7 +159,7 @@ int dazukofs_ign_dev_init(int dev_major,
/* create ignore device */
dev = device_create(dazukofs_class, NULL, MKDEV(dev_major, dev_minor),
- NULL, "%s.ign", DEVICE_NAME);
+ "%s.ign", DEVICE_NAME);
if (IS_ERR(dev)) {
err = PTR_ERR(dev);
goto error_out3;
diff -rup dazukofs-3.0.0-rc4/inode.c dazukofs-3.0.0-rc4_2.6.22/inode.c
--- dazukofs-3.0.0-rc4/inode.c 2009-02-10 10:43:29.000000000 +0100
+++ dazukofs-3.0.0-rc4_2.6.22/inode.c 2009-02-10 10:43:58.000000000 +0100
@@ -294,19 +294,19 @@ static int dazukofs_create(struct inode
mutex_lock_nested(&(lower_dentry_parent_inode->i_mutex),
I_MUTEX_PARENT);
- vfsmount_save = nd->path.mnt;
- dentry_save = nd->path.dentry;
+ vfsmount_save = nd->mnt;
+ dentry_save = nd->dentry;
- nd->path.mnt = mntget(lower_mnt);
- nd->path.dentry = dget(lower_dentry);
+ nd->mnt = mntget(lower_mnt);
+ nd->dentry = dget(lower_dentry);
err = vfs_create(lower_dentry_parent_inode, lower_dentry, mode, nd);
mntput(lower_mnt);
dput(lower_dentry);
- nd->path.mnt = vfsmount_save;
- nd->path.dentry = dentry_save;
+ nd->mnt = vfsmount_save;
+ nd->dentry = dentry_save;
if (err)
goto out;
@@ -340,7 +340,8 @@ static int dazukofs_symlink(struct inode
mutex_lock_nested(&(lower_dentry_parent_inode->i_mutex),
I_MUTEX_PARENT);
- err = vfs_symlink(lower_dentry_parent_inode, lower_dentry, symname);
+ err = vfs_symlink(lower_dentry_parent_inode, lower_dentry, symname,
+ S_IALLUGO);
if (err)
goto out;
@@ -452,9 +453,37 @@ static void dazukofs_put_link(struct den
* Description: Called by the VFS to check for access rights on a
* POSIX-like filesystem.
*/
-static int dazukofs_permission(struct inode *inode, int mask)
+static int dazukofs_permission(struct inode *inode, int mask,
+ struct nameidata *nd)
{
- return inode_permission(GET_LOWER_INODE(inode), mask);
+ struct vfsmount *lower_mnt = NULL;
+ struct dentry *lower_dentry = NULL;
+ struct vfsmount *vfsmnt_save = NULL;
+ struct dentry *dentry_save = NULL;
+ int err;
+
+ if (nd) {
+ lower_mnt = GET_LOWER_MNT(nd->dentry);
+ lower_dentry = GET_LOWER_DENTRY(nd->dentry);
+
+ vfsmnt_save = nd->mnt;
+ dentry_save = nd->dentry;
+
+ nd->mnt = mntget(lower_mnt);
+ nd->dentry = dget(lower_dentry);
+ }
+
+ err = permission(GET_LOWER_INODE(inode), mask, nd);
+
+ if (nd) {
+ mntput(lower_mnt);
+ dput(lower_dentry);
+
+ nd->mnt = vfsmnt_save;
+ nd->dentry = dentry_save;
+ }
+
+ return err;
}
/**
diff -rup dazukofs-3.0.0-rc4/Makefile dazukofs-3.0.0-rc4_2.6.22/Makefile
--- dazukofs-3.0.0-rc4/Makefile 2009-02-10 10:43:29.000000000 +0100
+++ dazukofs-3.0.0-rc4_2.6.22/Makefile 2009-02-10 10:43:58.000000000 +0100
@@ -10,7 +10,7 @@ obj-m += dazukofs.o
dazukofs-objs := super.o inode.o file.o dentry.o mmap.o group_dev.o ign_dev.o
ctrl_dev.o dev.o event.o
dazukofs_modules:
- make -C $(DAZUKOFS_KERNEL_SRC) SUBDIRS="`pwd`" modules
+ make -Wall -C $(DAZUKOFS_KERNEL_SRC) SUBDIRS="`pwd`" modules
dazukofs_install: dazukofs_modules
mkdir -p $(DAZUKOFS_KERNEL_INSTALL)
Nur in dazukofs-3.0.0-rc4_2.6.22: patch-2.6.22-rc4.diff.
diff -rup dazukofs-3.0.0-rc4/super.c dazukofs-3.0.0-rc4_2.6.22/super.c
--- dazukofs-3.0.0-rc4/super.c 2009-02-10 10:43:29.000000000 +0100
+++ dazukofs-3.0.0-rc4_2.6.22/super.c 2009-02-10 10:43:58.000000000 +0100
@@ -158,8 +158,8 @@ static int dazukofs_read_super(struct su
if (err)
return err;
- lower_root = dget(nd.path.dentry);
- lower_mnt = mntget(nd.path.mnt);
+ lower_root = dget(nd.dentry);
+ lower_mnt = mntget(nd.mnt);
if (IS_ERR(lower_root)) {
err = PTR_ERR(lower_root);
@@ -170,6 +170,10 @@ static int dazukofs_read_super(struct su
err = -ENOENT;
goto out_put;
}
+ if (!S_ISDIR(lower_root->d_inode->i_mode)) {
+ err = -ENOENT;
+ goto out_put;
+ }
SET_LOWER_SB(sb, lower_root->d_sb);
sb->s_maxbytes = lower_root->d_sb->s_maxbytes;
@@ -184,7 +188,7 @@ out_put:
dput(lower_root);
mntput(lower_mnt);
out:
- path_put(&nd.path);
+ path_release(&nd);
return err;
}
@@ -213,15 +217,16 @@ static int dazukofs_get_sb(struct file_s
out_abort:
up_write(&sb->s_umount);
+ dput(sb->s_root);
deactivate_super(sb);
out:
return err;
}
-static void init_once(void *data)
+static void init_once(void *vptr, struct kmem_cache *cachep, unsigned long
flags)
{
struct dazukofs_inode_info *inode_info =
- (struct dazukofs_inode_info *)data;
+ (struct dazukofs_inode_info *)vptr;
memset(inode_info, 0, sizeof(struct dazukofs_inode_info));
inode_init_once(&(inode_info->vfs_inode));
@@ -256,7 +261,7 @@ static int init_caches(void)
kmem_cache_create("dazukofs_inode_info_cache",
sizeof(struct dazukofs_inode_info), 0,
SLAB_HWCACHE_ALIGN,
- init_once);
+ init_once, NULL);
if (!dazukofs_inode_info_cachep)
goto out_nomem;
@@ -264,7 +269,7 @@ static int init_caches(void)
kmem_cache_create("dazukofs_sb_info_cache",
sizeof(struct dazukofs_sb_info), 0,
SLAB_HWCACHE_ALIGN,
- NULL);
+ NULL, NULL);
if (!dazukofs_sb_info_cachep)
goto out_nomem;
@@ -272,7 +277,7 @@ static int init_caches(void)
kmem_cache_create("dazukofs_dentry_info_cache",
sizeof(struct dazukofs_dentry_info), 0,
SLAB_HWCACHE_ALIGN,
- NULL);
+ NULL, NULL);
if (!dazukofs_dentry_info_cachep)
goto out_nomem;
@@ -280,7 +285,7 @@ static int init_caches(void)
kmem_cache_create("dazukofs_file_info_cache",
sizeof(struct dazukofs_file_info), 0,
SLAB_HWCACHE_ALIGN,
- NULL);
+ NULL, NULL);
if (!dazukofs_file_info_cachep)
goto out_nomem;
diff -rup dazukofs-3.0.0-rc4/test/showfiles.c
dazukofs-3.0.0-rc4_2.6.22/test/showfiles.c
--- dazukofs-3.0.0-rc4/test/showfiles.c 2009-02-10 10:43:29.000000000 +0100
+++ dazukofs-3.0.0-rc4_2.6.22/test/showfiles.c 2009-02-10 10:43:58.000000000
+0100
@@ -73,6 +73,8 @@ int main(void)
}
print_access(&acc);
+
+ acc.deny = 1;
if (dazukofs_return_access(hndl, &acc) != 0) {
if (running) {
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Dazuko-devel] Patch for vanilla kernel 2.6.22,
Lino Sanfilippo <=