|
|
| version 1.433, 2008/07/01 16:19:25 | version 1.434, 2008/07/02 06:20:53 |
|---|---|
| Line 66 | Line 66 |
| #include <linux/writeback.h> | #include <linux/writeback.h> |
| #include <linux/kthread.h> | #include <linux/kthread.h> |
| #include <linux/freezer.h> | #include <linux/freezer.h> |
| #include <linux/parser.h> | |
| static struct quotactl_ops xfs_quotactl_operations; | static struct quotactl_ops xfs_quotactl_operations; |
| static struct super_operations xfs_super_operations; | static struct super_operations xfs_super_operations; |
| Line 147 xfs_args_allocate( | Line 148 xfs_args_allocate( |
| #define MNTOPT_XDSM "xdsm" /* DMI enabled (DMAPI / XDSM) */ | #define MNTOPT_XDSM "xdsm" /* DMI enabled (DMAPI / XDSM) */ |
| #define MNTOPT_DMI "dmi" /* DMI enabled (DMAPI / XDSM) */ | #define MNTOPT_DMI "dmi" /* DMI enabled (DMAPI / XDSM) */ |
| /* | |
| * Table driven mount option parser. | |
| * | |
| * Currently only used for remount, but it will be used for mount | |
| * in the future, too. | |
| */ | |
| enum { | |
| Opt_barrier, Opt_nobarrier, Opt_err | |
| }; | |
| static match_table_t tokens = { | |
| {Opt_barrier, "barrier"}, | |
| {Opt_nobarrier, "nobarrier"}, | |
| {Opt_err, NULL} | |
| }; | |
| STATIC unsigned long | STATIC unsigned long |
| suffix_strtoul(char *s, char **endp, unsigned int base) | suffix_strtoul(char *s, char **endp, unsigned int base) |
| { | { |
| Line 1365 xfs_fs_remount( | Line 1383 xfs_fs_remount( |
| char *options) | char *options) |
| { | { |
| struct xfs_mount *mp = XFS_M(sb); | struct xfs_mount *mp = XFS_M(sb); |
| struct xfs_mount_args *args; | substring_t args[MAX_OPT_ARGS]; |
| int error; | char *p; |
| args = xfs_args_allocate(sb, 0); | while ((p = strsep(&options, ",")) != NULL) { |
| if (!args) | int token; |
| return -ENOMEM; | |
| error = xfs_parseargs(mp, options, args, 1); | if (!*p) |
| if (error) | continue; |
| goto out_free_args; | |
| if (!(*flags & MS_RDONLY)) { /* rw/ro -> rw */ | token = match_token(p, tokens, args); |
| if (mp->m_flags & XFS_MOUNT_RDONLY) | switch (token) { |
| mp->m_flags &= ~XFS_MOUNT_RDONLY; | case Opt_barrier: |
| if (args->flags & XFSMNT_BARRIER) { | |
| mp->m_flags |= XFS_MOUNT_BARRIER; | mp->m_flags |= XFS_MOUNT_BARRIER; |
| xfs_mountfs_check_barriers(mp); | |
| } else { | /* |
| * Test if barriers are actually working if we can, | |
| * else delay this check until the filesystem is | |
| * marked writeable. | |
| */ | |
| if (!(mp->m_flags & XFS_MOUNT_RDONLY)) | |
| xfs_mountfs_check_barriers(mp); | |
| break; | |
| case Opt_nobarrier: | |
| mp->m_flags &= ~XFS_MOUNT_BARRIER; | mp->m_flags &= ~XFS_MOUNT_BARRIER; |
| break; | |
| default: | |
| printk(KERN_INFO | |
| "XFS: mount option \"%s\" not supported for remount\n", p); | |
| return -EINVAL; | |
| } | } |
| } else if (!(mp->m_flags & XFS_MOUNT_RDONLY)) { /* rw -> ro */ | } |
| /* rw/ro -> rw */ | |
| if ((mp->m_flags & XFS_MOUNT_RDONLY) && !(*flags & MS_RDONLY)) { | |
| mp->m_flags &= ~XFS_MOUNT_RDONLY; | |
| if (mp->m_flags & XFS_MOUNT_BARRIER) | |
| xfs_mountfs_check_barriers(mp); | |
| } | |
| /* rw -> ro */ | |
| if (!(mp->m_flags & XFS_MOUNT_RDONLY) && (*flags & MS_RDONLY)) { | |
| xfs_filestream_flush(mp); | xfs_filestream_flush(mp); |
| xfs_sync(mp, SYNC_DATA_QUIESCE); | xfs_sync(mp, SYNC_DATA_QUIESCE); |
| xfs_attr_quiesce(mp); | xfs_attr_quiesce(mp); |
| mp->m_flags |= XFS_MOUNT_RDONLY; | mp->m_flags |= XFS_MOUNT_RDONLY; |
| } | } |
| out_free_args: | return 0; |
| kfree(args); | |
| return -error; | |
| } | } |
| /* | /* |