summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnkit Chauhan <ankitchauhan2065@gmail.com>2025-06-19 08:45:36 +0530
committerChristian Brauner <brauner@kernel.org>2025-06-23 14:12:36 +0200
commit06a705356d7543b4eb2f41bef1ee0d5951700f7a (patch)
tree6602f5aabfee19e71ed769f8439088cc7610cd41
parent2b7c9664c3ce9d8da1113a1ca2546046de8eb93e (diff)
fs/ecryptfs: replace snprintf with sysfs_emit in show function
Use sysfs_emit() instead of snprintf() in version_show() function to follow the preferred kernel API. Signed-off-by: Ankit Chauhan <ankitchauhan2065@gmail.com> Link: https://lore.kernel.org/20250619031536.19352-1-ankitchauhan2065@gmail.com Signed-off-by: Christian Brauner <brauner@kernel.org>
-rw-r--r--fs/ecryptfs/main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c
index 8dd1d7189c3b..0db21e592fe7 100644
--- a/fs/ecryptfs/main.c
+++ b/fs/ecryptfs/main.c
@@ -20,6 +20,7 @@
#include <linux/fs_context.h>
#include <linux/fs_parser.h>
#include <linux/fs_stack.h>
+#include <linux/sysfs.h>
#include <linux/slab.h>
#include <linux/magic.h>
#include "ecryptfs_kernel.h"
@@ -764,7 +765,7 @@ static struct kobject *ecryptfs_kobj;
static ssize_t version_show(struct kobject *kobj,
struct kobj_attribute *attr, char *buff)
{
- return snprintf(buff, PAGE_SIZE, "%d\n", ECRYPTFS_VERSIONING_MASK);
+ return sysfs_emit(buff, "%d\n", ECRYPTFS_VERSIONING_MASK);
}
static struct kobj_attribute version_attr = __ATTR_RO(version);