Lines 1243-1250
void touch_atime(struct vfsmount *mnt, struct dentry *dentry)
Link Here
|
1243 |
EXPORT_SYMBOL(touch_atime); |
1243 |
EXPORT_SYMBOL(touch_atime); |
1244 |
|
1244 |
|
1245 |
/** |
1245 |
/** |
1246 |
* file_update_time - update mtime and ctime time |
1246 |
* inode_update_time - update mtime and ctime time |
1247 |
* @file: file accessed |
1247 |
* @inode: inode accessed |
|
|
1248 |
* @ts: time when inode was accessed |
1249 |
* @sync: whether to do synchronous update |
1248 |
* |
1250 |
* |
1249 |
* Update the mtime and ctime members of an inode and mark the inode |
1251 |
* Update the mtime and ctime members of an inode and mark the inode |
1250 |
* for writeback. Note that this function is meant exclusively for |
1252 |
* for writeback. Note that this function is meant exclusively for |
Lines 1253-1263
EXPORT_SYMBOL(touch_atime);
Link Here
|
1253 |
* S_NOCTIME inode flag, e.g. for network filesystem where these |
1255 |
* S_NOCTIME inode flag, e.g. for network filesystem where these |
1254 |
* timestamps are handled by the server. |
1256 |
* timestamps are handled by the server. |
1255 |
*/ |
1257 |
*/ |
1256 |
|
1258 |
void inode_update_time(struct inode *inode, struct timespec *ts) |
1257 |
void file_update_time(struct file *file) |
|
|
1258 |
{ |
1259 |
{ |
1259 |
struct inode *inode = file->f_path.dentry->d_inode; |
|
|
1260 |
struct timespec now; |
1261 |
int sync_it = 0; |
1260 |
int sync_it = 0; |
1262 |
|
1261 |
|
1263 |
if (IS_NOCMTIME(inode)) |
1262 |
if (IS_NOCMTIME(inode)) |
Lines 1265-1286
void file_update_time(struct file *file)
Link Here
|
1265 |
if (IS_RDONLY(inode)) |
1264 |
if (IS_RDONLY(inode)) |
1266 |
return; |
1265 |
return; |
1267 |
|
1266 |
|
1268 |
now = current_fs_time(inode->i_sb); |
1267 |
if (timespec_compare(&inode->i_mtime, ts) < 0) { |
1269 |
if (!timespec_equal(&inode->i_mtime, &now)) { |
1268 |
inode->i_mtime = *ts; |
1270 |
inode->i_mtime = now; |
|
|
1271 |
sync_it = 1; |
1269 |
sync_it = 1; |
1272 |
} |
1270 |
} |
1273 |
|
1271 |
|
1274 |
if (!timespec_equal(&inode->i_ctime, &now)) { |
1272 |
if (timespec_compare(&inode->i_ctime, ts) < 0) { |
1275 |
inode->i_ctime = now; |
1273 |
inode->i_ctime = *ts; |
1276 |
sync_it = 1; |
1274 |
sync_it = 1; |
1277 |
} |
1275 |
} |
1278 |
|
1276 |
|
1279 |
if (sync_it) |
1277 |
if (sync_it) |
1280 |
mark_inode_dirty_sync(inode); |
1278 |
mark_inode_dirty_sync(inode); |
1281 |
} |
1279 |
} |
|
|
1280 |
EXPORT_SYMBOL(inode_update_time); |
1282 |
|
1281 |
|
1283 |
EXPORT_SYMBOL(file_update_time); |
1282 |
/* |
|
|
1283 |
* Update the ctime and mtime stamps after checking if they are to be updated. |
1284 |
*/ |
1285 |
void mapping_update_time(struct address_space *mapping) |
1286 |
{ |
1287 |
if (test_and_clear_bit(AS_MCTIME, &mapping->flags)) { |
1288 |
struct inode *inode = mapping->host; |
1289 |
struct timespec *ts = &mapping->mtime; |
1290 |
|
1291 |
if (S_ISBLK(inode->i_mode)) { |
1292 |
struct block_device *bdev = inode->i_bdev; |
1293 |
|
1294 |
mutex_lock(&bdev->bd_mutex); |
1295 |
list_for_each_entry(inode, &bdev->bd_inodes, i_devices) |
1296 |
inode_update_time(inode, ts); |
1297 |
mutex_unlock(&bdev->bd_mutex); |
1298 |
} else |
1299 |
inode_update_time(inode, ts); |
1300 |
} |
1301 |
} |
1284 |
|
1302 |
|
1285 |
int inode_needs_sync(struct inode *inode) |
1303 |
int inode_needs_sync(struct inode *inode) |
1286 |
{ |
1304 |
{ |
Lines 1290-1296
int inode_needs_sync(struct inode *inode)
Link Here
|
1290 |
return 1; |
1308 |
return 1; |
1291 |
return 0; |
1309 |
return 0; |
1292 |
} |
1310 |
} |
1293 |
|
|
|
1294 |
EXPORT_SYMBOL(inode_needs_sync); |
1311 |
EXPORT_SYMBOL(inode_needs_sync); |
1295 |
|
1312 |
|
1296 |
int inode_wait(void *word) |
1313 |
int inode_wait(void *word) |