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
fa18d04a
Commit
fa18d04a
authored
Oct 16, 2004
by
Anton Altaparmakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NTFS: Simplify setup of i_mode in fs/ntfs/inode.c::ntfs_read_locked_inode().
Signed-off-by:
Anton Altaparmakov
<
aia21@cantab.net
>
parent
714cd140
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
19 deletions
+15
-19
fs/ntfs/ChangeLog
fs/ntfs/ChangeLog
+1
-0
fs/ntfs/inode.c
fs/ntfs/inode.c
+14
-19
No files found.
fs/ntfs/ChangeLog
View file @
fa18d04a
...
...
@@ -132,6 +132,7 @@ ToDo/Notes:
inode.h and make fs/ntfs/inode.c::__ntfs_init_inode() non-static and
add a declaration for it to inode.h. Fix some compilation issues
that resulted due to #includes and header file interdependencies.
- Simplify setup of i_mode in fs/ntfs/inode.c::ntfs_read_locked_inode().
2.1.20 - Fix two stupid bugs introduced in 2.1.18 release.
...
...
fs/ntfs/inode.c
View file @
fa18d04a
...
...
@@ -594,14 +594,26 @@ static int ntfs_read_locked_inode(struct inode *vi)
* Also if not a directory, it could be something else, rather than
* a regular file. But again, will do for now.
*/
/* Everyone gets all permissions. */
vi
->
i_mode
|=
S_IRWXUGO
;
/* If read-only, noone gets write permissions. */
if
(
IS_RDONLY
(
vi
))
vi
->
i_mode
&=
~
S_IWUGO
;
if
(
m
->
flags
&
MFT_RECORD_IS_DIRECTORY
)
{
vi
->
i_mode
|=
S_IFDIR
;
/*
* Apply the directory permissions mask set in the mount
* options.
*/
vi
->
i_mode
&=
~
vol
->
dmask
;
/* Things break without this kludge! */
if
(
vi
->
i_nlink
>
1
)
vi
->
i_nlink
=
1
;
}
else
}
else
{
vi
->
i_mode
|=
S_IFREG
;
/* Apply the file permissions mask set in the mount options. */
vi
->
i_mode
&=
~
vol
->
fmask
;
}
/*
* Find the standard information attribute in the mft record. At this
* stage we haven't setup the attribute list stuff yet, so this could
...
...
@@ -944,16 +956,6 @@ static int ntfs_read_locked_inode(struct inode *vi)
goto
unm_err_out
;
}
skip_large_dir_stuff:
/* Everyone gets read and scan permissions. */
vi
->
i_mode
|=
S_IRUGO
|
S_IXUGO
;
/* If not read-only, set write permissions. */
if
(
!
IS_RDONLY
(
vi
))
vi
->
i_mode
|=
S_IWUGO
;
/*
* Apply the directory permissions mask set in the mount
* options.
*/
vi
->
i_mode
&=
~
vol
->
dmask
;
/* Setup the operations for this inode. */
vi
->
i_op
=
&
ntfs_dir_inode_ops
;
vi
->
i_fop
=
&
ntfs_dir_ops
;
...
...
@@ -1090,13 +1092,6 @@ static int ntfs_read_locked_inode(struct inode *vi)
unmap_mft_record
(
ni
);
m
=
NULL
;
ctx
=
NULL
;
/* Everyone gets all permissions. */
vi
->
i_mode
|=
S_IRWXUGO
;
/* If read-only, noone gets write permissions. */
if
(
IS_RDONLY
(
vi
))
vi
->
i_mode
&=
~
S_IWUGO
;
/* Apply the file permissions mask set in the mount options. */
vi
->
i_mode
&=
~
vol
->
fmask
;
/* Setup the operations for this inode. */
vi
->
i_op
=
&
ntfs_file_inode_ops
;
vi
->
i_fop
=
&
ntfs_file_ops
;
...
...
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