Commit 9b274ca1 authored by Anton Altaparmakov's avatar Anton Altaparmakov Committed by Anton Altaparmakov

NTFS: Change default fmask to 0177, small cleanups, update version to 2.0.2.

parent 95015ed0
......@@ -36,12 +36,14 @@ gid=
umask= Provide default owner, group, and access mode mask.
These options work as documented in mount(8). By
default, the files/directories are owned by root and
he/she has read, write, and execute permissions. No one
else has any access permissions. I.e. the mode on all
files and directories is by default rwx------, a
consequence of the default umask=0077. Using a
umask of zero will grant all permissions to everyone,
i.e. all files and directories will have mode rwxrwxrwx.
he/she has read and write permissions, as well as
browse permission for directories. No one else has any
access permissions. I.e. the mode on all files is by
default rw------- and for directories rwx------, a
consequence of the default fmask=0177 and dmask=0077.
Using a umask of zero will grant all permissions to
everyone, i.e. all files and directories will have mode
rwxrwxrwx.
fmask=
dmask= Instead of specifying umask which applies both to
......
......@@ -27,6 +27,12 @@ ToDo:
quite big. Modularising them a bit, e.g. a-la get_block(), will make
them cleaner and make code reuse easier.
2.0.2 - Minor updates and cleanups.
- Cleanup: rename mst.c::__post_read_mst_fixup to post_write_mst_fixup
and cleanup the code a bit, removing the unused size parameter.
- Change default fmask to 0177 and update documentation.
2.0.1 - Minor updates.
- Make default umask correspond to documentation.
......
# Rules for making the NTFS driver.
O_TARGET := ntfs.o
obj-y := time.o unistr.o inode.o file.o mft.o super.o debug.o aops.o \
attrib.o dir.o namei.o mst.o upcase.o compress.o sysctl.o
obj-m := $(O_TARGET)
EXTRA_CFLAGS = -DNTFS_VERSION=\"2.0.2\"
ifeq ($(CONFIG_NTFS_DEBUG),y)
EXTRA_CFLAGS += -DDEBUG
endif
include $(TOPDIR)/Rules.make
......@@ -470,7 +470,7 @@ static int ntfs_mftbmp_readpage(ntfs_volume *vol, struct page *page)
* @bh: buffer head on which io is completed
* @uptodate: whether @bh is now uptodate or not
*
* Asynchronous I/O completion handler for reading pages belogning to the
* Asynchronous I/O completion handler for reading pages belonging to the
* index allocation attribute address space of directory inodes.
*
* Perform the post read mst fixups when all IO on the page has been completed
......
......@@ -22,40 +22,6 @@
#include "ntfs.h"
/**
* __post_read_mst_fixup - fast deprotect multi sector transfer protected data
* @b: pointer to the data to deprotect
* @size: size in bytes of @b
*
* Perform the necessary post read multi sector transfer fixup, not checking for
* any errors. Defined inline for additional speed.
*/
inline void __post_read_mst_fixup(NTFS_RECORD *b, const u32 size)
{
u16 usa_ofs, usa_count;
u16 *usa_pos, *data_pos;
/* Setup the variables. */
usa_ofs = le16_to_cpu(b->usa_ofs);
usa_count = le16_to_cpu(b->usa_count) - 1;
/* Position of usn in update sequence array. */
usa_pos = (u16*)b + usa_ofs/sizeof(u16);
/*
* Position in protected data of first u16 that needs fixing up.
*/
data_pos = (u16*)b + NTFS_BLOCK_SIZE/sizeof(u16) - 1;
/* Fixup all sectors. */
while (usa_count--) {
/*
* Increment position in usa and restore original data from
* the usa into the data buffer.
*/
*data_pos = *(++usa_pos);
/* Increment position in data as well. */
data_pos += NTFS_BLOCK_SIZE/sizeof(u16);
}
}
/**
* post_read_mst_fixup - deprotect multi sector transfer protected data
* @b: pointer to the data to deprotect
......@@ -200,3 +166,37 @@ int pre_write_mst_fixup(NTFS_RECORD *b, const u32 size)
return 0;
}
/**
* post_write_mst_fixup - fast deprotect multi sector transfer protected data
* @b: pointer to the data to deprotect
*
* Perform the necessary post write multi sector transfer fixup, not checking
* for any errors, because we assume we have just used pre_write_mst_fixup(),
* thus the data will be fine or we would never have gotten here.
*/
void post_write_mst_fixup(NTFS_RECORD *b)
{
u16 *usa_pos, *data_pos;
u16 usa_ofs = le16_to_cpu(b->usa_ofs);
u16 usa_count = le16_to_cpu(b->usa_count) - 1;
/* Position of usn in update sequence array. */
usa_pos = (u16*)b + usa_ofs/sizeof(u16);
/* Position in protected data of first u16 that needs fixing up. */
data_pos = (u16*)b + NTFS_BLOCK_SIZE/sizeof(u16) - 1;
/* Fixup all sectors. */
while (usa_count--) {
/*
* Increment position in usa and restore original data from
* the usa into the data buffer.
*/
*data_pos = *(++usa_pos);
/* Increment position in data as well. */
data_pos += NTFS_BLOCK_SIZE/sizeof(u16);
}
}
......@@ -221,9 +221,9 @@ extern int allocate_compression_buffers(void);
extern void free_compression_buffers(void);
/* From fs/ntfs/mst.c */
extern inline void __post_read_mst_fixup(NTFS_RECORD *b, const u32 size);
extern int post_read_mst_fixup(NTFS_RECORD *b, const u32 size);
extern int pre_write_mst_fixup(NTFS_RECORD *b, const u32 size);
extern void post_write_mst_fixup(NTFS_RECORD *b);
/* From fs/ntfs/time.c */
extern inline s64 utc2ntfs(const time_t time);
......
......@@ -1525,9 +1525,11 @@ static int ntfs_fill_super(struct super_block *sb, void *opt, const int silent)
/*
* Default is group and other don't have any access to files or
* directories while owner has full access.
* directories while owner has full access. Further files by default
* are not executable but directories are of course browseable.
*/
vol->fmask = vol->dmask = 0077;
vol->fmask = 0177;
vol->dmask = 0077;
/*
* Default is to show long file names (including POSIX file names), and
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment