mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
sdcardfs: set lower fs xattr at mounting
Maya need to set lower fs xattr to query directory writers and relative access time. Configuring xattr setting by kernel defconfig is supported. Change-Id: Ib2760eef11156ced25cc05f70936eb9693c5cb35 Signed-off-by: Shiyong Li <a22381@motorola.com> Reviewed-on: https://gerrit.mot.com/1249380 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Hujun Liao <liaohj@motorola.com> Submit-Approved: Jira Key Signed-off-by: Forenche <prahul2003@gmail.com>
This commit is contained in:
parent
01757ca946
commit
83ca69d788
@ -13,7 +13,7 @@ config SDCARD_FS_FADV_NOACTIVE
|
|||||||
Sdcardfs supports fadvise noactive mode.
|
Sdcardfs supports fadvise noactive mode.
|
||||||
|
|
||||||
config SDCARD_FS_PARTIAL_RELATIME
|
config SDCARD_FS_PARTIAL_RELATIME
|
||||||
bool "sdcardfs partial relatime update support"
|
string "sdcardfs partial relatime update support"
|
||||||
depends on SDCARD_FS
|
depends on SDCARD_FS
|
||||||
default n
|
default n
|
||||||
help
|
help
|
||||||
@ -24,7 +24,7 @@ config SDCARD_FS_PARTIAL_RELATIME
|
|||||||
would be updated whatever their xattr is set.
|
would be updated whatever their xattr is set.
|
||||||
|
|
||||||
config SDCARD_FS_DIR_WRITER
|
config SDCARD_FS_DIR_WRITER
|
||||||
bool "sdcardfs directory writer extended attribute support"
|
string "sdcardfs directory writer extended attribute support"
|
||||||
depends on SDCARD_FS
|
depends on SDCARD_FS
|
||||||
default n
|
default n
|
||||||
help
|
help
|
||||||
|
@ -194,7 +194,7 @@ void sdcardfs_update_xattr_dirwriter(struct dentry *lower_dentry,
|
|||||||
struct dentry *dentry, *parent;
|
struct dentry *dentry, *parent;
|
||||||
const char *dir_name[2];
|
const char *dir_name[2];
|
||||||
int xlen, depth;
|
int xlen, depth;
|
||||||
const char *xattr_feat_name = "user.dwriter";
|
const char *xattr_feat_name = SDCARDFS_XATTR_DWRITER_NAME;
|
||||||
const char *xattr_name = "user.dwriter.name";
|
const char *xattr_name = "user.dwriter.name";
|
||||||
struct dentry *xdentry = NULL, *child = NULL;
|
struct dentry *xdentry = NULL, *child = NULL;
|
||||||
appid_t app_id = uid_is_app(writer_uid) ?
|
appid_t app_id = uid_is_app(writer_uid) ?
|
||||||
|
@ -816,7 +816,7 @@ void sdcardfs_update_relatime_flag(struct file *lower_file,
|
|||||||
char *xexcept = NULL, *xpath;
|
char *xexcept = NULL, *xpath;
|
||||||
int xlen, i, depth = 0;
|
int xlen, i, depth = 0;
|
||||||
struct dentry *dentry, *parent, *child = NULL;
|
struct dentry *dentry, *parent, *child = NULL;
|
||||||
const char *xattr_name = "user.relatime";
|
const char *xattr_name = SDCARDFS_XATTR_PARTIAL_RELATIME_NAME;
|
||||||
__u32 flags = 0;
|
__u32 flags = 0;
|
||||||
appid_t app_id = uid_is_app(writer_uid) ?
|
appid_t app_id = uid_is_app(writer_uid) ?
|
||||||
writer_uid % AID_USER_OFFSET : 0;
|
writer_uid % AID_USER_OFFSET : 0;
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
#include <linux/parser.h>
|
#include <linux/parser.h>
|
||||||
|
#include <linux/xattr.h>
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
Opt_fsuid,
|
Opt_fsuid,
|
||||||
@ -381,6 +382,26 @@ static int sdcardfs_read_super(struct vfsmount *mnt, struct super_block *sb,
|
|||||||
if (!silent)
|
if (!silent)
|
||||||
pr_info("sdcardfs: mounted on top of %s type %s\n",
|
pr_info("sdcardfs: mounted on top of %s type %s\n",
|
||||||
dev_name, lower_sb->s_type->name);
|
dev_name, lower_sb->s_type->name);
|
||||||
|
|
||||||
|
#ifdef CONFIG_SDCARD_FS_DIR_WRITER
|
||||||
|
if (vfs_setxattr(lower_path.dentry,
|
||||||
|
SDCARDFS_XATTR_DWRITER_NAME,
|
||||||
|
CONFIG_SDCARD_FS_DIR_WRITER,
|
||||||
|
strlen(CONFIG_SDCARD_FS_DIR_WRITER), 0)) {
|
||||||
|
pr_warn("sdcardfs: failed to set %s\n",
|
||||||
|
SDCARDFS_XATTR_DWRITER_NAME);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef CONFIG_SDCARD_FS_PARTIAL_RELATIME
|
||||||
|
if (vfs_setxattr(lower_path.dentry,
|
||||||
|
SDCARDFS_XATTR_PARTIAL_RELATIME_NAME,
|
||||||
|
CONFIG_SDCARD_FS_PARTIAL_RELATIME,
|
||||||
|
strlen(CONFIG_SDCARD_FS_PARTIAL_RELATIME), 0)) {
|
||||||
|
pr_warn("sdcardfs: failed to set xattr %s\n",
|
||||||
|
SDCARDFS_XATTR_PARTIAL_RELATIME_NAME);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
goto out; /* all is well */
|
goto out; /* all is well */
|
||||||
|
|
||||||
/* no longer needed: free_dentry_private_data(sb->s_root); */
|
/* no longer needed: free_dentry_private_data(sb->s_root); */
|
||||||
|
@ -73,6 +73,8 @@
|
|||||||
|
|
||||||
#define AID_PACKAGE_INFO 1027
|
#define AID_PACKAGE_INFO 1027
|
||||||
|
|
||||||
|
#define SDCARDFS_XATTR_DWRITER_NAME "user.dwriter"
|
||||||
|
#define SDCARDFS_XATTR_PARTIAL_RELATIME_NAME "user.relatime"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Permissions are handled by our permission function.
|
* Permissions are handled by our permission function.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user