@@ -73,6 +73,11 @@ struct fs_parameter {
73
73
int dirfd ;
74
74
};
75
75
76
+ struct p_log {
77
+ const char * prefix ;
78
+ struct fc_log * log ;
79
+ };
80
+
76
81
/*
77
82
* Filesystem context for holding the parameters used in the creation or
78
83
* reconfiguration of a superblock.
@@ -188,6 +193,8 @@ void logfc(struct fc_log *log, const char *prefix, char level, const char *fmt,
188
193
struct fs_context *__fc = (fc); \
189
194
logfc(__fc ? __fc->log : NULL, NULL, \
190
195
l, fmt, ## __VA_ARGS__);})
196
+ #define __plog (p , l , fmt , ...) logfc((p)->log, (p)->prefix, \
197
+ l, fmt, ## __VA_ARGS__)
191
198
/**
192
199
* infof - Store supplementary informational message
193
200
* @fc: The context in which to log the informational message
@@ -197,6 +204,7 @@ void logfc(struct fc_log *log, const char *prefix, char level, const char *fmt,
197
204
* has enabled the facility.
198
205
*/
199
206
#define infof (fc , fmt , ...) __logfc(fc, 'i', fmt, ## __VA_ARGS__)
207
+ #define info_plog (p , fmt , ...) __plog(p, 'i', fmt, ## __VA_ARGS__)
200
208
201
209
/**
202
210
* warnf - Store supplementary warning message
@@ -207,6 +215,7 @@ void logfc(struct fc_log *log, const char *prefix, char level, const char *fmt,
207
215
* enabled the facility.
208
216
*/
209
217
#define warnf (fc , fmt , ...) __logfc(fc, 'w', fmt, ## __VA_ARGS__)
218
+ #define warn_plog (p , fmt , ...) __plog(p, 'w', fmt, ## __VA_ARGS__)
210
219
211
220
/**
212
221
* errorf - Store supplementary error message
@@ -217,6 +226,7 @@ void logfc(struct fc_log *log, const char *prefix, char level, const char *fmt,
217
226
* enabled the facility.
218
227
*/
219
228
#define errorf (fc , fmt , ...) __logfc(fc, 'e', fmt, ## __VA_ARGS__)
229
+ #define error_plog (p , fmt , ...) __plog(p, 'e', fmt, ## __VA_ARGS__)
220
230
221
231
/**
222
232
* invalf - Store supplementary invalid argument error message
@@ -227,5 +237,6 @@ void logfc(struct fc_log *log, const char *prefix, char level, const char *fmt,
227
237
* enabled the facility and return -EINVAL.
228
238
*/
229
239
#define invalf (fc , fmt , ...) (errorf(fc, fmt, ## __VA_ARGS__), -EINVAL)
240
+ #define inval_plog (p , fmt , ...) (error_plog(p, fmt, ## __VA_ARGS__), -EINVAL)
230
241
231
242
#endif /* _LINUX_FS_CONTEXT_H */
0 commit comments