From d58b315704bf21c3552d1b9b0743cfd6585ef972 Mon Sep 17 00:00:00 2001 From: Ondrej Oprala Date: Fri, 2 Aug 2013 12:23:50 +0200 Subject: libmount: fix typos Signed-off-by: Ondrej Oprala --- libmount/src/cache.c | 16 +++--- libmount/src/context.c | 112 ++++++++++++++++++++--------------------- libmount/src/context_loopdev.c | 14 +++--- libmount/src/context_mount.c | 50 +++++++++--------- libmount/src/context_umount.c | 32 ++++++------ libmount/src/fs.c | 76 ++++++++++++++-------------- libmount/src/init.c | 12 ++--- libmount/src/iter.c | 10 ++-- libmount/src/libmount.h.in | 6 +-- libmount/src/lock.c | 30 +++++------ libmount/src/mountP.h | 5 +- libmount/src/optmap.c | 8 +-- libmount/src/optstr.c | 96 +++++++++++++++++------------------ libmount/src/tab.c | 96 +++++++++++++++++------------------ libmount/src/tab_diff.c | 8 +-- libmount/src/tab_parse.c | 52 +++++++++---------- libmount/src/tab_update.c | 26 +++++----- libmount/src/utils.c | 52 +++++++++---------- libmount/src/version.c | 6 +-- 19 files changed, 354 insertions(+), 353 deletions(-) (limited to 'libmount') diff --git a/libmount/src/cache.c b/libmount/src/cache.c index 43a4daf4f..ef1a64107 100644 --- a/libmount/src/cache.c +++ b/libmount/src/cache.c @@ -10,7 +10,7 @@ * @title: Cache * @short_description: paths and tags (UUID/LABEL) caching * - * The cache is a very simple API for work with tags (LABEL, UUID, ...) and + * The cache is a very simple API for working with tags (LABEL, UUID, ...) and * paths. The cache uses libblkid as a backend for TAGs resolution. * * All returned paths are always canonicalized. @@ -102,7 +102,7 @@ void mnt_free_cache(struct libmnt_cache *cache) free(cache); } -/* note that the @key could be tha same pointer as @value */ +/* note that the @key could be the same pointer as @value */ static int cache_add_entry(struct libmnt_cache *cache, char *key, char *value, int flag) { @@ -135,7 +135,7 @@ static int cache_add_entry(struct libmnt_cache *cache, char *key, return 0; } -/* add tag to the cache, @devname has to be allocated string */ +/* add tag to the cache, @devname has to be an allocated string */ static int cache_add_tag(struct libmnt_cache *cache, const char *tagname, const char *tagval, char *devname, int flag) { @@ -270,13 +270,13 @@ int mnt_cache_read_tags(struct libmnt_cache *cache, const char *devname) DBG(CACHE, mnt_debug_h(cache, "tags for %s requested", devname)); - /* check is device is already cached */ + /* check if device is already cached */ for (i = 0; i < cache->nents; i++) { struct mnt_cache_entry *e = &cache->ents[i]; if (!(e->flag & MNT_CACHE_TAGREAD)) continue; if (strcmp(e->value, devname) == 0) - /* tags has been already read */ + /* tags have already been read */ return 0; } @@ -335,7 +335,7 @@ error: * @token: tag name (e.g "LABEL") * @value: tag value * - * Look up @cache to check it @tag+@value are associated with @devname. + * Look up @cache to check if @tag+@value are associated with @devname. * * Returns: 1 on success or 0. */ @@ -421,7 +421,7 @@ char *mnt_get_fstype(const char *devname, int *ambi, struct libmnt_cache *cache) rc = blkid_do_safeprobe(pr); - DBG(CACHE, mnt_debug_h(cache, "liblkid rc=%d", rc)); + DBG(CACHE, mnt_debug_h(cache, "libblkid rc=%d", rc)); if (!rc && !blkid_probe_lookup_value(pr, "TYPE", &data, NULL)) type = strdup(data); @@ -493,7 +493,7 @@ error: * - /dev/loopN to the loop backing filename * - empty path (NULL) to 'none' * - * Returns: new allocated string with path, result has to be always deallocated + * Returns: newly allocated string with path, result always has to be deallocated * by free(). */ char *mnt_pretty_path(const char *path, struct libmnt_cache *cache) diff --git a/libmount/src/context.c b/libmount/src/context.c index 85281d9c4..e7fc3981a 100644 --- a/libmount/src/context.c +++ b/libmount/src/context.c @@ -108,11 +108,11 @@ void mnt_free_context(struct libmnt_context *cxt) * mnt_reset_context: * @cxt: mount context * - * Resets all information in the context that are directly related to + * Resets all information in the context that is directly related to * the latest mount (spec, source, target, mount options, ....) * - * The match patters, cached fstab, cached canonicalized paths and tags and - * [e]uid are not reseted. You have to use + * The match patterns, cached fstab, cached canonicalized paths and tags and + * [e]uid are not reset. You have to use * * mnt_context_set_fstab(cxt, NULL); * mnt_context_set_cache(cxt, NULL); @@ -120,7 +120,7 @@ void mnt_free_context(struct libmnt_context *cxt) * mnt_context_set_options_pattern(cxt, NULL); * * - * to reset these stuff. + * to reset this stuff. * * Returns: 0 on success, negative number in case of error. */ @@ -164,7 +164,7 @@ int mnt_reset_context(struct libmnt_context *cxt) mnt_context_reset_status(cxt); mnt_context_set_tabfilter(cxt, NULL, NULL); - /* restore non-resetable flags */ + /* restore non-resettable flags */ cxt->flags |= (fl & MNT_FL_EXTERN_FSTAB); cxt->flags |= (fl & MNT_FL_EXTERN_CACHE); cxt->flags |= (fl & MNT_FL_NOMTAB); @@ -225,7 +225,7 @@ static int set_flag(struct libmnt_context *cxt, int flag, int enable) * mnt_context_is_restricted: * @cxt: mount context * - * Returns: 0 for unrestricted mount (user is root), or 1 for non-root mounts + * Returns: 0 for an unrestricted mount (user is root), or 1 for non-root mounts */ int mnt_context_is_restricted(struct libmnt_context *cxt) { @@ -237,7 +237,7 @@ int mnt_context_is_restricted(struct libmnt_context *cxt) * @cxt: mount context * @mode: MNT_OMASK_* flags * - * Controls how to use mount optionsmsource and target paths from fstab/mtab. + * Controls how to use mount optionssource and target paths from fstab/mtab. * * @MNT_OMODE_IGNORE: ignore mtab/fstab options * @@ -247,7 +247,7 @@ int mnt_context_is_restricted(struct libmnt_context *cxt) * * @MNT_OMODE_REPLACE: replace existing options with options from mtab/fstab * - * @MNT_OMODE_FORCE: always read mtab/fstab (although source and target is defined) + * @MNT_OMODE_FORCE: always read mtab/fstab (although source and target are defined) * * @MNT_OMODE_FSTAB: read from fstab * @@ -262,8 +262,8 @@ int mnt_context_is_restricted(struct libmnt_context *cxt) * Notes: * * - MNT_OMODE_USER is always used if mount context is in restricted mode - * - MNT_OMODE_AUTO is used if nothing other is defined - * - the flags are eavaluated in this order: MNT_OMODE_NOTAB, MNT_OMODE_FORCE, + * - MNT_OMODE_AUTO is used if nothing else is defined + * - the flags are evaluated in this order: MNT_OMODE_NOTAB, MNT_OMODE_FORCE, * MNT_OMODE_FSTAB, MNT_OMODE_MTAB and then the mount options from fstab/mtab * are set according to MNT_OMODE_{IGNORE,APPEND,PREPAND,REPLACE} * @@ -297,12 +297,12 @@ int mnt_context_get_optsmode(struct libmnt_context *cxt) * @disable: TRUE or FALSE * * Enable/disable paths canonicalization and tags evaluation. The libmount context - * canonicalies paths when search in fstab and when prepare source and target paths + * canonicalizes paths when searching in fstab and when preparing source and target paths * for mount(2) syscall. * - * This fuction has effect to the private (within context) fstab instance only + * This fuction has an effect on the private (within context) fstab instance only * (see mnt_context_set_fstab()). If you want to use an external fstab then you - * need manage your private struct libmnt_cache (see mnt_table_set_cache(fstab, + * need to manage your private struct libmnt_cache (see mnt_table_set_cache(fstab, * NULL). * * Returns: 0 on success, negative number in case of error. @@ -316,7 +316,7 @@ int mnt_context_disable_canonicalize(struct libmnt_context *cxt, int disable) * mnt_context_is_nocanonicalize: * @cxt: mount context * - * Returns: 1 if no-canonicalize mode enabled or 0. + * Returns: 1 if no-canonicalize mode is enabled or 0. */ int mnt_context_is_nocanonicalize(struct libmnt_context *cxt) { @@ -415,7 +415,7 @@ int mnt_context_enable_rdonly_umount(struct libmnt_context *cxt, int enable) * mnt_context_is_rdonly_umount * @cxt: mount context * - * See also mnt_context_enable_rdonly_umount() and see umount(8) man page, + * See also mnt_context_enable_rdonly_umount() and umount(8) man page, * option -r. * * Returns: 1 if read-only remount failed umount(2) is enables or 0 @@ -607,7 +607,7 @@ int mnt_context_is_verbose(struct libmnt_context *cxt) * @cxt: mount context * @enable: TRUE or FALSE * - * Enable/disable loop delete (destroy) after umount (see umount(8), option -d) + * Enable/disable the loop delete (destroy) after umount (see umount(8), option -d) * * Returns: 0 on success, negative number in case of error. */ @@ -637,8 +637,8 @@ int mnt_context_is_loopdel(struct libmnt_context *cxt) * @fs instance is not deallocated by mnt_free_context() or mnt_reset_context(). * * The @fs will be modified by mnt_context_set_{source,target,options,fstype} - * functions, If the @fs is NULL then all current FS specific setting (source, - * target, etc., exclude spec) is reseted. + * functions, If the @fs is NULL, then all current FS specific settings (source, + * target, etc., exclude spec) are reset. * * Returns: 0 on success, negative number in case of error. */ @@ -662,7 +662,7 @@ int mnt_context_set_fs(struct libmnt_context *cxt, struct libmnt_fs *fs) * Note that the FS is modified by mnt_context_set_{source,target,options,fstype} * functions. * - * Returns: pointer to FS description or NULL in case of calloc() errrr. + * Returns: pointer to FS description or NULL in case of a calloc() error. */ struct libmnt_fs *mnt_context_get_fs(struct libmnt_context *cxt) { @@ -693,7 +693,7 @@ int mnt_context_set_source(struct libmnt_context *cxt, const char *source) * mnt_context_get_source: * @cxt: mount context * - * Returns: returns pointer or NULL in case of error pr if not set. + * Returns: returns pointer or NULL in case of error or if not set. */ const char *mnt_context_get_source(struct libmnt_context *cxt) { @@ -718,7 +718,7 @@ int mnt_context_set_target(struct libmnt_context *cxt, const char *target) * mnt_context_get_target: * @cxt: mount context * - * Returns: returns pointer or NULL in case of error pr if not set. + * Returns: returns pointer or NULL in case of error or if not set. */ const char *mnt_context_get_target(struct libmnt_context *cxt) { @@ -731,8 +731,8 @@ const char *mnt_context_get_target(struct libmnt_context *cxt) * @cxt: mount context * @fstype: filesystem type * - * Note that the @fstype has to be the real FS type. For patterns with - * comma-separated list of filesystems or for "nofs" notation use + * Note that the @fstype has to be a FS type. For patterns with + * comma-separated list of filesystems or for the "nofs" notation, use * mnt_context_set_fstype_pattern(). * * Returns: 0 on success, negative number in case of error. @@ -747,7 +747,7 @@ int mnt_context_set_fstype(struct libmnt_context *cxt, const char *fstype) * mnt_context_get_fstype: * @cxt: mount context * - * Returns: pointer or NULL in case of error pr if not set. + * Returns: pointer or NULL in case of error or if not set. */ const char *mnt_context_get_fstype(struct libmnt_context *cxt) { @@ -788,8 +788,8 @@ int mnt_context_append_options(struct libmnt_context *cxt, const char *optstr) * This function returns mount options set by mnt_context_set_options() or * mnt_context_append_options(). * - * Note that *after* mnt_context_prepare_mount() may the mount options string - * also includes options set by mnt_context_set_mflags() or another options + * Note that *after* mnt_context_prepare_mount(), the mount options string + * may also include options set by mnt_context_set_mflags() or other options * generated by this library. * * Returns: pointer or NULL @@ -862,10 +862,10 @@ int mnt_context_set_options_pattern(struct libmnt_context *cxt, const char *patt * instance. Note that the external instance is not deallocated by mnt_free_context(). * * The fstab is used read-only and is not modified, it should be possible to - * share the fstab between more mount contexts (TODO: tests it.) + * share the fstab between more mount contexts (TODO: test it.) * - * If the @tb argument is NULL then the current private fstab instance is - * reseted. + * If the @tb argument is NULL, then the current private fstab instance is + * reset. * * Returns: 0 on success, negative number in case of error. */ @@ -929,7 +929,7 @@ int mnt_context_get_fstab(struct libmnt_context *cxt, struct libmnt_table **tb) * @tb: returns mtab * * See also mnt_table_parse_mtab() for more details about mtab/mountinfo. The - * result will deallocated by mnt_free_context(@cxt). + * result will be deallocated by mnt_free_context(@cxt). * * Returns: 0 on success, negative number in case of error. */ @@ -971,8 +971,8 @@ int mnt_context_get_mtab(struct libmnt_context *cxt, struct libmnt_table **tb) } /* - * Allows to specify filter for tab file entries. The filter is called by - * table parser. Currently used for mtab and utab only. + * Allows to specify a filter for tab file entries. The filter is called by + * the table parser. Currently used for mtab and utab only. */ int mnt_context_set_tabfilter(struct libmnt_context *cxt, int (*fltr)(struct libmnt_fs *, void *), @@ -1004,7 +1004,7 @@ int mnt_context_set_tabfilter(struct libmnt_context *cxt, * callback and cache for tags and paths is set according to the @cxt setting. * See also mnt_table_parse_file(). * - * It's strongly recommended use mnt_context_get_mtab() and + * It's strongly recommended to use the mnt_context_get_mtab() and * mnt_context_get_fstab() functions for mtab and fstab files. This function * does not care about LIBMOUNT_* env.variables and does not merge userspace * options. @@ -1078,8 +1078,8 @@ int mnt_context_set_tables_errcb(struct libmnt_context *cxt, * allows to overwrite the private cache with an external instance. Note that * the external instance is not deallocated by mnt_free_context(). * - * If the @cache argument is NULL then the current private cache instance is - * reseted. + * If the @cache argument is NULL, then the current private cache instance is + * reset. * * Returns: 0 on success, negative number in case of error. */ @@ -1125,7 +1125,7 @@ struct libmnt_cache *mnt_context_get_cache(struct libmnt_context *cxt) * @release: callback to release (delallocate) password * * Sets callbacks for encryption password (e.g encrypted loopdev). This - * function is deprecated (encrypted loops are no ore supported). + * function is deprecated (encrypted loops are no longer supported). * * Returns: 0 on success, negative number in case of error. */ @@ -1151,7 +1151,7 @@ int mnt_context_set_passwd_cb(struct libmnt_context *cxt, * * The default behavior is to ignore all signals (except SIGALRM and * SIGTRAP for mtab udate) when the lock is locked. If this behavior - * is unacceptable then use: + * is unacceptable, then use: * * lc = mnt_context_get_lock(cxt); * if (lc) @@ -1197,7 +1197,7 @@ struct libmnt_lock *mnt_context_get_lock(struct libmnt_context *cxt) * * mnt_context_set_options(cxt, "noexec,nosuid"); * - * these both calls have the same effect. + * both of these calls have the same effect. * * Returns: 0 on success, negative number in case of error. */ @@ -1227,7 +1227,7 @@ int mnt_context_set_mflags(struct libmnt_context *cxt, unsigned long flags) * @flags: returns MS_* mount flags * * Converts mount options string to MS_* flags and bitewise-OR the result with - * already defined flags (see mnt_context_set_mflags()). + * the already defined flags (see mnt_context_set_mflags()). * * Returns: 0 on success, negative number in case of error. */ @@ -1268,7 +1268,7 @@ int mnt_context_get_mflags(struct libmnt_context *cxt, unsigned long *flags) * * Sets userspace mount flags. * - * See also notest for mnt_context_set_mflags(). + * See also notes for mnt_context_set_mflags(). * * Returns: 0 on success, negative number in case of error. */ @@ -1287,7 +1287,7 @@ int mnt_context_set_user_mflags(struct libmnt_context *cxt, unsigned long flags) * @flags: returns mount flags * * Converts mount options string to MNT_MS_* flags and bitewise-OR the result - * with already defined flags (see mnt_context_set_user_mflags()). + * with the already defined flags (see mnt_context_set_user_mflags()). * * Returns: 0 on success, negative number in case of error. */ @@ -1321,7 +1321,7 @@ int mnt_context_get_user_mflags(struct libmnt_context *cxt, unsigned long *flags * function allows to overwrite this behavior, and @data will be used instead * of mount options. * - * The libmount does not deallocated the data by mnt_free_context(). Note that + * The libmount does not deallocate the data by mnt_free_context(). Note that * NULL is also valid mount data. * * Returns: 0 on success, negative number in case of error. @@ -1362,7 +1362,7 @@ int mnt_context_prepare_srcpath(struct libmnt_context *cxt) return mnt_fs_set_source(cxt->fs, "none"); /* ignore filesystems without source or filesystems - * where the source is quasi-path (//foo/bar) + * where the source is a quasi-path (//foo/bar) */ if (!src || mnt_fs_is_netfs(cxt->fs)) return 0; @@ -1504,8 +1504,8 @@ int mnt_context_prepare_target(struct libmnt_context *cxt) } /* - * It's usully no error when we're not able to detect filesystem type -- we - * will try to use types from /{etc,proc}/filesystems. + * It's usually no error when we're not able to detect the filesystem type -- we + * will try to use the types from /{etc,proc}/filesystems. */ int mnt_context_guess_fstype(struct libmnt_context *cxt) { @@ -1798,8 +1798,8 @@ static int apply_table(struct libmnt_context *cxt, struct libmnt_table *tb, * * mount /foo/bar * - * the path could be a mountpoint as well as source (for - * example bind mount, symlink to device, ...). + * the path could be a mountpoint as well as a source (for + * example bind mount, symlink to a device, ...). */ if (src && !mnt_fs_get_tag(cxt->fs, NULL, NULL)) fs = mnt_table_find_target(tb, src, direction); @@ -1869,7 +1869,7 @@ int mnt_context_apply_fstab(struct libmnt_context *cxt) DBG(CXT, mnt_debug_h(cxt, "force fstab usage for non-root users!")); cxt->optsmode = MNT_OMODE_USER; } else if (cxt->optsmode == 0) { - DBG(CXT, mnt_debug_h(cxt, "use default optmode")); + DBG(CXT, mnt_debug_h(cxt, "use default optsmode")); cxt->optsmode = MNT_OMODE_AUTO; } else if (cxt->optsmode & MNT_OMODE_NOTAB) { cxt->optsmode &= ~MNT_OMODE_FSTAB; @@ -1944,7 +1944,7 @@ int mnt_context_tab_applied(struct libmnt_context *cxt) } /* - * This is not public function! + * This is not a public function! * * Returns 1 if *only propagation flags* change is requested. */ @@ -1974,7 +1974,7 @@ int mnt_context_propagation_only(struct libmnt_context *cxt) * Global libmount status. * * The real exit code of the mount.type helper has to be tested by - * mnt_context_get_helper_status(). The mnt_context_get_status() only inform + * mnt_context_get_helper_status(). The mnt_context_get_status() only informs * that exec() has been successful. * * Returns: 1 if mount.type or mount(2) syscall has been successfully called. @@ -2046,7 +2046,7 @@ int mnt_context_get_syscall_errno(struct libmnt_context *cxt) * * The @status should be 0 on success, or negative number on error (-errno). * - * This function should be used only if [u]mount(2) syscall is NOT called by + * This function should only be used if the [u]mount(2) syscall is NOT called by * libmount code. * * Returns: 0 or negative number in case of error. @@ -2086,11 +2086,11 @@ int mnt_context_strerror(struct libmnt_context *cxt __attribute__((__unused__)), * @action: MNT_ACT_{UMOUNT,MOUNT} * @flags: not used now * - * This function infors libmount that used from [u]mount.type helper. + * This function informs libmount that used from [u]mount.type helper. * * The function also calls mnt_context_disable_helpers() to avoid recursive * mount.type helpers calling. It you really want to call another - * mount.type helper from your helper than you have to explicitly enable this + * mount.type helper from your helper, then you have to explicitly enable this * feature by: * * mnt_context_disable_helpers(cxt, FALSE); @@ -2120,7 +2120,7 @@ int mnt_context_init_helper(struct libmnt_context *cxt, int action, * @c: getopt() result * @arg: getopt() optarg * - * This function applies [u]mount.type command line option (for example parsed + * This function applies the [u]mount.type command line option (for example parsed * by getopt or getopt_long) to @cxt. All unknown options are ignored and * then 1 is returned. * @@ -2145,7 +2145,7 @@ int mnt_context_helper_setopt(struct libmnt_context *cxt, int c, char *arg) * @fs: filesystem * @mounted: returns 1 for mounted and 0 for non-mounted filesystems * - * Please, read mnt_table_is_fs_mounted() description! + * Please, read the mnt_table_is_fs_mounted() description! * * Returns: 0 on success and negative number in case of error. */ @@ -2308,7 +2308,7 @@ int test_mount(struct libmnt_test *ts, int argc, char *argv[]) mnt_context_set_target(cxt, argv[idx++]); } - /* this is unnecessary! -- libmount is able to internaly + /* this is unnecessary! -- libmount is able to internally * create and manage the lock */ lock = mnt_context_get_lock(cxt); diff --git a/libmount/src/context_loopdev.c b/libmount/src/context_loopdev.c index 576b7f55a..37fadb70b 100644 --- a/libmount/src/context_loopdev.c +++ b/libmount/src/context_loopdev.c @@ -47,10 +47,10 @@ int mnt_context_is_loopdev(struct libmnt_context *cxt) /* Automatically create a loop device from a regular file if a * filesystem is not specified or the filesystem is known for libblkid * (these filesystems work with block devices only). The file size - * should be at least 1KiB otherwise we will create empty loopdev where - * is no mountable filesystem... + * should be at least 1KiB, otherwise we will create an empty loopdev with + * no mountable filesystem... * - * Note that there is not a restriction (on kernel side) that prevents regular + * Note that there is no restriction (on kernel side) that would prevent a regular * file as a mount(2) source argument. A filesystem that is able to mount * regular files could be implemented. */ @@ -73,7 +73,7 @@ int mnt_context_is_loopdev(struct libmnt_context *cxt) } -/* Check, if there already exists a mounted loop device on the mountpoint node +/* Check if there already exists a mounted loop device on the mountpoint node * with the same parameters. */ static int __attribute__((nonnull)) @@ -100,7 +100,7 @@ is_mounted_same_loopfile(struct libmnt_context *cxt, cache = mnt_context_get_cache(cxt); mnt_reset_iter(&itr, MNT_ITER_BACKWARD); - /* Search for mountpoint node in mtab, procceed if any of these has the + /* Search for a mountpoint node in mtab, proceed if any of these have the * loop option set or the device is a loop device */ while (mnt_table_next_fs(tb, &itr, &fs) == 0) { @@ -282,7 +282,7 @@ int mnt_context_setup_loopdev(struct libmnt_context *cxt) if ((cxt->user_mountflags & MNT_MS_LOOP) && loopcxt_is_autoclear(&lc)) { /* - * autoclear flag accepted by kernel, don't store + * autoclear flag accepted by the kernel, don't store * the "loop=" option to mtab. */ cxt->user_mountflags &= ~MNT_MS_LOOP; @@ -298,7 +298,7 @@ int mnt_context_setup_loopdev(struct libmnt_context *cxt) mnt_context_set_mflags(cxt, cxt->mountflags | MS_RDONLY); /* we have to keep the device open until mount(1), - * otherwise it will auto-cleared by kernel + * otherwise it will be auto-cleared by kernel */ cxt->loopdev_fd = loopcxt_get_fd(&lc); loopcxt_set_fd(&lc, -1, 0); diff --git a/libmount/src/context_mount.c b/libmount/src/context_mount.c index d6691eb6a..94db1acda 100644 --- a/libmount/src/context_mount.c +++ b/libmount/src/context_mount.c @@ -129,8 +129,8 @@ static int fix_optstr(struct libmnt_context *cxt) /* * The "user" options is our business (so we can modify the option), - * but exception is command line for /sbin/mount. helpers. Let's - * save the original user= to call the helpers with unchanged + * the exception is command line for /sbin/mount. helpers. Let's + * save the original user= to call the helpers with an unchanged * "user" setting. */ if (cxt->user_mountflags & MNT_MS_USER) { @@ -255,7 +255,7 @@ done: } /* - * Converts already evaluated and fixed options to the form that is compatible + * Converts the already evaluated and fixed options to the form that is compatible * with /sbin/mount.type helpers. */ static int generate_helper_optstr(struct libmnt_context *cxt, char **optstr) @@ -278,13 +278,13 @@ static int generate_helper_optstr(struct libmnt_context *cxt, char **optstr) if (cxt->user_mountflags & MNT_MS_USER) { /* * This is unnecessary for real user-mounts as mount. - * helpers have to always follow fstab rather than mount - * options on command line. + * helpers always have to follow fstab rather than mount + * options on the command line. * - * But if you call mount. as root then the helper follows - * command line. If there is (for example) "user,exec" in fstab + * However, if you call mount. as root, then the helper follows + * the command line. If there is (for example) "user,exec" in fstab, * then we have to manually append the "exec" back to the options - * string, bacause there is nothing like MS_EXEC (we have only + * string, bacause there is nothing like MS_EXEC (we only have * MS_NOEXEC in mount flags and we don't care about the original * mount string in libmount for VFS options). */ @@ -330,7 +330,7 @@ err: /* * this has to be called before fix_optstr() * - * Note that user= maybe be used by some filesystems as filesystem + * Note that user= may be used by some filesystems as a filesystem * specific option (e.g. cifs). Yes, developers of such filesystems have * allocated pretty hot place in hell... */ @@ -433,7 +433,7 @@ static int evaluate_permissions(struct libmnt_context *cxt) /* * mnt_context_helper_setopt() backend * - * This function applies mount.type command line option (for example parsed + * This function applies the mount.type command line option (for example parsed * by getopt() or getopt_long()) to @cxt. All unknown options are ignored and * then 1 is returned. * @@ -519,7 +519,7 @@ static int exec_helper(struct libmnt_context *cxt) /* * TODO: remove the exception for "nfs", -s is documented - * for years should be usable everywhere. + * for years and should be usable everywhere. */ if (mnt_context_is_sloppy(cxt) && type && startswith(type, "nfs")) @@ -651,7 +651,7 @@ static int do_mount(struct libmnt_context *cxt, const char *try_type) return -EINVAL; if (!src) { /* unnecessary, should be already resolved in - * mnt_context_prepare_srcpath(), but for sure... */ + * mnt_context_prepare_srcpath(), but to be sure... */ DBG(CXT, mnt_debug_h(cxt, "WARNING: source is NULL -- using \"none\"!")); src = "none"; } @@ -831,10 +831,10 @@ int mnt_context_prepare_mount(struct libmnt_context *cxt) * Call mount(2) or mount.type helper. Unnecessary for mnt_context_mount(). * * Note that this function could be called only once. If you want to mount - * another source or target than you have to call mnt_reset_context(). + * another source or target, then you have to call mnt_reset_context(). * - * If you want to call mount(2) for the same source and target with a different - * mount flags or fstype then call mnt_context_reset_status() and then try + * If you want to call mount(2) for the same source and target with different + * mount flags or fstype, then call mnt_context_reset_status() and then try * again mnt_context_do_mount(). * * WARNING: non-zero return code does not mean that mount(2) syscall or @@ -867,7 +867,7 @@ int mnt_context_do_mount(struct libmnt_context *cxt) type = mnt_fs_get_fstype(cxt->fs); if (type) { if (strchr(type, ',')) - /* this only happens if fstab contains list of filesystems */ + /* this only happens if fstab contains a list of filesystems */ res = do_mount_by_pattern(cxt, type); else res = do_mount(cxt, NULL); @@ -935,7 +935,7 @@ int mnt_context_finalize_mount(struct libmnt_context *cxt) * mnt_context_mount: * @cxt: mount context * - * High-level, mounts filesystem by mount(2) or fork()+exec(/sbin/mount.type). + * High-level, mounts the filesystem by mount(2) or fork()+exec(/sbin/mount.type). * * This is similar to: * @@ -945,10 +945,10 @@ int mnt_context_finalize_mount(struct libmnt_context *cxt) * * See also mnt_context_disable_helpers(). * - * Note that this function could be called only once. If you want to mount with - * different setting than you have to call mnt_reset_context(). It's NOT enough - * to call mnt_context_reset_status() if you want call this function more than - * once, whole context has to be reseted. + * Note that this function should be called only once. If you want to mount with + * different settings, then you have to call mnt_reset_context(). It's NOT enough + * to call mnt_context_reset_status(). If you want to call this function more than + * once, the whole context has to be reset. * * WARNING: non-zero return code does not mean that mount(2) syscall or * mount.type helper wasn't successfully called. @@ -974,7 +974,7 @@ int mnt_context_mount(struct libmnt_context *cxt) if (!rc) rc = mnt_context_do_mount(cxt); - /* TODO: if mtab update is expected then check if the + /* TODO: if a mtab update is expected, then check if the * target is really mounted read-write to avoid 'ro' in * mtab and 'rw' in /proc/mounts. */ @@ -989,7 +989,7 @@ int mnt_context_mount(struct libmnt_context *cxt) * @itr: iterator * @fs: returns the current filesystem * @mntrc: returns the return code from mnt_context_mount() - * @ignored: returns 1 for not matching and 2 for already mounted filesystems + * @ignored: returns 1 for non-matching and 2 for already mounted filesystems * * This function tries to mount the next filesystem from fstab (as returned by * mnt_context_get_fstab()). See also mnt_context_set_fstab(). @@ -1057,11 +1057,11 @@ int mnt_context_next_mount(struct libmnt_context *cxt, /* ignore noauto filesystems */ (o && mnt_optstr_get_option(o, "noauto", NULL, NULL) == 0) || - /* ignore filesystems not match with options patterns */ + /* ignore filesystems which don't match options patterns */ (cxt->fstype_pattern && !mnt_fs_match_fstype(*fs, cxt->fstype_pattern)) || - /* ignore filesystems not match with type patterns */ + /* ignore filesystems which don't match type patterns */ (cxt->optstr_pattern && !mnt_fs_match_options(*fs, cxt->optstr_pattern))) { if (ignored) diff --git a/libmount/src/context_umount.c b/libmount/src/context_umount.c index 7707991eb..2b791c44d 100644 --- a/libmount/src/context_umount.c +++ b/libmount/src/context_umount.c @@ -23,7 +23,7 @@ * umount2 flags */ #ifndef MNT_FORCE -# define MNT_FORCE 0x00000001 /* Attempt to forcibily umount */ +# define MNT_FORCE 0x00000001 /* Attempt to forcibly umount */ #endif #ifndef MNT_DETACH @@ -39,8 +39,8 @@ #endif /* - * Called by mtab parser to filter out entries, nonzero means that - * entry has to be filter out. + * Called by mtab parser to filter out entries, non-zero means that + * an entry has to be filtered out. */ static int mtab_filter(struct libmnt_fs *fs, void *data) { @@ -80,16 +80,16 @@ int mnt_context_find_umount_fs(struct libmnt_context *cxt, DBG(CXT, mnt_debug_h(cxt, "umount: lookup FS for '%s'", tgt)); if (!*tgt) - return 1; /* empty string is not error */ + return 1; /* empty string is not an error */ /* - * The mtab file maybe huge and on systems with utab we have to merge + * The mtab file may be huge and on systems with utab we have to merge * userspace mount options into /proc/self/mountinfo. This all is * expensive. The mtab filter allows to filter out entries, then * mtab and utab are very tiny files. * * *but*... the filter uses mnt_fs_streq_{target,srcpath} functions - * where LABEL, UUID or symlinks are to canonicalized. It means that + * where LABEL, UUID or symlinks are canonicalized. It means that * it's usable only for canonicalized stuff (e.g. kernel mountinfo). */ if (!cxt->mtab_writable && *tgt == '/' && @@ -98,7 +98,7 @@ int mnt_context_find_umount_fs(struct libmnt_context *cxt, struct stat st; if (stat(tgt, &st) == 0 && S_ISDIR(st.st_mode)) { - /* we'll canonicalized /proc/self/mountinfo */ + /* we'll canonicalize /proc/self/mountinfo */ cache = mnt_context_get_cache(cxt); cn_tgt = mnt_resolve_path(tgt, cache); if (cn_tgt) @@ -246,7 +246,7 @@ static int is_associated_fs(const char *devname, struct libmnt_fs *fs) if (!src) return 0; - /* check for offset option in @fs */ + /* check for the offset option in @fs */ optstr = (char *) mnt_fs_get_user_options(fs); if (optstr && @@ -326,7 +326,7 @@ static int evaluate_permissions(struct libmnt_context *cxt) } /* - * User mounts has to be in /etc/fstab + * User mounts have to be in /etc/fstab */ rc = mnt_context_get_fstab(cxt, &fstab); if (rc) @@ -345,13 +345,13 @@ static int evaluate_permissions(struct libmnt_context *cxt) * /dev/sda1 /mnt/zip auto user,noauto 0 0 * /dev/sda4 /mnt/zip auto user,noauto 0 0 * then "mount /dev/sda4" followed by "umount /mnt/zip" used to fail. - * So, we must not look for file, but for the pair (dev,file) in fstab. + * So, we must not look for the file, but for the pair (dev,file) in fstab. */ fs = mnt_table_find_pair(fstab, src, tgt, MNT_ITER_FORWARD); if (!fs) { /* * It's possible that there is /path/file.img in fstab and - * /dev/loop0 in mtab -- then we have to check releation + * /dev/loop0 in mtab -- then we have to check the relation * between loopdev and the file. */ fs = mnt_table_find_target(fstab, tgt, MNT_ITER_FORWARD); @@ -393,7 +393,7 @@ static int evaluate_permissions(struct libmnt_context *cxt) return 0; } /* - * Check user= setting from mtab if there is user, owner or + * Check user= setting from mtab if there is a user, owner or * group option in /etc/fstab */ if (u_flags & (MNT_MS_USER | MNT_MS_OWNER | MNT_MS_GROUP)) { @@ -548,7 +548,7 @@ int mnt_context_umount_setopt(struct libmnt_context *cxt, int c, char *arg) return rc; } -/* Check whether the kernel supports UMOUNT_NOFOLLOW flag */ +/* Check whether the kernel supports the UMOUNT_NOFOLLOW flag */ static int umount_nofollow_support(void) { int res = umount2("", UMOUNT_UNUSED); @@ -869,7 +869,7 @@ int mnt_context_umount(struct libmnt_context *cxt) * mnt_context_set_options_pattern() to simulate umount -a -O pattern * mnt_context_set_fstype_pattern() to simulate umount -a -t pattern * - * If the filesystem is not mounted or does not match defined criteria, + * If the filesystem is not mounted or does not match the defined criteria, * then the function mnt_context_next_umount() returns zero, but the @ignored is * non-zero. Note that the root filesystem is always ignored. * @@ -918,11 +918,11 @@ int mnt_context_next_umount(struct libmnt_context *cxt, DBG(CXT, mnt_debug_h(cxt, "next-umount: trying %s", tgt)); - /* ignore filesystems not match with options patterns */ + /* ignore filesystems which don't match options patterns */ if ((cxt->fstype_pattern && !mnt_fs_match_fstype(*fs, cxt->fstype_pattern)) || - /* ignore filesystems not match with type patterns */ + /* ignore filesystems which don't match type patterns */ (cxt->optstr_pattern && !mnt_fs_match_options(*fs, cxt->optstr_pattern))) { if (ignored) diff --git a/libmount/src/fs.c b/libmount/src/fs.c index fc2eee7aa..97c606211 100644 --- a/libmount/src/fs.c +++ b/libmount/src/fs.c @@ -107,7 +107,7 @@ static inline int cpy_str_at_offset(void *new, const void *old, size_t offset) char **n = (char **) (new + offset); if (*n) - return 0; /* already set, not overwrite */ + return 0; /* already set, don't overwrite */ return update_str(n, *o); } @@ -118,7 +118,7 @@ static inline int cpy_str_at_offset(void *new, const void *old, size_t offset) * @src: source FS * * If @dest is NULL, then a new FS is allocated, if any @dest field is already - * set then the field is NOT overwrited. + * set, then the field is NOT overwritten. * * This function does not copy userdata (se mnt_fs_set_userdata()). A new copy is * not linked with any existing mnt_tab. @@ -311,7 +311,7 @@ const char *mnt_fs_get_source(struct libmnt_fs *fs) } /* - * Used by parser ONLY (@source has to be freed on error) + * Used by the parser ONLY (@source has to be freed on error) */ int __mnt_fs_set_source_ptr(struct libmnt_fs *fs, char *source) { @@ -374,7 +374,7 @@ int mnt_fs_set_source(struct libmnt_fs *fs, const char *source) * @fs: fs * @path: source path * - * Compares @fs source path with @path. The tailing slash is ignored. + * Compares @fs source path with @path. The trailing slash is ignored. * See also mnt_fs_match_source(). * * Returns: 1 if @fs source path equal to @path, otherwise 0. @@ -403,7 +403,7 @@ int mnt_fs_streq_srcpath(struct libmnt_fs *fs, const char *path) * @fs: fs * @path: mount point * - * Compares @fs target path with @path. The tailing slash is ignored. + * Compares @fs target path with @path. The trailing slash is ignored. * See also mnt_fs_match_target(). * * Returns: 1 if @fs target path equal to @path, otherwise 0. @@ -422,8 +422,8 @@ int mnt_fs_streq_target(struct libmnt_fs *fs, const char *path) * * "TAG" is NAME=VALUE (e.g. LABEL=foo) * - * The TAG is the first column in the fstab file. The TAG or "srcpath" has to - * be always set for all entries. + * The TAG is the first column in the fstab file. The TAG or "srcpath" always has + * to be set for all entries. * * See also mnt_fs_get_source(). * @@ -445,7 +445,7 @@ int mnt_fs_streq_target(struct libmnt_fs *fs, const char *path) * * * - * Returns: 0 on success or negative number in case that a TAG is not defined. + * Returns: 0 on success or negative number in case a TAG is not defined. */ int mnt_fs_get_tag(struct libmnt_fs *fs, const char **name, const char **value) { @@ -506,10 +506,10 @@ static int mnt_fs_get_flags(struct libmnt_fs *fs) /** * mnt_fs_get_propagation: * @fs: mountinfo entry - * @flags: returns propagation MS_* flags as present in mountinfo file + * @flags: returns propagation MS_* flags as present in the mountinfo file * - * Note that this function set @flags to zero if not found any propagation flag - * in mountinfo file. The kernel default is MS_PRIVATE, this flag is not stored + * Note that this function sets @flags to zero if no propagation flags are found + * in the mountinfo file. The kernel default is MS_PRIVATE, this flag is not stored * in the mountinfo file. * * Returns: 0 on success or negative number in case of error. @@ -598,7 +598,7 @@ const char *mnt_fs_get_fstype(struct libmnt_fs *fs) return fs ? fs->fstype : NULL; } -/* Used by struct libmnt_file parser only */ +/* Used by the struct libmnt_file parser only */ int __mnt_fs_set_fstype_ptr(struct libmnt_fs *fs, char *fstype) { assert(fs); @@ -674,7 +674,7 @@ static char *merge_optstr(const char *vfs, const char *fs) if (!strcmp(vfs, fs)) return strdup(vfs); /* e.g. "aaa" and "aaa" */ - /* leave space for leading "r[ow],", "," and trailing zero */ + /* leave space for the leading "r[ow],", "," and the trailing zero */ sz = strlen(vfs) + strlen(fs) + 5; res = malloc(sz); if (!res) @@ -705,7 +705,7 @@ static char *merge_optstr(const char *vfs, const char *fs) * mnt_fs_strdup_options: * @fs: fstab/mtab/mountinfo entry pointer * - * Merges all mount options (VFS, FS and userspace) to the one options string + * Merges all mount options (VFS, FS and userspace) to one options string * and returns the result. This function does not modigy @fs. * * Returns: pointer to string (can be freed by free(3)) or NULL in case of error. @@ -761,10 +761,10 @@ const char *mnt_fs_get_optional_fields(struct libmnt_fs *fs) * @fs: fstab/mtab/mountinfo entry pointer * @optstr: options string * - * Splits @optstr to VFS, FS and userspace mount options and update relevat + * Splits @optstr to VFS, FS and userspace mount options and updates relevant * parts of @fs. * - * Returns: 0 on success, or negative number icase of error. + * Returns: 0 on success, or negative number in case of error. */ int mnt_fs_set_options(struct libmnt_fs *fs, const char *optstr) { @@ -803,7 +803,7 @@ int mnt_fs_set_options(struct libmnt_fs *fs, const char *optstr) * Parses (splits) @optstr and appends results to VFS, FS and userspace lists * of options. * - * If @optstr is NULL then @fs is not modified and 0 is returned. + * If @optstr is NULL, then @fs is not modified and 0 is returned. * * Returns: 0 on success or negative number in case of error. */ @@ -840,10 +840,10 @@ int mnt_fs_append_options(struct libmnt_fs *fs, const char *optstr) * @fs: fstab/mtab/mountinfo entry * @optstr: mount options * - * Parses (splits) @optstr and prepands results to VFS, FS and userspace lists + * Parses (splits) @optstr and prepends the results to VFS, FS and userspace lists * of options. * - * If @optstr is NULL then @fs is not modified and 0 is returned. + * If @optstr is NULL, then @fs is not modified and 0 is returned. * * Returns: 0 on success or negative number in case of error. */ @@ -929,10 +929,10 @@ const char *mnt_fs_get_attributes(struct libmnt_fs *fs) * @optstr: options string * * Sets mount attributes. The attributes are mount(2) and mount(8) independent - * options, these options are not send to kernel and are not interpreted by + * options, these options are not sent to the kernel and are not interpreted by * libmount. The attributes are stored in /run/mount/utab only. * - * The atrtributes are managed by libmount in userspace only. It's possible + * The attributes are managed by libmount in userspace only. It's possible * that information stored in userspace will not be available for libmount * after CLONE_FS unshare. Be careful, and don't use attributes if possible. * @@ -1225,7 +1225,7 @@ dev_t mnt_fs_get_devno(struct libmnt_fs *fs) * mnt_fs_get_tid: * @fs: /proc/tid/mountinfo entry * - * Returns: TID (task ID) for filesystems read from mountinfo file + * Returns: TID (task ID) for filesystems read from the mountinfo file */ pid_t mnt_fs_get_tid(struct libmnt_fs *fs) { @@ -1237,10 +1237,10 @@ pid_t mnt_fs_get_tid(struct libmnt_fs *fs) * mnt_fs_get_option: * @fs: fstab/mtab/mountinfo entry pointer * @name: option name - * @value: returns pointer to the begin of the value (e.g. name=VALUE) or NULL + * @value: returns pointer to the beginning of the value (e.g. name=VALUE) or NULL * @valsz: returns size of options value or 0 * - * Returns: 0 on success, 1 when not found the @name or negative number in case of error. + * Returns: 0 on success, 1 when @name not found or negative number in case of error. */ int mnt_fs_get_option(struct libmnt_fs *fs, const char *name, char **value, size_t *valsz) @@ -1263,10 +1263,10 @@ int mnt_fs_get_option(struct libmnt_fs *fs, const char *name, * mnt_fs_get_attribute: * @fs: fstab/mtab/mountinfo entry pointer * @name: option name - * @value: returns pointer to the begin of the value (e.g. name=VALUE) or NULL + * @value: returns pointer to the beginning of the value (e.g. name=VALUE) or NULL * @valsz: returns size of options value or 0 * - * Returns: 0 on success, 1 when not found the @name or negative number in case of error. + * Returns: 0 on success, 1 when @name not found or negative number in case of error. */ int mnt_fs_get_attribute(struct libmnt_fs *fs, const char *name, char **value, size_t *valsz) @@ -1301,7 +1301,7 @@ const char *mnt_fs_get_comment(struct libmnt_fs *fs) * @comm: comment string * * Note that the comment has to be terminated by '\n' (new line), otherwise - * whole filesystem entry will be written as a comment to the tabfile (e.g. + * the whole filesystem entry will be written as a comment to the tabfile (e.g. * fstab). * * Returns: 0 on success or <0 in case of error. @@ -1356,7 +1356,7 @@ int mnt_fs_append_comment(struct libmnt_fs *fs, const char *comm) * * The 2nd and 3rd attempts are not performed when @cache is NULL. * - * Returns: 1 if @fs target is equal to @target else 0. + * Returns: 1 if @fs target is equal to @target, else 0. */ int mnt_fs_match_target(struct libmnt_fs *fs, const char *target, struct libmnt_cache *cache) @@ -1391,7 +1391,7 @@ int mnt_fs_match_target(struct libmnt_fs *fs, const char *target, * @source: tag or path (device or so) or NULL * @cache: tags/paths cache or NULL * - * Possible are four attempts: + * Four attempts are possible: * 1) compare @source with @fs->source * 2) compare realpath(@source) with @fs->source * 3) compare realpath(@source) with realpath(@fs->source) @@ -1400,7 +1400,7 @@ int mnt_fs_match_target(struct libmnt_fs *fs, const char *target, * The 2nd, 3rd and 4th attempts are not performed when @cache is NULL. The * 2nd and 3rd attempts are not performed if @fs->source is tag. * - * Returns: 1 if @fs source is equal to @source else 0. + * Returns: 1 if @fs source is equal to @source, else 0. */ int mnt_fs_match_source(struct libmnt_fs *fs, const char *source, struct libmnt_cache *cache) @@ -1444,14 +1444,14 @@ int mnt_fs_match_source(struct libmnt_fs *fs, const char *source, return 1; } if (src || mnt_fs_get_tag(fs, &t, &v)) - /* src path does not match and tag is not defined */ + /* src path does not match and the tag is not defined */ return 0; /* read @source's tags to the cache */ if (mnt_cache_read_tags(cache, cn) < 0) { if (errno == EACCES) { /* we don't have permissions to read TAGs from - * @source, but can translate @fs tag to devname. + * @source, but can translate the @fs tag to devname. * * (because libblkid uses udev symlinks and this is * accessible for non-root uses) @@ -1463,7 +1463,7 @@ int mnt_fs_match_source(struct libmnt_fs *fs, const char *source, return 0; } - /* 4) has the @source a tag that matches with tag from @fs ? */ + /* 4) has the @source a tag that matches with the tag from @fs ? */ if (mnt_cache_device_has_tag(cache, cn, t, v)) return 1; @@ -1477,7 +1477,7 @@ int mnt_fs_match_source(struct libmnt_fs *fs, const char *source, * * For more details see mnt_match_fstype(). * - * Returns: 1 if @fs type is matching to @types else 0. The function returns + * Returns: 1 if @fs type is matching to @types, else 0. The function returns * 0 when types is NULL. */ int mnt_fs_match_fstype(struct libmnt_fs *fs, const char *types) @@ -1493,7 +1493,7 @@ int mnt_fs_match_fstype(struct libmnt_fs *fs, const char *types) * * For more details see mnt_match_options(). * - * Returns: 1 if @fs type is matching to @options else 0. The function returns + * Returns: 1 if @fs type is matching to @options, else 0. The function returns * 0 when types is NULL. */ int mnt_fs_match_options(struct libmnt_fs *fs, const char *options) @@ -1568,7 +1568,7 @@ int mnt_fs_print_debug(struct libmnt_fs *fs, FILE *file) * mnt_free_mntent: * @mnt: mount entry * - * Deallocates "mntent.h" mount entry. + * Deallocates the "mntent.h" mount entry. */ void mnt_free_mntent(struct mntent *mnt) { @@ -1586,11 +1586,11 @@ void mnt_free_mntent(struct mntent *mnt) * @fs: filesystem * @mnt: mount description (as described in mntent.h) * - * Copies information from @fs to struct mntent @mnt. If @mnt is already set + * Copies the information from @fs to struct mntent @mnt. If @mnt is already set, * then the struct mntent items are reallocated and updated. See also * mnt_free_mntent(). * - * Returns: 0 on success and negative number in case of error. + * Returns: 0 on success and a negative number in case of error. */ int mnt_fs_to_mntent(struct libmnt_fs *fs, struct mntent **mnt) { diff --git a/libmount/src/init.c b/libmount/src/init.c index 4e5f489c4..d1b17f048 100644 --- a/libmount/src/init.c +++ b/libmount/src/init.c @@ -8,7 +8,7 @@ /** * SECTION: init * @title: Library initialization - * @short_description: initialize debuging + * @short_description: initialize debugging */ #include @@ -19,13 +19,13 @@ int libmount_debug_mask; /** * mnt_init_debug: - * @mask: debug mask (0xffff to enable full debuging) + * @mask: debug mask (0xffff to enable full debugging) * - * If the @mask is not specified then this function reads - * LIBMOUNT_DEBUG environment variable to get the mask. + * If the @mask is not specified, then this function reads + * the LIBMOUNT_DEBUG environment variable to get the mask. * - * Already initialized debugging stuff cannot be changed. It does not - * have effect to call this function twice. + * Already initialized debugging stuff cannot be changed. Calling + * this function twice has no effect. */ void mnt_init_debug(int mask) { diff --git a/libmount/src/iter.c b/libmount/src/iter.c index d7b8adbef..016f88e35 100644 --- a/libmount/src/iter.c +++ b/libmount/src/iter.c @@ -10,8 +10,8 @@ * @title: Iterator * @short_description: unified iterator * - * The iterator keeps direction and last position for access to the internal - * library tables/lists. + * The iterator keeps the direction and the last position + * for access to the internal library tables/lists. */ #include #include @@ -38,7 +38,7 @@ struct libmnt_iter *mnt_new_iter(int direction) * mnt_free_iter: * @itr: iterator pointer * - * Deallocates iterator. + * Deallocates the iterator. */ void mnt_free_iter(struct libmnt_iter *itr) { @@ -48,9 +48,9 @@ void mnt_free_iter(struct libmnt_iter *itr) /** * mnt_reset_iter: * @itr: iterator pointer - * @direction: MNT_INTER_{FOR,BACK}WARD or -1 to keep the derection unchanged + * @direction: MNT_INTER_{FOR,BACK}WARD or -1 to keep the direction unchanged * - * Resets iterator. + * Resets the iterator. */ void mnt_reset_iter(struct libmnt_iter *itr, int direction) { diff --git a/libmount/src/libmount.h.in b/libmount/src/libmount.h.in index 5eb7c48b8..8d18a8993 100644 --- a/libmount/src/libmount.h.in +++ b/libmount/src/libmount.h.in @@ -41,7 +41,7 @@ struct libmnt_cache; /** * libmnt_lock: * - * Stores information about locked file (e.g. /etc/mtab) + * Stores information about the locked file (e.g. /etc/mtab) */ struct libmnt_lock; @@ -731,10 +731,10 @@ extern int mnt_context_set_syscall_status(struct libmnt_context *cxt, int status #define MS_NODIRATIME 0x800 /* 2048: Don't update directory access times */ #endif #ifndef MS_BIND -#define MS_BIND 0x1000 /* 4096: Mount existing tree also elsewhere */ +#define MS_BIND 0x1000 /* 4096: Mount existing tree elsewhere as well */ #endif #ifndef MS_MOVE -#define MS_MOVE 0x2000 /* 8192: Atomically move tree */ +#define MS_MOVE 0x2000 /* 8192: Atomically move the tree */ #endif #ifndef MS_REC #define MS_REC 0x4000 /* 16384: Recursive loopback */ diff --git a/libmount/src/lock.c b/libmount/src/lock.c index f381e423e..82086da24 100644 --- a/libmount/src/lock.c +++ b/libmount/src/lock.c @@ -10,9 +10,9 @@ * @title: Locking * @short_description: locking methods for /etc/mtab or another libmount files * - * The mtab lock is backwardly compatible with the standard linux /etc/mtab + * The mtab lock is backwards compatible with the standard linux /etc/mtab * locking. Note, it's necessary to use the same locking schema in all - * application that access the file. + * applications that access the file. */ #include #include @@ -247,7 +247,7 @@ static void mnt_lockalrm_handler(int sig __attribute__((__unused__))) /* * Waits for F_SETLKW, unfortunately we have to use SIGALRM here to interrupt - * fcntl() to avoid never ending waiting. + * fcntl() to avoid neverending waiting. * * Returns: 0 on success, 1 on timeout, -errno on error. */ @@ -293,7 +293,7 @@ static int mnt_wait_mtab_lock(struct libmnt_lock *ml, struct flock *fl, time_t m * soon as the lock file is deleted by the first mount, and immediately * afterwards a third mount comes, creates a new /etc/mtab~, applies * flock to that, and also proceeds, so that the second and third mount - * now both are scribbling in /etc/mtab. + * are now both scribbling in /etc/mtab. * * The new code uses a link() instead of a creat(), where we proceed * only if it was us that created the lock, and hence we always have @@ -308,13 +308,13 @@ static int mnt_wait_mtab_lock(struct libmnt_lock *ml, struct flock *fl, time_t m * The original mount locking code has used sleep(1) between attempts and * maximal number of attempts has been 5. * - * There was very small number of attempts and extremely long waiting (1s) + * There was a very small number of attempts and extremely long waiting (1s) * that is useless on machines with large number of mount processes. * - * Now we wait few thousand microseconds between attempts and we have a global - * time limit (30s) rather than limit for number of attempts. The advantage + * Now we wait for a few thousand microseconds between attempts and we have a global + * time limit (30s) rather than a limit for the number of attempts. The advantage * is that this method also counts time which we spend in fcntl(F_SETLKW) and - * number of attempts is not restricted. + * the number of attempts is not restricted. * -- kzak@redhat.com [Mar-2007] * * @@ -327,7 +327,7 @@ static int mnt_wait_mtab_lock(struct libmnt_lock *ml, struct flock *fl, time_t m * -- kzak@redhat.com [May-2009] */ -/* maximum seconds between first and last attempt */ +/* maximum seconds between the first and the last attempt */ #define MOUNTLOCK_MAXTIME 30 /* sleep time (in microseconds, max=999999) between attempts */ @@ -340,9 +340,9 @@ static void unlock_mtab(struct libmnt_lock *ml) if (!ml->locked && ml->lockfile && ml->linkfile) { - /* We have (probably) all files, but we don't own the lock, + /* We (probably) have all the files, but we don't own the lock, * Really? Check it! Maybe ml->locked wasn't set properly - * because code was interrupted by signal. Paranoia? Yes. + * because the code was interrupted by a signal. Paranoia? Yes. * * We own the lock when linkfile == lockfile. */ @@ -492,10 +492,10 @@ failed: * mnt_lock_file * @ml: pointer to struct libmnt_lock instance * - * Creates lock file (e.g. /etc/mtab~). Note that this function may + * Creates a lock file (e.g. /etc/mtab~). Note that this function may * use alarm(). * - * Your application has to always call mnt_unlock_file() before exit. + * Your application always has to call mnt_unlock_file() before exit. * * Traditional mtab locking scheme: * @@ -522,7 +522,7 @@ int mnt_lock_file(struct libmnt_lock *ml) * mnt_unlock_file: * @ml: lock struct * - * Unlocks the file. The function could be called independently on the + * Unlocks the file. The function could be called independently of the * lock status (for example from exit(3)). */ void mnt_unlock_file(struct libmnt_lock *ml) @@ -670,7 +670,7 @@ int test_lock(struct libmnt_test *ts, int argc, char *argv[]) mnt_free_lock(lock); lock = NULL; - /* The mount command usually finish after mtab update. We + /* The mount command usually finishes after a mtab update. We * simulate this via short sleep -- it's also enough to make * concurrent processes happy. */ diff --git a/libmount/src/mountP.h b/libmount/src/mountP.h index 28b77d0c3..1ba7d5c48 100644 --- a/libmount/src/mountP.h +++ b/libmount/src/mountP.h @@ -203,7 +203,7 @@ struct libmnt_iter { /* - * This struct represents one entry in mtab/fstab/mountinfo file. + * This struct represents one entry in a mtab/fstab/mountinfo file. * (note that fstab[1] means the first column from fstab, and so on...) */ struct libmnt_fs { @@ -281,6 +281,7 @@ struct libmnt_table { struct list_head ents; /* list of entries (libmnt_fs) */ + void *userdata; }; extern struct libmnt_table *__mnt_new_table_from_file(const char *filename, int fmt); @@ -391,7 +392,7 @@ struct libmnt_context #define MNT_FL_SAVED_USER (1 << 23) #define MNT_FL_PREPARED (1 << 24) #define MNT_FL_HELPER (1 << 25) /* [u]mount. */ -#define MNT_FL_LOOPDEV_READY (1 << 26) /* /dev/loop initialized by library */ +#define MNT_FL_LOOPDEV_READY (1 << 26) /* /dev/loop initialized by the library */ #define MNT_FL_MOUNTOPTS_FIXED (1 << 27) /* default flags */ diff --git a/libmount/src/optmap.c b/libmount/src/optmap.c index 7c0a23508..504a5cf85 100644 --- a/libmount/src/optmap.c +++ b/libmount/src/optmap.c @@ -78,7 +78,7 @@ static const struct libmnt_optmap linux_flags_map[] = { "dirsync", MS_DIRSYNC }, /* synchronous directory modifications */ { "remount", MS_REMOUNT, MNT_NOMTAB }, /* alter flags of mounted FS */ - { "bind", MS_BIND }, /* Remount part of tree elsewhere */ + { "bind", MS_BIND }, /* Remount part of the tree elsewhere */ { "rbind", MS_BIND | MS_REC }, /* Idem, plus mounted subtrees */ #ifdef MS_NOSUB { "sub", MS_NOSUB, MNT_INVERT }, /* allow submounts */ @@ -133,7 +133,7 @@ static const struct libmnt_optmap userspace_opts_map[] = { "defaults", 0, 0 }, /* default options */ { "auto", MNT_MS_NOAUTO, MNT_NOHLPS | MNT_INVERT | MNT_NOMTAB }, /* Can be mounted using -a */ - { "noauto", MNT_MS_NOAUTO, MNT_NOHLPS | MNT_NOMTAB }, /* Can only be mounted explicitly */ + { "noauto", MNT_MS_NOAUTO, MNT_NOHLPS | MNT_NOMTAB }, /* Can only be mounted explicitly */ { "user[=]", MNT_MS_USER }, /* Allow ordinary user to mount (mtab) */ { "nouser", MNT_MS_USER, MNT_INVERT | MNT_NOMTAB }, /* Forbid ordinary user to mount */ @@ -148,7 +148,7 @@ static const struct libmnt_optmap userspace_opts_map[] = { "nogroup", MNT_MS_GROUP, MNT_INVERT | MNT_NOMTAB }, /* Device group has no special privs */ /* - * Note that traditional init scripts assume _netdev option in /etc/mtab to + * Note that traditional init scripts assume the _netdev option in /etc/mtab to * umount network block devices on shutdown. */ { "_netdev", MNT_MS_NETDEV }, /* Device requires network */ @@ -194,7 +194,7 @@ const struct libmnt_optmap *mnt_get_builtin_optmap(int id) } /* - * Lookups for the @name in @maps and returns a map and in @mapent + * Looks up the @name in @maps and returns a map and in @mapent * returns the map entry */ const struct libmnt_optmap *mnt_optmap_get_entry( diff --git a/libmount/src/optstr.c b/libmount/src/optstr.c index 3c680ff6e..2ad75d9aa 100644 --- a/libmount/src/optstr.c +++ b/libmount/src/optstr.c @@ -8,10 +8,10 @@ /** * SECTION: optstr * @title: Options string - * @short_description: low-level API for work with mount options + * @short_description: low-level API for working with mount options * - * This is simple and low-level API to work with mount options that are stored - * in string. + * This is a simple and low-level API to working with mount options that are stored + * in a string. */ #include @@ -39,8 +39,8 @@ struct libmnt_optloc { (e && (e)->name && !strchr((e)->name, '=') && !((e)->mask & MNT_PREFIX)) /* - * Parses the first option from @optstr. The @optstr pointer is set to begin of - * the next option. + * Parses the first option from @optstr. The @optstr pointer is set to the beginning + * of the next option. * * Returns -EINVAL on parse error, 1 at the end of optstr and 0 on success. */ @@ -72,7 +72,7 @@ static int mnt_optstr_parse_next(char **optstr, char **name, size_t *namesz, for (p = optstr0; p && *p; p++) { if (!start) - start = p; /* begin of the option item */ + start = p; /* beginning of the option item */ if (*p == '"') open_quote ^= 1; /* reverse the status */ if (open_quote) @@ -111,7 +111,7 @@ error: } /* - * Locates the first option that match with @name. The @end is set to + * Locates the first option that matches @name. The @end is set to the * char behind the option (it means ',' or \0). * * Returns negative number on parse error, 1 when not found and 0 on success. @@ -150,11 +150,11 @@ static int mnt_optstr_locate_option(char *optstr, const char *name, /** * mnt_optstr_next_option: - * @optstr: option string, returns position to next option - * @name: returns option name - * @namesz: returns option name length - * @value: returns option value or NULL - * @valuesz: returns option value length or zero + * @optstr: option string, returns the position of the next option + * @name: returns the option name + * @namesz: returns the option name length + * @value: returns the option value or NULL + * @valuesz: returns the option value length or zero * * Parses the first option in @optstr. * @@ -214,11 +214,11 @@ static int __mnt_optstr_append_option(char **optstr, /** * mnt_optstr_append_option: - * @optstr: option string or NULL, returns reallocated string + * @optstr: option string or NULL, returns a reallocated string * @name: value name * @value: value * - * Returns: 0 on success or -1 in case of error. After error the @optstr should + * Returns: 0 on success or -1 in case of error. After an error the @optstr should * be unmodified. */ int mnt_optstr_append_option(char **optstr, const char *name, const char *value) @@ -238,11 +238,11 @@ int mnt_optstr_append_option(char **optstr, const char *name, const char *value) /** * mnt_optstr_prepend_option: - * @optstr: option string or NULL, returns reallocated string + * @optstr: option string or NULL, returns a reallocated string * @name: value name * @value: value * - * Returns: 0 on success or -1 in case of error. After error the @optstr should + * Returns: 0 on success or -1 in case of error. After an error the @optstr should * be unmodified. */ int mnt_optstr_prepend_option(char **optstr, const char *name, const char *value) @@ -275,9 +275,9 @@ int mnt_optstr_prepend_option(char **optstr, const char *name, const char *value /** * mnt_optstr_get_option: - * @optstr: string with comma separated list of options + * @optstr: string with a comma separated list of options * @name: requested option name - * @value: returns pointer to the begin of the value (e.g. name=VALUE) or NULL + * @value: returns a pointer to the beginning of the value (e.g. name=VALUE) or NULL * @valsz: returns size of the value or 0 * * Returns: 0 on success, 1 when not found the @name or negative number in case @@ -306,7 +306,7 @@ int mnt_optstr_get_option(const char *optstr, const char *name, /** * mnt_optstr_deduplicate_option: - * @optstr: string with comma separated list of options + * @optstr: string with a comma separated list of options * @name: requested option name * * Removes all instances of @name except the last one. @@ -331,12 +331,12 @@ int mnt_optstr_deduplicate_option(char **optstr, const char *name) rc = mnt_optstr_locate_option(opt, name, &ol); if (!rc) { if (begin) { - /* remove previous instance */ + /* remove the previous instance */ size_t shift = strlen(*optstr); mnt_optstr_remove_option_at(optstr, begin, end); - /* now all offset are not valied anymore - recount */ + /* now all the offsets are not valid anymore - recount */ shift -= strlen(*optstr); ol.begin -= shift; ol.end -= shift; @@ -351,7 +351,7 @@ int mnt_optstr_deduplicate_option(char **optstr, const char *name) } /* - * The result never starts or ends with comma or contains two commas + * The result never starts or ends with a comma or contains two commas * (e.g. ",aaa,bbb" or "aaa,,bbb" or "aaa,") */ int mnt_optstr_remove_option_at(char **optstr, char *begin, char *end) @@ -387,14 +387,14 @@ insert_value(char **str, char *pos, const char *substr, char **next) /* is it necessary to prepend '=' before the substring ? */ sep = !(pos > *str && *(pos - 1) == '='); - /* save an offset of the place where we need add substr */ + /* save an offset of the place where we need to add substr */ posoff = pos - *str; p = realloc(*str, strsz + sep + subsz + 1); if (!p) return -ENOMEM; - /* zeroize new allocated memory -- valgind loves is... */ + /* zeroize the newly allocated memory -- valgrind loves us... */ memset(p + strsz, 0, sep + subsz + 1); /* set pointers to the reallocated string */ @@ -402,7 +402,7 @@ insert_value(char **str, char *pos, const char *substr, char **next) pos = p + posoff; if (possz) - /* create a room for new substring */ + /* create a room for the new substring */ memmove(pos + subsz + sep, pos, possz + 1); if (sep) *pos++ = '='; @@ -420,11 +420,11 @@ insert_value(char **str, char *pos, const char *substr, char **next) /** * mnt_optstr_set_option: - * @optstr: string with comma separated list of options + * @optstr: string with a comma separated list of options * @name: requested option * @value: new value or NULL * - * Set or unset option @value. + * Set or unset the option @value. * * Returns: 0 on success, 1 when not found the @name or negative number in case * of error. @@ -473,7 +473,7 @@ int mnt_optstr_set_option(char **optstr, const char *name, const char *value) /** * mnt_optstr_remove_option: - * @optstr: string with comma separated list of options + * @optstr: string with a comma separated list of options * @name: requested option name * * Returns: 0 on success, 1 when not found the @name or negative number in case @@ -510,13 +510,13 @@ int mnt_optstr_remove_option(char **optstr, const char *name) * * mnt_split_optstr(optstr, &u, NULL, NULL, MNT_NOMTAB, 0); * - * returns all userspace options, the options that does not belong to + * returns all userspace options, the options that do not belong to * mtab are ignored. * * Note that FS options are all options that are undefined in MNT_USERSPACE_MAP * or MNT_LINUX_MAP. * - * Returns: 0 on success, or negative number in case of error. + * Returns: 0 on success, or a negative number in case of error. */ int mnt_split_optstr(const char *optstr, char **user, char **vfs, char **fs, int ignore_user, int ignore_vfs) @@ -582,21 +582,21 @@ int mnt_split_optstr(const char *optstr, char **user, char **vfs, /** * mnt_optstr_get_options - * @optstr: string with comma separated list of options + * @optstr: string with a comma separated list of options * @subset: returns newly allocated string with options * @map: options map * @ignore: mask of the options that should be ignored * - * Extracts options from @optstr that belongs to the @map, for example: + * Extracts options from @optstr that belong to the @map, for example: * * mnt_optstr_get_options(optstr, &p, * mnt_get_builtin_optmap(MNT_LINUX_MAP), * MNT_NOMTAB); * - * the 'p' returns all VFS options, the options that does not belong to mtab + * the 'p' returns all VFS options, the options that do not belong to mtab * are ignored. * - * Returns: 0 on success, or negative number in case of error. + * Returns: 0 on success, or a negative number in case of error. */ int mnt_optstr_get_options(const char *optstr, char **subset, const struct libmnt_optmap *map, int ignore) @@ -652,8 +652,8 @@ int mnt_optstr_get_options(const char *optstr, char **subset, * * "bind,noexec,foo,bar" --returns-> MS_BIND|MS_NOEXEC * - * Note that @flags are not zeroized by this function! This function set/unset - * bites in the @flags only. + * Note that @flags are not zeroized by this function! This function sets/unsets + * bits in the @flags only. * * Returns: 0 on success or negative number in case of error */ @@ -747,8 +747,8 @@ int mnt_optstr_apply_flags(char **optstr, unsigned long flags, fl = flags; /* - * There is a convetion that 'rw/ro' flags is always at the begin of - * the string (athough the 'rw' is unnecessary). + * There is a convention that 'rw/ro' flags are always at the beginning of + * the string (although the 'rw' is unnecessary). */ if (map == mnt_get_builtin_optmap(MNT_LINUX_MAP)) { const char *o = (fl & MS_RDONLY) ? "ro" : "rw"; @@ -774,7 +774,7 @@ int mnt_optstr_apply_flags(char **optstr, unsigned long flags, if (next && *next) { /* * scan @optstr and remove options that are missing in - * the @flags + * @flags */ while(!mnt_optstr_next_option(&next, &name, &namesz, &val, &valsz)) { @@ -856,7 +856,7 @@ err: * modify @optstr and returns zero if libmount is compiled without SELinux * support. * - * Returns: 0 on success, negative number in case of error. + * Returns: 0 on success, a negative number in case of error. */ #ifndef HAVE_LIBSELINUX int mnt_optstr_fix_secontext(char **optstr __attribute__ ((__unused__)), @@ -910,7 +910,7 @@ int mnt_optstr_fix_secontext(char **optstr, return -EINVAL; - /* create quoted string from the raw context */ + /* create a quoted string from the raw context */ sz = strlen((char *) raw); if (!sz) return -EINVAL; @@ -947,8 +947,8 @@ static int set_uint_value(char **optstr, unsigned int num, } /* - * @optstr: string with comma separated list of options - * @value: pointer to the begin of the uid value + * @optstr: string with a comma separated list of options + * @value: pointer to the beginning of the uid value * @valsz: size of the value * @next: returns pointer to the next option (optional argument) @@ -958,7 +958,7 @@ static int set_uint_value(char **optstr, unsigned int num, * if (!mnt_optstr_get_option(optstr, "uid", &val, &valsz)) * mnt_optstr_fix_uid(&optstr, val, valsz, NULL); * - * Returns: 0 on success, negative number in case of error. + * Returns: 0 on success, a negative number in case of error. */ int mnt_optstr_fix_uid(char **optstr, char *value, size_t valsz, char **next) { @@ -998,14 +998,14 @@ int mnt_optstr_fix_uid(char **optstr, char *value, size_t valsz, char **next) } /* - * @optstr: string with comma separated list of options - * @value: pointer to the begin of the uid value + * @optstr: string with a comma separated list of options + * @value: pointer to the beginning of the uid value * @valsz: size of the value * @next: returns pointer to the next option (optional argument) * Translates "groupname" or "usergid" to the real GID. * - * Returns: 0 on success, negative number in case of error. + * Returns: 0 on success, a negative number in case of error. */ int mnt_optstr_fix_gid(char **optstr, char *value, size_t valsz, char **next) { @@ -1328,7 +1328,7 @@ int main(int argc, char *argv[]) { struct libmnt_test tss[] = { { "--append", test_append, " [] append value to optstr" }, - { "--prepend",test_prepend," [] prepend value to optstr" }, + { "--prepend",test_prepend," [] prepend value to optstr" }, { "--set", test_set, " [] (un)set value" }, { "--get", test_get, " search name in optstr" }, { "--remove", test_remove, " remove name in optstr" }, diff --git a/libmount/src/tab.c b/libmount/src/tab.c index ac4d4a3d3..9356c7529 100644 --- a/libmount/src/tab.c +++ b/libmount/src/tab.c @@ -11,9 +11,9 @@ * @short_description: container for entries from fstab, mtab or mountinfo * * Note that mnt_table_find_* functions are mount(8) compatible. These functions - * try to find an entry in more iterations where the first attempt is always + * try to find an entry in more iterations, where the first attempt is always * based on comparison with unmodified (non-canonicalized or un-evaluated) - * paths or tags. For example fstab with two entries: + * paths or tags. For example a fstab with two entries: * * * LABEL=foo /foo auto rw @@ -39,7 +39,7 @@ * mnt_table_find_source(tb, "UUID=anyuuid", &fs); * * - * will returns the first entry (if UUID matches with the device). + * will return the first entry (if UUID matches with the device). */ #include @@ -75,7 +75,7 @@ struct libmnt_table *mnt_new_table(void) * mnt_reset_table: * @tb: tab pointer * - * Dealocates all entries (filesystems) from the table + * Deallocates all entries (filesystems) from the table. * * Returns: 0 on success or negative number in case of error. */ @@ -137,7 +137,7 @@ int mnt_table_get_nents(struct libmnt_table *tb) * The initial (intro) file comment is accessible by * mnt_table_get_intro_comment(). The intro and the comment of the first fstab * entry has to be separated by blank line. The filesystem comments are - * accessible by mnt_fs_get_comment(). The tailing fstab comment is accessible + * accessible by mnt_fs_get_comment(). The trailing fstab comment is accessible * by mnt_table_get_trailing_comment(). * * @@ -178,7 +178,7 @@ const char *mnt_table_get_intro_comment(struct libmnt_table *tb) * @tb: pointer to tab * @comm: comment or NULL * - * Sets initial comment in tb. + * Sets the initial comment in tb. * * Returns: 0 on success or negative number in case of error. */ @@ -220,7 +220,7 @@ int mnt_table_append_intro_comment(struct libmnt_table *tb, const char *comm) * mnt_table_get_trailing_comment: * @tb: pointer to tab * - * Returns: table tailing comment + * Returns: table trailing comment */ const char *mnt_table_get_trailing_comment(struct libmnt_table *tb) { @@ -233,7 +233,7 @@ const char *mnt_table_get_trailing_comment(struct libmnt_table *tb) * @tb: pointer to tab * @comm: comment string * - * Sets tailing comment in table. + * Sets the trailing comment in table. * * Returns: 0 on success or negative number in case of error. */ @@ -259,7 +259,7 @@ int mnt_table_set_trailing_comment(struct libmnt_table *tb, const char *comm) * @tb: pointer to tab * @comm: comment of NULL * - * Appends to the tailing table comment. + * Appends to the trailing table comment. * * Returns: 0 on success or negative number in case of error. */ @@ -276,7 +276,7 @@ int mnt_table_append_trailing_comment(struct libmnt_table *tb, const char *comm) * @tb: pointer to tab * @mpc: pointer to struct libmnt_cache instance * - * Setups a cache for canonicalized paths and evaluated tags (LABEL/UUID). The + * Sets up a cache for canonicalized paths and evaluated tags (LABEL/UUID). The * cache is recommended for mnt_table_find_*() functions. * * The cache could be shared between more tabs. Be careful when you share the @@ -357,18 +357,18 @@ int mnt_table_remove_fs(struct libmnt_table *tb, struct libmnt_fs *fs) * @tb: mountinfo file (/proc/self/mountinfo) * @root: returns pointer to the root filesystem (/) * - * The function uses parent ID from mountinfo file to determine root filesystem + * The function uses the parent ID from the mountinfo file to determine the root filesystem * (the filesystem with the smallest ID). The function is designed mostly for - * applications where is necessary to sort mountpoints by IDs to get the tree + * applications where it is necessary to sort mountpoints by IDs to get the tree * of the mountpoints (e.g. findmnt default output). * - * If you're not sure than use + * If you're not sure, then use * * mnt_table_find_target(tb, "/", MNT_ITER_BACKWARD); * - * this is more robust and usable for arbitrary tab file (including fstab). + * this is more robust and usable for arbitrary tab files (including fstab). * - * Returns: 0 on success or less then zero case of error. + * Returns: 0 on success or negative number in case of error. */ int mnt_table_get_root_fs(struct libmnt_table *tb, struct libmnt_fs **root) { @@ -388,7 +388,7 @@ int mnt_table_get_root_fs(struct libmnt_table *tb, struct libmnt_fs **root) while(mnt_table_next_fs(tb, &itr, &fs) == 0) { int id = mnt_fs_get_parent_id(fs); if (!id) - break; /* @tab is not mountinfo file? */ + break; /* @tab is not a mountinfo file? */ if (!*root || id < root_id) { *root = fs; @@ -406,10 +406,10 @@ int mnt_table_get_root_fs(struct libmnt_table *tb, struct libmnt_fs **root) * @parent: parental FS * @chld: returns the next child filesystem * - * Note that filesystems are returned in the order how was mounted (according to + * Note that filesystems are returned in the order of mounting (according to * IDs in /proc/self/mountinfo). * - * Returns: 0 on success, negative number in case of error or 1 at end of list. + * Returns: 0 on success, negative number in case of error or 1 at the end of list. */ int mnt_table_next_child_fs(struct libmnt_table *tb, struct libmnt_iter *itr, struct libmnt_fs *parent, struct libmnt_fs **chld) @@ -444,7 +444,7 @@ int mnt_table_next_child_fs(struct libmnt_table *tb, struct libmnt_iter *itr, id = mnt_fs_get_id(fs); - /* avoid infinite loop. This only happens in rare cases + /* avoid an infinite loop. This only happens in rare cases * such as in early userspace when the rootfs is its own parent */ if (id == parent_id) continue; @@ -471,7 +471,7 @@ int mnt_table_next_child_fs(struct libmnt_table *tb, struct libmnt_iter *itr, * @itr: iterator * @fs: returns the next tab entry * - * Returns: 0 on success, negative number in case of error or 1 at end of list. + * Returns: 0 on success, negative number in case of error or 1 at the end of list. * * Example: * @@ -484,7 +484,7 @@ int mnt_table_next_child_fs(struct libmnt_table *tb, struct libmnt_iter *itr, * * * - * lists all mountpoints from fstab in backward order. + * lists all mountpoints from fstab in reverse order. */ int mnt_table_next_fs(struct libmnt_table *tb, struct libmnt_iter *itr, struct libmnt_fs **fs) { @@ -512,11 +512,11 @@ int mnt_table_next_fs(struct libmnt_table *tb, struct libmnt_iter *itr, struct l * mnt_table_find_next_fs: * @tb: table * @itr: iterator - * @match_func: function returns 1 or 0 + * @match_func: function returning 1 or 0 * @userdata: extra data for match_func * @fs: returns pointer to the next matching table entry * - * This function allows search in @tb. + * This function allows searching in @tb. * * Returns: negative number in case of error, 1 at end of table or 0 o success. */ @@ -577,7 +577,7 @@ int mnt_table_set_iter(struct libmnt_table *tb, struct libmnt_iter *itr, struct * @path: directory * @direction: MNT_ITER_{FORWARD,BACKWARD} * - * Same like mnt_get_mountpoint(), but this function does not rely on + * Same as mnt_get_mountpoint(), except this function does not rely on * st_dev numbers. * * Returns: a tab entry or NULL. @@ -624,10 +624,10 @@ struct libmnt_fs *mnt_table_find_mountpoint(struct libmnt_table *tb, * @path: mountpoint directory * @direction: MNT_ITER_{FORWARD,BACKWARD} * - * Try to lookup an entry in given tab, possible are three iterations, first - * with @path, second with realpath(@path) and third with realpath(@path) + * Try to lookup an entry in the given tab, three iterations are possible, the first + * with @path, the second with realpath(@path) and the third with realpath(@path) * against realpath(fs->target). The 2nd and 3rd iterations are not performed - * when @tb cache is not set (see mnt_table_set_cache()). + * when the @tb cache is not set (see mnt_table_set_cache()). * * Returns: a tab entry or NULL. */ @@ -667,7 +667,7 @@ struct libmnt_fs *mnt_table_find_target(struct libmnt_table *tb, const char *pat /* non-canonicaled path in struct libmnt_table * -- note that mountpoint in /proc/self/mountinfo is already - * canonicalized by kernel + * canonicalized by the kernel */ mnt_reset_iter(&itr, direction); while(mnt_table_next_fs(tb, &itr, &fs) == 0) { @@ -693,11 +693,11 @@ struct libmnt_fs *mnt_table_find_target(struct libmnt_table *tb, const char *pat * @path: source path (devname or dirname) or NULL * @direction: MNT_ITER_{FORWARD,BACKWARD} * - * Try to lookup an entry in given tab, possible are four iterations, first - * with @path, second with realpath(@path), third with tags (LABEL, UUID, ..) - * from @path and fourth with realpath(@path) against realpath(entry->srcpath). + * Try to lookup an entry in the given tab, four iterations are possible, the first + * with @path, the second with realpath(@path), the third with tags (LABEL, UUID, ..) + * from @path and the fourth with realpath(@path) against realpath(entry->srcpath). * - * The 2nd, 3rd and 4th iterations are not performed when @tb cache is not + * The 2nd, 3rd and 4th iterations are not performed when the @tb cache is not * set (see mnt_table_set_cache()). * * Note that NULL is a valid source path; it will be replaced with "none". The @@ -762,9 +762,9 @@ struct libmnt_fs *mnt_table_find_srcpath(struct libmnt_table *tb, const char *pa return fs; } } else if (rc < 0 && errno == EACCES) { - /* @path is unaccessible, try evaluate all TAGs in @tb + /* @path is inaccessible, try evaluating all TAGs in @tb * by udev symlinks -- this could be expensive on systems - * with huge fstab/mtab */ + * with a huge fstab/mtab */ while(mnt_table_next_fs(tb, &itr, &fs) == 0) { const char *t, *v, *x; if (mnt_fs_get_tag(fs, &t, &v)) @@ -805,9 +805,9 @@ struct libmnt_fs *mnt_table_find_srcpath(struct libmnt_table *tb, const char *pa * @val: tag value * @direction: MNT_ITER_{FORWARD,BACKWARD} * - * Try to lookup an entry in given tab, first attempt is lookup by @tag and + * Try to lookup an entry in the given tab, the first attempt is to lookup by @tag and * @val, for the second attempt the tag is evaluated (converted to the device - * name) and mnt_table_find_srcpath() is preformed. The second attempt is not + * name) and mnt_table_find_srcpath() is performed. The second attempt is not * performed when @tb cache is not set (see mnt_table_set_cache()). * Returns: a tab entry or NULL. @@ -853,9 +853,9 @@ struct libmnt_fs *mnt_table_find_tag(struct libmnt_table *tb, const char *tag, * @source: TAG or path * @direction: MNT_ITER_{FORWARD,BACKWARD} * - * This is high-level API for mnt_table_find_{srcpath,tag}. You needn't to care - * about @source format (device, LABEL, UUID, ...). This function parses @source - * and calls mnt_table_find_tag() or mnt_table_find_srcpath(). + * This is a high-level API for mnt_table_find_{srcpath,tag}. You needn't care + * about the @source format (device, LABEL, UUID, ...). This function parses + * the @source and calls mnt_table_find_tag() or mnt_table_find_srcpath(). * * Returns: a tab entry or NULL. */ @@ -893,7 +893,7 @@ struct libmnt_fs *mnt_table_find_source(struct libmnt_table *tb, * @direction: MNT_ITER_{FORWARD,BACKWARD} * * This function is implemented by mnt_fs_match_source() and - * mnt_fs_match_target() functions. It means that this is more expensive that + * mnt_fs_match_target() functions. It means that this is more expensive than * others mnt_table_find_* function, because every @tab entry is fully evaluated. * * Returns: a tab entry or NULL. @@ -931,7 +931,7 @@ struct libmnt_fs *mnt_table_find_pair(struct libmnt_table *tb, const char *sourc * @devno: device number * @direction: MNT_ITER_{FORWARD,BACKWARD} * - * Note that zero could be valid device number for root pseudo filesystem (e.g. + * Note that zero could be a valid device number for the root pseudo filesystem (e.g. * tmpfs). * * Returns: a tab entry or NULL. @@ -965,7 +965,7 @@ struct libmnt_fs *mnt_table_find_devno(struct libmnt_table *tb, * tb: /proc/self/mountinfo * fs: filesystem * mountflags: MS_BIND or 0 - * fsroot: fs-root that will be probably used in the mountinfo file + * fsroot: fs-root that will probably be used in the mountinfo file * for @fs after mount(2) * * For btrfs subvolumes this function returns NULL, but @fsroot properly set. @@ -1091,20 +1091,20 @@ static int is_mountinfo(struct libmnt_table *tb) } /** - * mnt_table_is_mounted: + * mnt_table_is_fs__mounted: * @tb: /proc/self/mountinfo file * @fstab_fs: /etc/fstab entry * * Checks if the @fstab_fs entry is already in the @tb table. The "swap" is - * ignored. This function explicitly compares source, target and root of the + * ignored. This function explicitly compares the source, target and root of the * filesystems. * * Note that source and target are canonicalized only if a cache for @tb is * defined (see mnt_table_set_cache()). The target canonicalization may - * triggers automount on autofs mountpoints! + * trigger automount on autofs mountpoints! * * Don't use it if you want to know if a device is mounted, just use - * mnt_table_find_source() for the device. + * mnt_table_find_source() on the device. * * This function is designed mostly for "mount -a". * @@ -1206,7 +1206,7 @@ int mnt_table_is_fs_mounted(struct libmnt_table *tb, struct libmnt_fs *fstab_fs) } /* - * Compare target, try to minimize number of situations when we + * Compare target, try to minimize the number of situations when we * need to canonicalize the path to avoid readlink() on * mountpoints. */ @@ -1236,7 +1236,7 @@ static int parser_errcb(struct libmnt_table *tb, const char *filename, int line) { fprintf(stderr, "%s:%d: parse error\n", filename, line); - return 1; /* all errors are recoverable -- this is default */ + return 1; /* all errors are recoverable -- this is the default */ } struct libmnt_table *create_table(const char *file, int comments) diff --git a/libmount/src/tab_diff.c b/libmount/src/tab_diff.c index f01f889f8..0ebdc1110 100644 --- a/libmount/src/tab_diff.c +++ b/libmount/src/tab_diff.c @@ -25,7 +25,7 @@ struct libmnt_tabdiff { int nchanges; /* number of changes */ struct list_head changes; /* list with modified entries */ - struct list_head unused; /* list with unuused entries */ + struct list_head unused; /* list with unused entries */ }; /** @@ -89,7 +89,7 @@ void mnt_free_tabdiff(struct libmnt_tabdiff *df) * * The options @old_fs, @new_fs and @oper are optional. * - * Returns: 0 on success, negative number in case of error or 1 at end of list. + * Returns: 0 on success, negative number in case of error or 1 at the end of list. */ int mnt_tabdiff_next_change(struct libmnt_tabdiff *df, struct libmnt_iter *itr, struct libmnt_fs **old_fs, struct libmnt_fs **new_fs, int *oper) @@ -124,9 +124,9 @@ static int tabdiff_reset(struct libmnt_tabdiff *df) { assert(df); - DBG(DIFF, mnt_debug_h(df, "reseting")); + DBG(DIFF, mnt_debug_h(df, "resetting")); - /* zeroize all entries and move them to the list of unuused + /* zeroize all entries and move them to the list of unused */ while (!list_empty(&df->changes)) { struct tabdiff_entry *de = list_entry(df->changes.next, diff --git a/libmount/src/tab_parse.c b/libmount/src/tab_parse.c index f3947020c..24e84457e 100644 --- a/libmount/src/tab_parse.c +++ b/libmount/src/tab_parse.c @@ -47,7 +47,7 @@ static int next_number(char **s, int *num) *s = end; - /* valid end of number is space or terminator */ + /* valid end of number is a space or a terminator */ if (*end == ' ' || *end == '\t' || *end == '\0') return 0; return -1; @@ -82,7 +82,7 @@ static int mnt_parse_table_line(struct libmnt_fs *fs, char *s) if (optstr && *optstr) unmangle_string(optstr); - /* note that __foo functions does not reallocate the string + /* note that __foo functions do not reallocate the string */ rc = __mnt_fs_set_source_ptr(fs, src); if (!rc) { @@ -128,7 +128,7 @@ static int mnt_parse_table_line(struct libmnt_fs *fs, char *s) } /* - * Parses one line from mountinfo file + * Parses one line from a mountinfo file */ static int mnt_parse_mountinfo_line(struct libmnt_fs *fs, char *s) { @@ -158,7 +158,7 @@ static int mnt_parse_mountinfo_line(struct libmnt_fs *fs, char *s) /* (7) optional fields, terminated by " - " */ p = strstr(s, " - "); if (!p) { - DBG(TAB, mnt_debug("mountinfo parse error: not found separator")); + DBG(TAB, mnt_debug("mountinfo parse error: separator not found")); return -EINVAL; } if (p > s + 1) @@ -192,7 +192,7 @@ static int mnt_parse_mountinfo_line(struct libmnt_fs *fs, char *s) src = NULL; } - /* merge VFS and FS options to the one string */ + /* merge VFS and FS options to one string */ fs->optstr = mnt_fs_strdup_options(fs); if (!fs->optstr) rc = -ENOMEM; @@ -323,8 +323,8 @@ static int mnt_parse_swaps_line(struct libmnt_fs *fs, char *s) /* * Returns {m,fs}tab or mountinfo file format (MNT_FMT_*) * - * Note that we aren't trying to guess utab file format, because this file has - * to be always parsed by private libmount routines with explicitly defined + * Note that we aren't trying to guess the utab file format, because this file + * always has to be parsed by private libmount routines with an explicitly defined * format. * * mountinfo: " ... " @@ -372,8 +372,8 @@ static int is_terminated_by_blank(const char *str) /* * Reads the next line from the file. * - * Returns 0 if the line is comment - * 1 if the line is not comment + * Returns 0 if the line is a comment + * 1 if the line is not a comment * <0 on error */ static int next_comment_line(char *buf, size_t bufsz, @@ -400,7 +400,7 @@ static int append_comment(struct libmnt_table *tb, DBG(TAB, mnt_debug_h(tb, "appending %s comment", intro ? "intro" : - eof ? "tailing" : "fs")); + eof ? "trailing" : "fs")); if (intro) rc = mnt_table_append_intro_comment(tb, comm); else if (eof) { @@ -438,7 +438,7 @@ next_line: ++*nlines; s = strchr (buf, '\n'); if (!s) { - /* Missing final newline? Otherwise extremely */ + /* Missing final newline? Otherwise an extremely */ /* long line - assume file was corrupted */ if (feof(f)) { DBG(TAB, mnt_debug_h(tb, @@ -512,7 +512,7 @@ err: tb->fmt == MNT_FMT_FSTAB ? "tab" : "utab")); /* by default all errors are recoverable, otherwise behavior depends on - * errcb() function. See mnt_table_set_parser_errcb(). + * the errcb() function. See mnt_table_set_parser_errcb(). */ return tb->errcb ? tb->errcb(tb, filename, *nlines) : 1; } @@ -553,7 +553,7 @@ static int kernel_fs_postparse(struct libmnt_table *tb, int rc = 0; const char *src = mnt_fs_get_srcpath(fs); - /* This is filesystem description from /proc, so we're in some process + /* This is a filesystem description from /proc, so we're in some process * namespace. Let's remember the process PID. */ if (filename && *tid == -1) @@ -653,10 +653,10 @@ err: * @tb: tab pointer * @filename: file * - * Parses whole table (e.g. /etc/mtab) and appends new records to the @tab. + * Parses the whole table (e.g. /etc/mtab) and appends new records to the @tab. * * The libmount parser ignores broken (syntax error) lines, these lines are - * reported to caller by errcb() function (see mnt_table_set_parser_errcb()). + * reported to the caller by the errcb() function (see mnt_table_set_parser_errcb()). * * Returns: 0 on success, negative number in case of error. */ @@ -755,7 +755,7 @@ static int __mnt_table_parse_dir(struct libmnt_table *tb, const char *dirname) if (n <= 0) return 0; - /* let use "at" functions rather than play crazy games with paths... */ + /* let's use "at" functions rather than playing crazy games with paths... */ dir = opendir(dirname); if (!dir) { r = -errno; @@ -796,7 +796,7 @@ out: * * The directory: * - files are sorted by strverscmp(3) - * - files that starts with "." are ignored (e.g. ".10foo.fstab") + * - files that start with "." are ignored (e.g. ".10foo.fstab") * - files without the ".fstab" extension are ignored * * Returns: 0 on success or negative number in case of error. @@ -832,7 +832,7 @@ struct libmnt_table *__mnt_new_table_from_file(const char *filename, int fmt) * @filename: /etc/{m,fs}tab or /proc/self/mountinfo path * * Same as mnt_new_table() + mnt_table_parse_file(). Use this function for private - * files only. This function does not allow to use error callback, so you + * files only. This function does not allow using the error callback, so you * cannot provide any feedback to end-users about broken records in files (e.g. * fstab). * @@ -871,13 +871,13 @@ struct libmnt_table *mnt_new_table_from_dir(const char *dirname) * @cb: pointer to callback function * * The error callback function is called by table parser (mnt_table_parse_file()) - * in case of syntax error. The callback function could be used for errors + * in case of a syntax error. The callback function could be used for error * evaluation, libmount will continue/stop parsing according to callback return * codes: * * <0 : fatal error (abort parsing) - * 0 : success (parsing continue) - * >0 : recoverable error (the line is ignored, parsing continue). + * 0 : success (parsing continues) + * >0 : recoverable error (the line is ignored, parsing continues). * * Returns: 0 on success or negative number in case of error. */ @@ -892,7 +892,7 @@ int mnt_table_set_parser_errcb(struct libmnt_table *tb, } /* - * Filter out entries during tab file parsing. If @cb returns 1 then the entry + * Filter out entries during tab file parsing. If @cb returns 1, then the entry * is ignored. */ int mnt_table_set_parser_fltrcb(struct libmnt_table *tb, @@ -943,7 +943,7 @@ int mnt_table_parse_swaps(struct libmnt_table *tb, const char *filename) * @filename: overwrites default (/etc/fstab or $LIBMOUNT_FSTAB) or NULL * * This function parses /etc/fstab and appends new lines to the @tab. If the - * @filename is a directory then mnt_table_parse_dir() is called. + * @filename is a directory, then mnt_table_parse_dir() is called. * * See also mnt_table_set_parser_errcb(). * @@ -976,7 +976,7 @@ int mnt_table_parse_fstab(struct libmnt_table *tb, const char *filename) } /* - * This function uses @uf to found corresponding record in @tb, then the record + * This function uses @uf to find a corresponding record in @tb, then the record * from @tb is updated (user specific mount options are added). * * Note that @uf must contain only user specific mount options instead of @@ -1078,7 +1078,7 @@ int mnt_table_parse_mtab(struct libmnt_table *tb, const char *filename) if (mnt_table_get_nents(tb) == 0) return 0; /* empty, ignore utab */ /* - * try to read user specific information from /run/mount/utabs + * try to read the user specific information from /run/mount/utabs */ utab = mnt_get_utab_path(); if (!utab || is_file_empty(utab)) @@ -1097,7 +1097,7 @@ int mnt_table_parse_mtab(struct libmnt_table *tb, const char *filename) mnt_reset_iter(&itr, MNT_ITER_BACKWARD); - /* merge user options into mountinfo from kernel */ + /* merge user options into mountinfo from the kernel */ while(mnt_table_next_fs(u_tb, &itr, &u_fs) == 0) mnt_table_merge_user_fs(tb, u_fs); } diff --git a/libmount/src/tab_update.c b/libmount/src/tab_update.c index 292aa3484..9603f77ec 100644 --- a/libmount/src/tab_update.c +++ b/libmount/src/tab_update.c @@ -10,10 +10,10 @@ * @title: Tables update * @short_description: userspace mount information management * - * The struct libmnt_update provides abstraction to manage mount options in - * userspace independently on system configuration. This low-level API works on - * system with and without /etc/mtab. On systems without the regular /etc/mtab - * file are userspace mount options (e.g. user=) stored to the /run/mount/utab + * The struct libmnt_update provides an abstraction to manage mount options in + * userspace independently of system configuration. This low-level API works on + * systems both with and without /etc/mtab. On systems without the regular /etc/mtab + * file, the userspace mount options (e.g. user=) are stored in the /run/mount/utab * file. * * It's recommended to use high-level struct libmnt_context API. @@ -125,7 +125,7 @@ int mnt_update_set_filename(struct libmnt_update *upd, const char *filename, * mnt_update_get_filename: * @upd: update * - * This function returns file name (e.g. /etc/mtab) for the up-dated file. + * This function returns the file name (e.g. /etc/mtab) of the up-dated file. * * Returns: pointer to filename that will be updated or NULL in case of error. */ @@ -140,7 +140,7 @@ const char *mnt_update_get_filename(struct libmnt_update *upd) * @upd: update handler * * Returns: 1 if entry described by @upd is successfully prepared and will be - * written to mtab/utab file. + * written to the mtab/utab file. */ int mnt_update_is_ready(struct libmnt_update *upd) { @@ -287,10 +287,10 @@ int mnt_update_force_rdonly(struct libmnt_update *upd, int rdonly) } /* - * Allocates utab entry (upd->fs) for mount/remount. This function should be + * Allocates an utab entry (upd->fs) for mount/remount. This function should be * called *before* mount(2) syscall. The @fs is used as a read-only template. * - * Returns: 0 on success, negative number on error, 1 if utabs update is + * Returns: 0 on success, negative number on error, 1 if utab's update is * unnecessary. */ static int utab_new_entry(struct libmnt_update *upd, struct libmnt_fs *fs, @@ -357,7 +357,7 @@ err: /* * Sets fs-root and fs-type to @upd->fs according to the @fs template and - * @mountfalgs. For MS_BIND mountflag it reads information about source + * @mountfalgs. For MS_BIND mountflag it reads information about the source * filesystem from /proc/self/mountinfo. */ static int set_fs_root(struct libmnt_update *upd, struct libmnt_fs *fs, @@ -618,7 +618,7 @@ int mnt_table_write_file(struct libmnt_table *tb, FILE *file) * @tb: parsed file (e.g. fstab) * @filename: target * - * This function repaces @file by the new content from @tb. + * This function replaces @file by the new content from @tb. * * Returns: 0 on success, negative number on error. */ @@ -814,7 +814,7 @@ static int update_modify_options(struct libmnt_update *upd, struct libmnt_lock * * High-level API to update /etc/mtab (or private /run/mount/utab file). * * The @lc lock is optional and will be created if necessary. Note that - * the automatically created lock blocks all signals. + * an automatically created lock blocks all signals. * * See also mnt_lock_block_signals() and mnt_context_get_lock(). * @@ -884,7 +884,7 @@ static int update(const char *target, struct libmnt_fs *fs, unsigned long mountf goto done; } - /* [... here should be mount(2) call ...] */ + /* [... mount(2) call should be here...] */ rc = mnt_update_table(upd, NULL); done: @@ -972,7 +972,7 @@ static int test_replace(struct libmnt_test *ts, int argc, char *argv[]) int main(int argc, char *argv[]) { struct libmnt_test tss[] = { - { "--add", test_add, " add line to mtab" }, + { "--add", test_add, " add a line to mtab" }, { "--remove", test_remove, " MS_REMOUNT mtab change" }, { "--move", test_move, " MS_MOVE mtab change" }, { "--remount",test_remount, " MS_REMOUNT mtab change" }, diff --git a/libmount/src/utils.c b/libmount/src/utils.c index 81fcd9366..4e6a13148 100644 --- a/libmount/src/utils.c +++ b/libmount/src/utils.c @@ -80,7 +80,7 @@ int append_string(char **a, const char *b) } /* - * Return 1 if the file does not accessible of empty + * Return 1 if the file is not accessible or empty */ int is_file_empty(const char *name) { @@ -142,8 +142,8 @@ char *stripoff_last_component(char *path) } /* - * Note that the @target has to be absolute path (so at least "/"). The - * @filename returns allocated buffer with last path component, for example: + * Note that the @target has to be an absolute path (so at least "/"). The + * @filename returns an allocated buffer with the last path component, for example: * * mnt_chdir_to_parent("/mnt/test", &buf) ==> chdir("/mnt"), buf="test" */ @@ -206,7 +206,7 @@ err: } /* - * Check if @path is on read-only filesystem independently on file permissions. + * Check if @path is on a read-only filesystem independently of file permissions. */ int mnt_is_readonly(const char *path) { @@ -225,7 +225,7 @@ int mnt_is_readonly(const char *path) * accessible for the current rUID. (Note that euidaccess(2) does not * check for EROFS at all). * - * - for read-write filesystem with read-only VFS node (aka -o remount,ro,bind) + * - for a read-write filesystem with a read-only VFS node (aka -o remount,ro,bind) */ { struct timespec times[2]; @@ -246,7 +246,7 @@ int mnt_is_readonly(const char *path) * * Encode @str to be compatible with fstab/mtab * - * Returns: new allocated string or NULL in case of error. + * Returns: newly allocated string or NULL in case of error. */ char *mnt_mangle(const char *str) { @@ -259,7 +259,7 @@ char *mnt_mangle(const char *str) * * Decode @str from fstab/mtab * - * Returns: new allocated string or NULL in case of error. + * Returns: newly allocated string or NULL in case of error. */ char *mnt_unmangle(const char *str) { @@ -338,7 +338,7 @@ int mnt_fstype_is_netfs(const char *type) * @type: filesystem type * @pattern: filesystem name or comma delimited list of names * - * The @pattern list of filesystem can be prefixed with a global + * The @pattern list of filesystems can be prefixed with a global * "no" prefix to invert matching of the whole list. The "no" could * also be used for individual items in the @pattern list. So, * "nofoo,bar" has the same meaning as "nofoo,nobar". @@ -396,14 +396,14 @@ static int check_option(const char *haystack, size_t len, * @optstr: options string * @pattern: comma delimited list of options * - * The "no" could used for individual items in the @options list. The "no" + * The "no" could be used for individual items in the @options list. The "no" * prefix does not have a global meaning. * * Unlike fs type matching, nonetdev,user and nonetdev,nouser have * DIFFERENT meanings; each option is matched explicitly as specified. * - * The "no" prefix interpretation could be disable by "+" prefix, for example - * "+noauto" matches if @optstr literally contains "noauto" string. + * The "no" prefix interpretation could be disabled by the "+" prefix, for example + * "+noauto" matches if @optstr literally contains the "noauto" string. * * "xxx,yyy,zzz" : "nozzz" -> False * @@ -533,7 +533,7 @@ static int get_filesystems(const char *filename, char ***filesystems, const char } /* - * Always check @filesystems pointer! + * Always check the @filesystems pointer! * * man mount: * @@ -558,7 +558,7 @@ int mnt_get_filesystems(char ***filesystems, const char *pattern) rc = get_filesystems(_PATH_PROC_FILESYSTEMS, filesystems, pattern); if (rc == 1 && *filesystems) - rc = 0; /* not found /proc/filesystems */ + rc = 0; /* /proc/filesystems not found */ return rc; } @@ -574,7 +574,7 @@ static size_t get_pw_record_size(void) } /* - * Returns allocated string with username or NULL. + * Returns an allocated string with username or NULL. */ char *mnt_get_username(const uid_t uid) { @@ -700,8 +700,8 @@ static int try_write(const char *filename) * @mtab: returns path to mtab * @writable: returns 1 if the file is writable * - * If the file does not exist and @writable argument is not NULL then it will - * try to create the file + * If the file does not exist and @writable argument is not NULL, then it will + * try to create the file. * * Returns: 1 if /etc/mtab is a regular file, and 0 in case of error (check * errno for more details). @@ -722,7 +722,7 @@ int mnt_has_regular_mtab(const char **mtab, int *writable) rc = lstat(filename, &st); if (rc == 0) { - /* file exist */ + /* file exists */ if (S_ISREG(st.st_mode)) { if (writable) *writable = !try_write(filename); @@ -746,7 +746,7 @@ done: /* * Don't export this to libmount API -- utab is private library stuff. * - * If the file does not exist and @writable argument is not NULL then it will + * If the file does not exist and @writable argument is not NULL, then it will * try to create the directory (e.g. /run/mount) and the file. * * Returns: 1 if utab is a regular file, and 0 in case of @@ -768,13 +768,13 @@ int mnt_has_regular_utab(const char **utab, int *writable) rc = lstat(filename, &st); if (rc == 0) { - /* file exist */ + /* file exists */ if (S_ISREG(st.st_mode)) { if (writable) *writable = !try_write(filename); return 1; } - goto done; /* it's not regular file */ + goto done; /* it's not a regular file */ } if (writable) { @@ -826,7 +826,7 @@ const char *mnt_get_fstab_path(void) /** * mnt_get_mtab_path: * - * This function returns *default* location of the mtab file. The result does + * This function returns the *default* location of the mtab file. The result does * not have to be writable. See also mnt_has_regular_mtab(). * * Returns: path to /etc/mtab or $LIBMOUNT_MTAB. @@ -857,7 +857,7 @@ const char *mnt_get_utab_path(void) } -/* returns file descriptor or -errno, @name returns uniques filename +/* returns file descriptor or -errno, @name returns a unique filename */ int mnt_open_uniq_filename(const char *filename, char **name) { @@ -874,7 +874,7 @@ int mnt_open_uniq_filename(const char *filename, char **name) if (rc <= 0) return -errno; - /* This is for very old glibc and for compatibility with Posix where is + /* This is for very old glibc and for compatibility with Posix, which says * nothing about mkstemp() mode. All sane glibc use secure mode (0600). */ oldmode = umask(S_IRGRP|S_IWGRP|S_IXGRP| @@ -897,7 +897,7 @@ int mnt_open_uniq_filename(const char *filename, char **name) * This function finds the mountpoint that a given path resides in. @path * should be canonicalized. The returned pointer should be freed by the caller. * - * Returns: allocated string with target of the mounted device or NULL on error + * Returns: allocated string with the target of the mounted device or NULL on error */ char *mnt_get_mountpoint(const char *path) { @@ -967,7 +967,7 @@ char *mnt_get_fs_root(const char *path, const char *mnt) /* * Search for @name kernel command parametr. * - * Returns newly allocated string with parameter argument if the @name is + * Returns newly allocated string with a parameter argument if the @name is * specified as "name=" or returns pointer to @name or returns NULL if not * found. * @@ -1017,7 +1017,7 @@ char *mnt_get_kernel_cmdline_option(const char *name) if (p != buf && !isblank(*(p - 1))) continue; /* no space before the option */ if (!val && *(p + len) != '\0' && !isblank(*(p + len))) - continue; /* no space behind the option */ + continue; /* no space after the option */ if (val) { char *v = p + len; diff --git a/libmount/src/version.c b/libmount/src/version.c index 00b7c03e7..b72956230 100644 --- a/libmount/src/version.c +++ b/libmount/src/version.c @@ -10,7 +10,7 @@ /** * SECTION: version * @title: Version functions - * @short_description: functions to get library version. + * @short_description: functions to get the library version. */ #include @@ -70,11 +70,11 @@ int mnt_get_library_version(const char **ver_string) /** * mnt_get_library_features: - * @features: returns pointer to the static array of strings, the array is + * @features: returns a pointer to the static array of strings, the array is * terminated by NULL. * * Returns: number of items in the features array not including the last NULL, - * or less then zero in case of error + * or less than zero in case of error * * Example: * -- cgit v1.2.3-55-g7522