diff options
author | Christoph Hellwig <hch@lst.de> | 2008-12-02 06:36:09 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-12-02 06:36:09 -0500 |
commit | 97288f2c71e46965a2010baea10548fcb5f3af73 (patch) | |
tree | 6f84cd33ee12eb8c51cccf931671da1b149c4ba6 /fs/btrfs/super.c | |
parent | 6e430f94e508fee1aefd1dfec88da3c24ce64433 (diff) |
Btrfs: corret fmode_t annotations
Make sure to propagate fmode_t properly and use the right constants for
it.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/btrfs/super.c')
-rw-r--r-- | fs/btrfs/super.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 93a21c77064a..09908f25fca9 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c | |||
@@ -242,7 +242,7 @@ int btrfs_parse_options(struct btrfs_root *root, char *options) | |||
242 | * All other options will be parsed on much later in the mount process and | 242 | * All other options will be parsed on much later in the mount process and |
243 | * only when we need to allocate a new super block. | 243 | * only when we need to allocate a new super block. |
244 | */ | 244 | */ |
245 | static int btrfs_parse_early_options(const char *options, int flags, | 245 | static int btrfs_parse_early_options(const char *options, fmode_t flags, |
246 | void *holder, char **subvol_name, | 246 | void *holder, char **subvol_name, |
247 | struct btrfs_fs_devices **fs_devices) | 247 | struct btrfs_fs_devices **fs_devices) |
248 | { | 248 | { |
@@ -418,18 +418,22 @@ static int btrfs_get_sb(struct file_system_type *fs_type, int flags, | |||
418 | struct super_block *s; | 418 | struct super_block *s; |
419 | struct dentry *root; | 419 | struct dentry *root; |
420 | struct btrfs_fs_devices *fs_devices = NULL; | 420 | struct btrfs_fs_devices *fs_devices = NULL; |
421 | fmode_t mode = FMODE_READ; | ||
421 | int error = 0; | 422 | int error = 0; |
422 | 423 | ||
423 | error = btrfs_parse_early_options(data, flags, fs_type, | 424 | if (!(flags & MS_RDONLY)) |
425 | mode |= FMODE_WRITE; | ||
426 | |||
427 | error = btrfs_parse_early_options(data, mode, fs_type, | ||
424 | &subvol_name, &fs_devices); | 428 | &subvol_name, &fs_devices); |
425 | if (error) | 429 | if (error) |
426 | goto error; | 430 | goto error; |
427 | 431 | ||
428 | error = btrfs_scan_one_device(dev_name, flags, fs_type, &fs_devices); | 432 | error = btrfs_scan_one_device(dev_name, mode, fs_type, &fs_devices); |
429 | if (error) | 433 | if (error) |
430 | goto error_free_subvol_name; | 434 | goto error_free_subvol_name; |
431 | 435 | ||
432 | error = btrfs_open_devices(fs_devices, flags, fs_type); | 436 | error = btrfs_open_devices(fs_devices, mode, fs_type); |
433 | if (error) | 437 | if (error) |
434 | goto error_free_subvol_name; | 438 | goto error_free_subvol_name; |
435 | 439 | ||
@@ -591,7 +595,7 @@ static long btrfs_control_ioctl(struct file *file, unsigned int cmd, | |||
591 | len = strnlen(vol->name, BTRFS_PATH_NAME_MAX); | 595 | len = strnlen(vol->name, BTRFS_PATH_NAME_MAX); |
592 | switch (cmd) { | 596 | switch (cmd) { |
593 | case BTRFS_IOC_SCAN_DEV: | 597 | case BTRFS_IOC_SCAN_DEV: |
594 | ret = btrfs_scan_one_device(vol->name, MS_RDONLY, | 598 | ret = btrfs_scan_one_device(vol->name, FMODE_READ, |
595 | &btrfs_fs_type, &fs_devices); | 599 | &btrfs_fs_type, &fs_devices); |
596 | break; | 600 | break; |
597 | } | 601 | } |