1 Star 0 Fork 12

淮南子/autofs

forked from src-openEuler/autofs 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0028-autofs-5.1.4-change-expire-type-naming-to-better-reflect-usage.patch 4.00 KB
一键复制 编辑 原始数据 按行查看 历史
gu-gu-gu 提交于 2019-12-03 10:24 . autofs: openEuler init
autofs-5.1.4 - change expire type naming to better reflect usage
From: Ian Kent <raven@themaw.net>
Expires can request different types of expire, currently normal or
immediate (and later force).
Change the naming used in the expire functions to better indicate
usage.
Signed-off-by: Ian Kent <raven@themaw.net>
---
CHANGELOG | 1 +
daemon/direct.c | 8 ++++----
daemon/indirect.c | 8 ++++----
daemon/state.c | 4 ++--
include/state.h | 2 +-
5 files changed, 12 insertions(+), 11 deletions(-)
--- autofs-5.1.4.orig/CHANGELOG
+++ autofs-5.1.4/CHANGELOG
@@ -26,6 +26,7 @@ xx/xx/2018 autofs-5.1.5
- fix NFS version mask usage.
- fix fd leak in rpc_do_create_client().
- add-man page note about extra slashes in paths.
+- change expire type naming to better reflect usage.
19/12/2017 autofs-5.1.4
- fix spec file url.
--- autofs-5.1.4.orig/daemon/direct.c
+++ autofs-5.1.4/daemon/direct.c
@@ -841,7 +841,7 @@ void *expire_proc_direct(void *arg)
struct expire_args ec;
struct autofs_point *ap;
struct mapent *me = NULL;
- unsigned int now;
+ unsigned int how;
int ioctlfd, cur_state;
int status, ret, left;
@@ -852,7 +852,7 @@ void *expire_proc_direct(void *arg)
fatal(status);
ap = ec.ap = ea->ap;
- now = ea->when;
+ how = ea->how;
ec.status = -1;
ea->signaled = 1;
@@ -946,7 +946,7 @@ void *expire_proc_direct(void *arg)
ioctlfd = me->ioctlfd;
- ret = ops->expire(ap->logopt, ioctlfd, next->path, now);
+ ret = ops->expire(ap->logopt, ioctlfd, next->path, how);
if (ret) {
left++;
pthread_setcancelstate(cur_state, NULL);
@@ -972,7 +972,7 @@ void *expire_proc_direct(void *arg)
debug(ap->logopt, "send expire to trigger %s", next->path);
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cur_state);
- ret = ops->expire(ap->logopt, ioctlfd, next->path, now);
+ ret = ops->expire(ap->logopt, ioctlfd, next->path, how);
if (ret)
left++;
pthread_setcancelstate(cur_state, NULL);
--- autofs-5.1.4.orig/daemon/indirect.c
+++ autofs-5.1.4/daemon/indirect.c
@@ -392,7 +392,7 @@ void *expire_proc_indirect(void *arg)
struct mnt_list *mnts = NULL, *next;
struct expire_args *ea;
struct expire_args ec;
- unsigned int now;
+ unsigned int how;
int offsets, submnts, count;
int retries;
int ioctlfd, cur_state;
@@ -405,7 +405,7 @@ void *expire_proc_indirect(void *arg)
fatal(status);
ap = ec.ap = ea->ap;
- now = ea->when;
+ how = ea->how;
ec.status = -1;
ea->signaled = 1;
@@ -530,7 +530,7 @@ void *expire_proc_indirect(void *arg)
debug(ap->logopt, "expire %s", next->path);
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cur_state);
- ret = ops->expire(ap->logopt, ioctlfd, next->path, now);
+ ret = ops->expire(ap->logopt, ioctlfd, next->path, how);
if (ret)
left++;
pthread_setcancelstate(cur_state, NULL);
@@ -544,7 +544,7 @@ void *expire_proc_indirect(void *arg)
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cur_state);
retries = (count_mounts(ap, ap->path, ap->dev) + 1);
while (retries--) {
- ret = ops->expire(ap->logopt, ap->ioctlfd, ap->path, now);
+ ret = ops->expire(ap->logopt, ap->ioctlfd, ap->path, how);
if (ret)
left++;
}
--- autofs-5.1.4.orig/daemon/state.c
+++ autofs-5.1.4/daemon/state.c
@@ -267,7 +267,7 @@ void expire_proc_cleanup(void *arg)
return;
}
-static enum expire expire_proc(struct autofs_point *ap, int now)
+static enum expire expire_proc(struct autofs_point *ap, int how)
{
pthread_t thid;
struct expire_args *ea;
@@ -295,7 +295,7 @@ static enum expire expire_proc(struct au
fatal(status);
ea->ap = ap;
- ea->when = now;
+ ea->how = how;
ea->status = 1;
if (ap->type == LKP_INDIRECT)
--- autofs-5.1.4.orig/include/state.h
+++ autofs-5.1.4/include/state.h
@@ -55,7 +55,7 @@ struct expire_args {
unsigned int signaled;
struct autofs_point *ap; /* autofs mount we are working on */
enum states state; /* State prune or expire */
- unsigned int when; /* Immediate expire ? */
+ unsigned int how; /* Normal, immediate expire ? */
int status; /* Return status */
};
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/writings-of-prince-huainan/autofs.git
git@gitee.com:writings-of-prince-huainan/autofs.git
writings-of-prince-huainan
autofs
autofs
master

搜索帮助