Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
059c6fac
Commit
059c6fac
authored
Oct 14, 2002
by
Richard Gooch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed DEVFS_FL_AUTO_OWNER flag
parent
53731310
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
42 deletions
+20
-42
Documentation/filesystems/devfs/ChangeLog
Documentation/filesystems/devfs/ChangeLog
+4
-0
drivers/ieee1394/video1394.c
drivers/ieee1394/video1394.c
+1
-2
fs/devfs/base.c
fs/devfs/base.c
+9
-27
include/linux/devfs_fs_kernel.h
include/linux/devfs_fs_kernel.h
+6
-13
No files found.
Documentation/filesystems/devfs/ChangeLog
View file @
059c6fac
...
...
@@ -1965,3 +1965,7 @@ Changes for patch v217
- Updated README from master HTML file
- Fixed module unload race in <devfs_open>
===============================================================================
Changes for patch v218
- Removed DEVFS_FL_AUTO_OWNER flag
drivers/ieee1394/video1394.c
View file @
059c6fac
...
...
@@ -1367,8 +1367,7 @@ static int video1394_init(struct ti_ohci *ohci)
sprintf
(
name
,
"%d"
,
video
->
id
);
minor
=
IEEE1394_MINOR_BLOCK_VIDEO1394
*
16
+
video
->
id
;
video
->
devfs
=
devfs_register
(
devfs_handle
,
name
,
DEVFS_FL_AUTO_OWNER
,
video
->
devfs
=
devfs_register
(
devfs_handle
,
name
,
DEVFS_FL_DEFAULT
,
IEEE1394_MAJOR
,
minor
,
S_IFCHR
|
S_IRUSR
|
S_IWUSR
,
&
video1394_fops
,
NULL
);
...
...
fs/devfs/base.c
View file @
059c6fac
...
...
@@ -648,6 +648,9 @@
20020820 Richard Gooch <rgooch@atnf.csiro.au>
Fixed module unload race in <devfs_open>.
v1.21
20021013 Richard Gooch <rgooch@atnf.csiro.au>
Removed DEVFS_ FL_AUTO_OWNER.
v1.22
*/
#include <linux/types.h>
#include <linux/errno.h>
...
...
@@ -680,7 +683,7 @@
#include <asm/bitops.h>
#include <asm/atomic.h>
#define DEVFS_VERSION "1.2
1 (20020820
)"
#define DEVFS_VERSION "1.2
2 (20021013
)"
#define DEVFS_NAME "devfs"
...
...
@@ -778,7 +781,6 @@ struct fcb_type /* File, char, block type */
struct
device_type
device
;
}
u
;
unsigned
char
auto_owner
:
1
;
unsigned
char
aopen_notify
:
1
;
unsigned
char
removable
:
1
;
/* Belongs in device_type, but save space */
unsigned
char
open
:
1
;
/* Not entirely correct */
...
...
@@ -1480,6 +1482,7 @@ static int wait_for_devfsd_finished (struct fs_info *fs_info)
* @uid: The user ID.
* @gid: The group ID.
* @fs_info: The filesystem info.
* @atomic: If TRUE, an atomic allocation is required.
*
* Returns %TRUE if an event was queued and devfsd woken up, else %FALSE.
*/
...
...
@@ -1631,7 +1634,6 @@ devfs_handle_t devfs_register (devfs_handle_t dir, const char *name,
de
->
inode
.
gid
=
0
;
}
de
->
u
.
fcb
.
ops
=
ops
;
de
->
u
.
fcb
.
auto_owner
=
(
flags
&
DEVFS_FL_AUTO_OWNER
)
?
TRUE
:
FALSE
;
de
->
u
.
fcb
.
aopen_notify
=
(
flags
&
DEVFS_FL_AOPEN_NOTIFY
)
?
TRUE
:
FALSE
;
de
->
hide
=
(
flags
&
DEVFS_FL_HIDE
)
?
TRUE
:
FALSE
;
if
(
flags
&
DEVFS_FL_REMOVABLE
)
de
->
u
.
fcb
.
removable
=
TRUE
;
...
...
@@ -1918,7 +1920,6 @@ int devfs_get_flags (devfs_handle_t de, unsigned int *flags)
if
(
de
->
hide
)
fl
|=
DEVFS_FL_HIDE
;
if
(
S_ISCHR
(
de
->
mode
)
||
S_ISBLK
(
de
->
mode
)
||
S_ISREG
(
de
->
mode
)
)
{
if
(
de
->
u
.
fcb
.
auto_owner
)
fl
|=
DEVFS_FL_AUTO_OWNER
;
if
(
de
->
u
.
fcb
.
aopen_notify
)
fl
|=
DEVFS_FL_AOPEN_NOTIFY
;
if
(
de
->
u
.
fcb
.
removable
)
fl
|=
DEVFS_FL_REMOVABLE
;
}
...
...
@@ -1943,7 +1944,6 @@ int devfs_set_flags (devfs_handle_t de, unsigned int flags)
de
->
hide
=
(
flags
&
DEVFS_FL_HIDE
)
?
TRUE
:
FALSE
;
if
(
S_ISCHR
(
de
->
mode
)
||
S_ISBLK
(
de
->
mode
)
||
S_ISREG
(
de
->
mode
)
)
{
de
->
u
.
fcb
.
auto_owner
=
(
flags
&
DEVFS_FL_AUTO_OWNER
)
?
TRUE
:
FALSE
;
de
->
u
.
fcb
.
aopen_notify
=
(
flags
&
DEVFS_FL_AOPEN_NOTIFY
)
?
TRUE
:
FALSE
;
}
return
0
;
...
...
@@ -2497,13 +2497,9 @@ static int devfs_notify_change (struct dentry *dentry, struct iattr *iattr)
(
int
)
inode
->
i_mode
,
(
int
)
inode
->
i_uid
,
(
int
)
inode
->
i_gid
);
/* Inode is not on hash chains, thus must save permissions here rather
than in a write_inode() method */
if
(
(
!
S_ISREG
(
inode
->
i_mode
)
&&
!
S_ISCHR
(
inode
->
i_mode
)
&&
!
S_ISBLK
(
inode
->
i_mode
)
)
||
!
de
->
u
.
fcb
.
auto_owner
)
{
de
->
mode
=
inode
->
i_mode
;
de
->
inode
.
uid
=
inode
->
i_uid
;
de
->
inode
.
gid
=
inode
->
i_gid
;
}
de
->
inode
.
atime
=
inode
->
i_atime
;
de
->
inode
.
mtime
=
inode
->
i_mtime
;
de
->
inode
.
ctime
=
inode
->
i_ctime
;
...
...
@@ -2606,9 +2602,7 @@ static struct inode *_devfs_get_vfs_inode (struct super_block *sb,
inode
->
i_op
=
&
devfs_symlink_iops
;
inode
->
i_size
=
de
->
u
.
symlink
.
length
;
}
if
(
is_fcb
&&
de
->
u
.
fcb
.
auto_owner
)
inode
->
i_mode
=
(
de
->
mode
&
S_IFMT
)
|
S_IRUGO
|
S_IWUGO
;
else
inode
->
i_mode
=
de
->
mode
;
inode
->
i_mode
=
de
->
mode
;
inode
->
i_uid
=
de
->
inode
.
uid
;
inode
->
i_gid
=
de
->
inode
.
gid
;
inode
->
i_atime
=
de
->
inode
.
atime
;
...
...
@@ -2728,13 +2722,6 @@ static int devfs_open (struct inode *inode, struct file *file)
/* Open was successful */
if
(
df
->
open
)
return
0
;
df
->
open
=
TRUE
;
/* This is the first open */
if
(
df
->
auto_owner
)
{
/* Change the ownership/protection to what driver specified */
inode
->
i_mode
=
de
->
mode
;
inode
->
i_uid
=
current
->
euid
;
inode
->
i_gid
=
current
->
egid
;
}
if
(
df
->
aopen_notify
&&
!
is_devfsd_or_child
(
fs_info
)
)
devfsd_notify_de
(
de
,
DEVFSD_NOTIFY_ASYNC_OPEN
,
inode
->
i_mode
,
current
->
euid
,
current
->
egid
,
fs_info
,
0
);
...
...
@@ -2837,11 +2824,6 @@ static int devfs_d_delete (struct dentry *dentry)
if
(
de
->
u
.
fcb
.
aopen_notify
)
devfsd_notify_de
(
de
,
DEVFSD_NOTIFY_CLOSE
,
inode
->
i_mode
,
current
->
euid
,
current
->
egid
,
fs_info
,
1
);
if
(
!
de
->
u
.
fcb
.
auto_owner
)
return
0
;
/* Change the ownership/protection back */
inode
->
i_mode
=
(
de
->
mode
&
S_IFMT
)
|
S_IRUGO
|
S_IWUGO
;
inode
->
i_uid
=
de
->
inode
.
uid
;
inode
->
i_gid
=
de
->
inode
.
gid
;
return
0
;
}
/* End Function devfs_d_delete */
...
...
include/linux/devfs_fs_kernel.h
View file @
059c6fac
...
...
@@ -23,21 +23,14 @@
#define DEVFS_FL_NONE 0x000
/* This helps to make code more readable
*/
#define DEVFS_FL_AUTO_OWNER 0x001
/* When a closed inode is opened the
ownerships are set to the opening
process and the protection is set to
that given in <<mode>>. When the inode
is closed, ownership reverts back to
<<uid>> and <<gid>> and the protection
is set to read-write for all */
#define DEVFS_FL_HIDE 0x002
/* Do not show entry in directory list */
#define DEVFS_FL_AUTO_DEVNUM 0x004
/* Automatically generate device number
#define DEVFS_FL_HIDE 0x001
/* Do not show entry in directory list */
#define DEVFS_FL_AUTO_DEVNUM 0x002
/* Automatically generate device number
*/
#define DEVFS_FL_AOPEN_NOTIFY 0x00
8
/* Asynchronously notify devfsd on open
#define DEVFS_FL_AOPEN_NOTIFY 0x00
4
/* Asynchronously notify devfsd on open
*/
#define DEVFS_FL_REMOVABLE 0x0
10
/* This is a removable media device */
#define DEVFS_FL_WAIT 0x0
2
0
/* Wait for devfsd to finish */
#define DEVFS_FL_CURRENT_OWNER 0x0
4
0
/* Set initial ownership to current */
#define DEVFS_FL_REMOVABLE 0x0
08
/* This is a removable media device */
#define DEVFS_FL_WAIT 0x0
1
0
/* Wait for devfsd to finish */
#define DEVFS_FL_CURRENT_OWNER 0x0
2
0
/* Set initial ownership to current */
#define DEVFS_FL_DEFAULT DEVFS_FL_NONE
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment