[PATCH] devfs: Remove devfs from the kernel tree

This is the first patch in a series of patches that removes devfs
support from the kernel.  This patch removes the core devfs code, and
its private header file.
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 5fd571cb
master alk-4.19.24 alk-4.19.30 alk-4.19.34 alk-4.19.36 alk-4.19.43 alk-4.19.48 alk-4.19.57 ck-4.19.67 ck-4.19.81 ck-4.19.91 github/fork/deepanshu1422/fix-typo-in-comment github/fork/haosdent/fix-typo linux-next v4.19.91 v4.19.90 v4.19.89 v4.19.88 v4.19.87 v4.19.86 v4.19.85 v4.19.84 v4.19.83 v4.19.82 v4.19.81 v4.19.80 v4.19.79 v4.19.78 v4.19.77 v4.19.76 v4.19.75 v4.19.74 v4.19.73 v4.19.72 v4.19.71 v4.19.70 v4.19.69 v4.19.68 v4.19.67 v4.19.66 v4.19.65 v4.19.64 v4.19.63 v4.19.62 v4.19.61 v4.19.60 v4.19.59 v4.19.58 v4.19.57 v4.19.56 v4.19.55 v4.19.54 v4.19.53 v4.19.52 v4.19.51 v4.19.50 v4.19.49 v4.19.48 v4.19.47 v4.19.46 v4.19.45 v4.19.44 v4.19.43 v4.19.42 v4.19.41 v4.19.40 v4.19.39 v4.19.38 v4.19.37 v4.19.36 v4.19.35 v4.19.34 v4.19.33 v4.19.32 v4.19.31 v4.19.30 v4.19.29 v4.19.28 v4.19.27 v4.19.26 v4.19.25 v4.19.24 v4.19.23 v4.19.22 v4.19.21 v4.19.20 v4.19.19 v4.19.18 v4.19.17 v4.19.16 v4.19.15 v4.19.14 v4.19.13 v4.19.12 v4.19.11 v4.19.10 v4.19.9 v4.19.8 v4.19.7 v4.19.6 v4.19.5 v4.19.4 v4.19.3 v4.19.2 v4.19.1 v4.19 v4.19-rc8 v4.19-rc7 v4.19-rc6 v4.19-rc5 v4.19-rc4 v4.19-rc3 v4.19-rc2 v4.19-rc1 ck-release-21 ck-release-20 ck-release-19.2 ck-release-19.1 ck-release-19 ck-release-18 ck-release-17.2 ck-release-17.1 ck-release-17 ck-release-16 ck-release-15.1 ck-release-15 ck-release-14 ck-release-13.2 ck-release-13 ck-release-12 ck-release-11 ck-release-10 ck-release-9 ck-release-7 alk-release-15 alk-release-14 alk-release-13.2 alk-release-13 alk-release-12 alk-release-11 alk-release-10 alk-release-9 alk-release-7
无相关合并请求
......@@ -66,7 +66,6 @@ obj-$(CONFIG_MSDOS_FS) += msdos/
obj-$(CONFIG_VFAT_FS) += vfat/
obj-$(CONFIG_BFS_FS) += bfs/
obj-$(CONFIG_ISO9660_FS) += isofs/
obj-$(CONFIG_DEVFS_FS) += devfs/
obj-$(CONFIG_HFSPLUS_FS) += hfsplus/ # Before hfs to find wrapped HFS+
obj-$(CONFIG_HFS_FS) += hfs/
obj-$(CONFIG_VXFS_FS) += freevxfs/
......
......@@ -44,7 +44,6 @@
#include <linux/loop.h>
#include <linux/auto_fs.h>
#include <linux/auto_fs4.h>
#include <linux/devfs_fs.h>
#include <linux/tty.h>
#include <linux/vt_kern.h>
#include <linux/fb.h>
......
#
# Makefile for the linux devfs-filesystem routines.
#
obj-$(CONFIG_DEVFS_FS) += devfs.o
devfs-objs := base.o util.o
此差异已折叠。
/* devfs (Device FileSystem) utilities.
Copyright (C) 1999-2002 Richard Gooch
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Richard Gooch may be reached by email at rgooch@atnf.csiro.au
The postal address is:
Richard Gooch, c/o ATNF, P. O. Box 76, Epping, N.S.W., 2121, Australia.
ChangeLog
19991031 Richard Gooch <rgooch@atnf.csiro.au>
Created.
19991103 Richard Gooch <rgooch@atnf.csiro.au>
Created <_devfs_convert_name> and supported SCSI and IDE CD-ROMs
20000203 Richard Gooch <rgooch@atnf.csiro.au>
Changed operations pointer type to void *.
20000621 Richard Gooch <rgooch@atnf.csiro.au>
Changed interface to <devfs_register_series>.
20000622 Richard Gooch <rgooch@atnf.csiro.au>
Took account of interface change to <devfs_mk_symlink>.
Took account of interface change to <devfs_mk_dir>.
20010519 Richard Gooch <rgooch@atnf.csiro.au>
Documentation cleanup.
20010709 Richard Gooch <rgooch@atnf.csiro.au>
Created <devfs_*alloc_major> and <devfs_*alloc_devnum>.
20010710 Richard Gooch <rgooch@atnf.csiro.au>
Created <devfs_*alloc_unique_number>.
20010730 Richard Gooch <rgooch@atnf.csiro.au>
Documentation typo fix.
20010806 Richard Gooch <rgooch@atnf.csiro.au>
Made <block_semaphore> and <char_semaphore> private.
20010813 Richard Gooch <rgooch@atnf.csiro.au>
Fixed bug in <devfs_alloc_unique_number>: limited to 128 numbers
20010818 Richard Gooch <rgooch@atnf.csiro.au>
Updated major masks up to Linus' "no new majors" proclamation.
Block: were 126 now 122 free, char: were 26 now 19 free.
20020324 Richard Gooch <rgooch@atnf.csiro.au>
Fixed bug in <devfs_alloc_unique_number>: was clearing beyond
bitfield.
20020326 Richard Gooch <rgooch@atnf.csiro.au>
Fixed bitfield data type for <devfs_*alloc_devnum>.
Made major bitfield type and initialiser 64 bit safe.
20020413 Richard Gooch <rgooch@atnf.csiro.au>
Fixed shift warning on 64 bit machines.
20020428 Richard Gooch <rgooch@atnf.csiro.au>
Copied and used macro for error messages from fs/devfs/base.c
20021013 Richard Gooch <rgooch@atnf.csiro.au>
Documentation fix.
20030101 Adam J. Richter <adam@yggdrasil.com>
Eliminate DEVFS_SPECIAL_{CHR,BLK}. Use mode_t instead.
20030106 Christoph Hellwig <hch@infradead.org>
Rewrite devfs_{,de}alloc_devnum to look like C code.
*/
#include <linux/module.h>
#include <linux/init.h>
#include <linux/devfs_fs_kernel.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <linux/genhd.h>
#include <linux/bitops.h>
int devfs_register_tape(const char *name)
{
char tname[32], dest[64];
static unsigned int tape_counter;
unsigned int n = tape_counter++;
sprintf(dest, "../%s", name);
sprintf(tname, "tapes/tape%u", n);
devfs_mk_symlink(tname, dest);
return n;
}
EXPORT_SYMBOL(devfs_register_tape);
void devfs_unregister_tape(int num)
{
if (num >= 0)
devfs_remove("tapes/tape%u", num);
}
EXPORT_SYMBOL(devfs_unregister_tape);
......@@ -567,11 +567,6 @@ COMPATIBLE_IOCTL(AUTOFS_IOC_PROTOSUBVER)
COMPATIBLE_IOCTL(AUTOFS_IOC_ASKREGHOST)
COMPATIBLE_IOCTL(AUTOFS_IOC_TOGGLEREGHOST)
COMPATIBLE_IOCTL(AUTOFS_IOC_ASKUMOUNT)
/* DEVFS */
COMPATIBLE_IOCTL(DEVFSDIOC_GET_PROTO_REV)
COMPATIBLE_IOCTL(DEVFSDIOC_SET_EVENT_MASK)
COMPATIBLE_IOCTL(DEVFSDIOC_RELEASE_EVENT_QUEUE)
COMPATIBLE_IOCTL(DEVFSDIOC_SET_DEBUG_MASK)
/* Raw devices */
COMPATIBLE_IOCTL(RAW_SETBIND)
COMPATIBLE_IOCTL(RAW_GETBIND)
......
#ifndef _LINUX_DEVFS_FS_H
#define _LINUX_DEVFS_FS_H
#include <linux/ioctl.h>
#define DEVFSD_PROTOCOL_REVISION_KERNEL 5
#define DEVFSD_IOCTL_BASE 'd'
/* These are the various ioctls */
#define DEVFSDIOC_GET_PROTO_REV _IOR(DEVFSD_IOCTL_BASE, 0, int)
#define DEVFSDIOC_SET_EVENT_MASK _IOW(DEVFSD_IOCTL_BASE, 2, int)
#define DEVFSDIOC_RELEASE_EVENT_QUEUE _IOW(DEVFSD_IOCTL_BASE, 3, int)
#define DEVFSDIOC_SET_DEBUG_MASK _IOW(DEVFSD_IOCTL_BASE, 4, int)
#define DEVFSD_NOTIFY_REGISTERED 0
#define DEVFSD_NOTIFY_UNREGISTERED 1
#define DEVFSD_NOTIFY_ASYNC_OPEN 2
#define DEVFSD_NOTIFY_CLOSE 3
#define DEVFSD_NOTIFY_LOOKUP 4
#define DEVFSD_NOTIFY_CHANGE 5
#define DEVFSD_NOTIFY_CREATE 6
#define DEVFSD_NOTIFY_DELETE 7
#define DEVFS_PATHLEN 1024 /* Never change this otherwise the
binary interface will change */
struct devfsd_notify_struct { /* Use native C types to ensure same types in kernel and user space */
unsigned int type; /* DEVFSD_NOTIFY_* value */
unsigned int mode; /* Mode of the inode or device entry */
unsigned int major; /* Major number of device entry */
unsigned int minor; /* Minor number of device entry */
unsigned int uid; /* Uid of process, inode or device entry */
unsigned int gid; /* Gid of process, inode or device entry */
unsigned int overrun_count; /* Number of lost events */
unsigned int namelen; /* Number of characters not including '\0' */
/* The device name MUST come last */
char devname[DEVFS_PATHLEN]; /* This will be '\0' terminated */
};
#endif /* _LINUX_DEVFS_FS_H */
......@@ -4,25 +4,8 @@
#include <linux/fs.h>
#include <linux/spinlock.h>
#include <linux/types.h>
#include <asm/semaphore.h>
#define DEVFS_SUPER_MAGIC 0x1373
#ifdef CONFIG_DEVFS_FS
extern int devfs_mk_bdev(dev_t dev, umode_t mode, const char *fmt, ...)
__attribute__ ((format(printf, 3, 4)));
extern int devfs_mk_cdev(dev_t dev, umode_t mode, const char *fmt, ...)
__attribute__ ((format(printf, 3, 4)));
extern int devfs_mk_symlink(const char *name, const char *link);
extern int devfs_mk_dir(const char *fmt, ...)
__attribute__ ((format(printf, 1, 2)));
extern void devfs_remove(const char *fmt, ...)
__attribute__ ((format(printf, 1, 2)));
extern int devfs_register_tape(const char *name);
extern void devfs_unregister_tape(int num);
extern void mount_devfs_fs(void);
#else /* CONFIG_DEVFS_FS */
static inline int devfs_mk_bdev(dev_t dev, umode_t mode, const char *fmt, ...)
{
return 0;
......@@ -53,5 +36,4 @@ static inline void mount_devfs_fs(void)
{
return;
}
#endif /* CONFIG_DEVFS_FS */
#endif /* _LINUX_DEVFS_FS_KERNEL_H */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册