patch-2.4.0-test3 linux/ipc/shm.c
Next file: linux/kernel/acct.c
Previous file: linux/init/main.c
Back to the patch index
Back to the overall index
- Lines: 109
- Date:
Sat Jul 8 19:26:13 2000
- Orig file:
v2.4.0-test2/linux/ipc/shm.c
- Orig date:
Fri Jun 23 21:55:23 2000
diff -u --recursive --new-file v2.4.0-test2/linux/ipc/shm.c linux/ipc/shm.c
@@ -52,7 +52,6 @@
static void shm_put_super (struct super_block *);
static int shm_remount_fs (struct super_block *, int *, char *);
static void shm_read_inode (struct inode *);
-static void shm_write_inode(struct inode *);
static int shm_statfs (struct super_block *, struct statfs *);
static int shm_create (struct inode *,struct dentry *,int);
static struct dentry *shm_lookup (struct inode *,struct dentry *);
@@ -147,7 +146,6 @@
static struct super_operations shm_sops = {
read_inode: shm_read_inode,
- write_inode: shm_write_inode,
delete_inode: shm_delete,
put_super: shm_put_super,
statfs: shm_statfs,
@@ -306,7 +304,7 @@
return s;
out_no_root:
- printk(KERN_ERR "proc_read_super: get root inode failed\n");
+ printk(KERN_ERR "shm_read_super: get root inode failed\n");
iput(root_inode);
out_unlock:
return NULL;
@@ -371,10 +369,6 @@
return 0;
}
-static void shm_write_inode(struct inode * inode)
-{
-}
-
static void shm_read_inode(struct inode * inode)
{
int id;
@@ -831,6 +825,7 @@
return err;
}
+/* FIXME: maybe we need lock_kernel() here */
static void shm_delete (struct inode *ino)
{
int shmid = ino->i_ino;
@@ -1136,7 +1131,6 @@
up(&shm_ids.sem);
sprintf (name, SHM_FMT, shmid);
- lock_kernel();
dentry = lookup_one(name, lock_parent(shm_sb->s_root));
unlock_dir(shm_sb->s_root);
err = PTR_ERR(dentry);
@@ -1153,7 +1147,6 @@
}
dput (dentry);
bad_dentry:
- unlock_kernel();
return err;
}
@@ -1247,7 +1240,6 @@
sprintf (name, SHM_FMT, shmid);
- lock_kernel();
mntget(shm_fs_type.kern_mnt);
dentry = lookup_one(name, lock_parent(shm_sb->s_root));
unlock_dir(shm_sb->s_root);
@@ -1265,7 +1257,6 @@
*raddr = do_mmap (file, addr, file->f_dentry->d_inode->i_size,
prot, flags, 0);
up(¤t->mm->mmap_sem);
- unlock_kernel();
if (IS_ERR(*raddr))
err = PTR_ERR(*raddr);
else
@@ -1277,7 +1268,6 @@
dput(dentry);
bad_file:
mntput(shm_fs_type.kern_mnt);
- unlock_kernel();
if (err == -ENOENT)
return -EINVAL;
return err;
@@ -1301,7 +1291,6 @@
char name[SHM_FMT_LEN+1];
sprintf (name, SHM_FMT, id);
- lock_kernel();
dir = lock_parent(shm_sb->s_root);
dentry = lookup_one(name, dir);
error = PTR_ERR(dentry);
@@ -1321,7 +1310,6 @@
dput(dentry);
}
unlock_dir(dir);
- unlock_kernel();
return error;
}
@@ -1490,7 +1478,7 @@
return RETRY;
if (shp->id != zero_id) swap_attempts++;
- if (--counter < 0) /* failed */
+ if (--*counter < 0) /* failed */
return FAILED;
if (page_count(page_map) != 1)
return RETRY;
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)