All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] libmount: add mnt_fs_is_btrfs()
@ 2017-02-23 14:04 Petr Vorel
  2017-02-23 14:04 ` [PATCH 2/2] libmount: return tab entry for default node Petr Vorel
  2017-02-23 15:12 ` [PATCH 1/2] libmount: add mnt_fs_is_btrfs() Karel Zak
  0 siblings, 2 replies; 4+ messages in thread
From: Petr Vorel @ 2017-02-23 14:04 UTC (permalink / raw)
  To: util-linux; +Cc: Petr Vorel

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
I exported mnt_fs_is_btrfs() even it's not necessary for second patch as I
consider useful to have it available. I'd like to have
btrfs_get_default_subvol_id() exported as well.
---
 libmount/docs/libmount-sections.txt |  1 +
 libmount/src/fs.c                   | 11 +++++++++++
 libmount/src/libmount.h.in          |  1 +
 libmount/src/libmount.sym           |  7 ++++++-
 4 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/libmount/docs/libmount-sections.txt b/libmount/docs/libmount-sections.txt
index 78d89cae7..65f774c2c 100644
--- a/libmount/docs/libmount-sections.txt
+++ b/libmount/docs/libmount-sections.txt
@@ -209,6 +209,7 @@ mnt_fs_get_usedsize
 mnt_fs_get_userdata
 mnt_fs_get_user_options
 mnt_fs_get_vfs_options
+mnt_fs_is_btrfs
 mnt_fs_is_kernel
 mnt_fs_is_netfs
 mnt_fs_is_pseudofs
diff --git a/libmount/src/fs.c b/libmount/src/fs.c
index 1c4ba1aab..e1bb9cde4 100644
--- a/libmount/src/fs.c
+++ b/libmount/src/fs.c
@@ -616,6 +616,17 @@ int mnt_fs_is_netfs(struct libmnt_fs *fs)
 }
 
 /**
+ * mnt_fs_is_btrfs:
+ * @fs: filesystem
+ *
+ * Returns: 1 if the filesystem is a btrfs fs type
+ */
+int mnt_fs_is_btrfs(struct libmnt_fs *fs)
+{
+	return !strcmp(fs->fstype, "btrfs");
+}
+
+/**
  * mnt_fs_get_fstype:
  * @fs: fstab/mtab/mountinfo entry pointer
  *
diff --git a/libmount/src/libmount.h.in b/libmount/src/libmount.h.in
index f191a52fe..7196430ef 100644
--- a/libmount/src/libmount.h.in
+++ b/libmount/src/libmount.h.in
@@ -411,6 +411,7 @@ extern int mnt_fs_match_fstype(struct libmnt_fs *fs, const char *types);
 extern int mnt_fs_match_options(struct libmnt_fs *fs, const char *options);
 extern int mnt_fs_print_debug(struct libmnt_fs *fs, FILE *file);
 
+extern int mnt_fs_is_btrfs(struct libmnt_fs *fs);
 extern int mnt_fs_is_kernel(struct libmnt_fs *fs);
 extern int mnt_fs_is_swaparea(struct libmnt_fs *fs);
 extern int mnt_fs_is_netfs(struct libmnt_fs *fs);
diff --git a/libmount/src/libmount.sym b/libmount/src/libmount.sym
index f0210c240..72c9caa78 100644
--- a/libmount/src/libmount.sym
+++ b/libmount/src/libmount.sym
@@ -4,7 +4,7 @@
  *
  * Version info can't enforce this since we never change the SONAME.
  *
- * Copyright (C) 2011-2014 Karel Zak <kzak@redhat.com> 
+ * Copyright (C) 2011-2014 Karel Zak <kzak@redhat.com>
  */
 MOUNT_2.19 {
 global:
@@ -315,3 +315,8 @@ MOUNT_2.28 {
 	mnt_table_find_target_with_option;
 	mnt_fs_set_priority;
 } MOUNT_2.26;
+
+MOUNT_2.30 {
+global:
+	mnt_fs_is_btrfs;
+} MOUNT_2.28;
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-02-23 18:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-23 14:04 [PATCH 1/2] libmount: add mnt_fs_is_btrfs() Petr Vorel
2017-02-23 14:04 ` [PATCH 2/2] libmount: return tab entry for default node Petr Vorel
2017-02-23 15:12 ` [PATCH 1/2] libmount: add mnt_fs_is_btrfs() Karel Zak
2017-02-23 18:15   ` Petr Vorel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.