diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-07 11:56:33 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-07 11:56:33 -0500 |
| commit | b4a45f5fe8078bfc10837dbd5b98735058bc4698 (patch) | |
| tree | df6f13a27610a3ec7eb4a661448cd779a8f84c79 /fs/fat/namei_msdos.c | |
| parent | 01539ba2a706ab7d35fc0667dff919ade7f87d63 (diff) | |
| parent | b3e19d924b6eaf2ca7d22cba99a517c5171007b6 (diff) | |
Merge branch 'vfs-scale-working' of git://git.kernel.org/pub/scm/linux/kernel/git/npiggin/linux-npiggin
* 'vfs-scale-working' of git://git.kernel.org/pub/scm/linux/kernel/git/npiggin/linux-npiggin: (57 commits)
fs: scale mntget/mntput
fs: rename vfsmount counter helpers
fs: implement faster dentry memcmp
fs: prefetch inode data in dcache lookup
fs: improve scalability of pseudo filesystems
fs: dcache per-inode inode alias locking
fs: dcache per-bucket dcache hash locking
bit_spinlock: add required includes
kernel: add bl_list
xfs: provide simple rcu-walk ACL implementation
btrfs: provide simple rcu-walk ACL implementation
ext2,3,4: provide simple rcu-walk ACL implementation
fs: provide simple rcu-walk generic_check_acl implementation
fs: provide rcu-walk aware permission i_ops
fs: rcu-walk aware d_revalidate method
fs: cache optimise dentry and inode for rcu-walk
fs: dcache reduce branches in lookup path
fs: dcache remove d_mounted
fs: fs_struct use seqlock
fs: rcu-walk for path lookup
...
Diffstat (limited to 'fs/fat/namei_msdos.c')
| -rw-r--r-- | fs/fat/namei_msdos.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/fs/fat/namei_msdos.c b/fs/fat/namei_msdos.c index 3345aabd1dd7..35ffe43afa4b 100644 --- a/fs/fat/namei_msdos.c +++ b/fs/fat/namei_msdos.c | |||
| @@ -148,7 +148,8 @@ static int msdos_find(struct inode *dir, const unsigned char *name, int len, | |||
| 148 | * that the existing dentry can be used. The msdos fs routines will | 148 | * that the existing dentry can be used. The msdos fs routines will |
| 149 | * return ENOENT or EINVAL as appropriate. | 149 | * return ENOENT or EINVAL as appropriate. |
| 150 | */ | 150 | */ |
| 151 | static int msdos_hash(struct dentry *dentry, struct qstr *qstr) | 151 | static int msdos_hash(const struct dentry *dentry, const struct inode *inode, |
| 152 | struct qstr *qstr) | ||
| 152 | { | 153 | { |
| 153 | struct fat_mount_options *options = &MSDOS_SB(dentry->d_sb)->options; | 154 | struct fat_mount_options *options = &MSDOS_SB(dentry->d_sb)->options; |
| 154 | unsigned char msdos_name[MSDOS_NAME]; | 155 | unsigned char msdos_name[MSDOS_NAME]; |
| @@ -164,16 +165,18 @@ static int msdos_hash(struct dentry *dentry, struct qstr *qstr) | |||
| 164 | * Compare two msdos names. If either of the names are invalid, | 165 | * Compare two msdos names. If either of the names are invalid, |
| 165 | * we fall back to doing the standard name comparison. | 166 | * we fall back to doing the standard name comparison. |
| 166 | */ | 167 | */ |
| 167 | static int msdos_cmp(struct dentry *dentry, struct qstr *a, struct qstr *b) | 168 | static int msdos_cmp(const struct dentry *parent, const struct inode *pinode, |
| 169 | const struct dentry *dentry, const struct inode *inode, | ||
| 170 | unsigned int len, const char *str, const struct qstr *name) | ||
| 168 | { | 171 | { |
| 169 | struct fat_mount_options *options = &MSDOS_SB(dentry->d_sb)->options; | 172 | struct fat_mount_options *options = &MSDOS_SB(parent->d_sb)->options; |
| 170 | unsigned char a_msdos_name[MSDOS_NAME], b_msdos_name[MSDOS_NAME]; | 173 | unsigned char a_msdos_name[MSDOS_NAME], b_msdos_name[MSDOS_NAME]; |
| 171 | int error; | 174 | int error; |
| 172 | 175 | ||
| 173 | error = msdos_format_name(a->name, a->len, a_msdos_name, options); | 176 | error = msdos_format_name(name->name, name->len, a_msdos_name, options); |
| 174 | if (error) | 177 | if (error) |
| 175 | goto old_compare; | 178 | goto old_compare; |
| 176 | error = msdos_format_name(b->name, b->len, b_msdos_name, options); | 179 | error = msdos_format_name(str, len, b_msdos_name, options); |
| 177 | if (error) | 180 | if (error) |
| 178 | goto old_compare; | 181 | goto old_compare; |
| 179 | error = memcmp(a_msdos_name, b_msdos_name, MSDOS_NAME); | 182 | error = memcmp(a_msdos_name, b_msdos_name, MSDOS_NAME); |
| @@ -182,8 +185,8 @@ out: | |||
| 182 | 185 | ||
| 183 | old_compare: | 186 | old_compare: |
| 184 | error = 1; | 187 | error = 1; |
| 185 | if (a->len == b->len) | 188 | if (name->len == len) |
| 186 | error = memcmp(a->name, b->name, a->len); | 189 | error = memcmp(name->name, str, len); |
| 187 | goto out; | 190 | goto out; |
| 188 | } | 191 | } |
| 189 | 192 | ||
| @@ -224,10 +227,10 @@ static struct dentry *msdos_lookup(struct inode *dir, struct dentry *dentry, | |||
| 224 | } | 227 | } |
| 225 | out: | 228 | out: |
| 226 | unlock_super(sb); | 229 | unlock_super(sb); |
| 227 | dentry->d_op = &msdos_dentry_operations; | 230 | d_set_d_op(dentry, &msdos_dentry_operations); |
| 228 | dentry = d_splice_alias(inode, dentry); | 231 | dentry = d_splice_alias(inode, dentry); |
| 229 | if (dentry) | 232 | if (dentry) |
| 230 | dentry->d_op = &msdos_dentry_operations; | 233 | d_set_d_op(dentry, &msdos_dentry_operations); |
| 231 | return dentry; | 234 | return dentry; |
| 232 | 235 | ||
| 233 | error: | 236 | error: |
| @@ -670,7 +673,7 @@ static int msdos_fill_super(struct super_block *sb, void *data, int silent) | |||
| 670 | } | 673 | } |
| 671 | 674 | ||
| 672 | sb->s_flags |= MS_NOATIME; | 675 | sb->s_flags |= MS_NOATIME; |
| 673 | sb->s_root->d_op = &msdos_dentry_operations; | 676 | d_set_d_op(sb->s_root, &msdos_dentry_operations); |
| 674 | unlock_super(sb); | 677 | unlock_super(sb); |
| 675 | return 0; | 678 | return 0; |
| 676 | } | 679 | } |
