stat.c (bf61c8840efe60fd8f91446860b63338fb424158) stat.c (1c8924eb106c1ac755d5d35ce9b3ff42e89e2511)
1/*
2 * linux/fs/stat.c
3 *
4 * Copyright (C) 1991, 1992 Linus Torvalds
5 */
6
7#include <linux/export.h>
8#include <linux/mm.h>

--- 433 unchanged lines hidden (view full) ---

442{
443 spin_lock(&inode->i_lock);
444 __inode_add_bytes(inode, bytes);
445 spin_unlock(&inode->i_lock);
446}
447
448EXPORT_SYMBOL(inode_add_bytes);
449
1/*
2 * linux/fs/stat.c
3 *
4 * Copyright (C) 1991, 1992 Linus Torvalds
5 */
6
7#include <linux/export.h>
8#include <linux/mm.h>

--- 433 unchanged lines hidden (view full) ---

442{
443 spin_lock(&inode->i_lock);
444 __inode_add_bytes(inode, bytes);
445 spin_unlock(&inode->i_lock);
446}
447
448EXPORT_SYMBOL(inode_add_bytes);
449
450void inode_sub_bytes(struct inode *inode, loff_t bytes)
450void __inode_sub_bytes(struct inode *inode, loff_t bytes)
451{
451{
452 spin_lock(&inode->i_lock);
453 inode->i_blocks -= bytes >> 9;
454 bytes &= 511;
455 if (inode->i_bytes < bytes) {
456 inode->i_blocks--;
457 inode->i_bytes += 512;
458 }
459 inode->i_bytes -= bytes;
452 inode->i_blocks -= bytes >> 9;
453 bytes &= 511;
454 if (inode->i_bytes < bytes) {
455 inode->i_blocks--;
456 inode->i_bytes += 512;
457 }
458 inode->i_bytes -= bytes;
459}
460
461EXPORT_SYMBOL(__inode_sub_bytes);
462
463void inode_sub_bytes(struct inode *inode, loff_t bytes)
464{
465 spin_lock(&inode->i_lock);
466 __inode_sub_bytes(inode, bytes);
460 spin_unlock(&inode->i_lock);
461}
462
463EXPORT_SYMBOL(inode_sub_bytes);
464
465loff_t inode_get_bytes(struct inode *inode)
466{
467 loff_t ret;

--- 18 unchanged lines hidden ---
467 spin_unlock(&inode->i_lock);
468}
469
470EXPORT_SYMBOL(inode_sub_bytes);
471
472loff_t inode_get_bytes(struct inode *inode)
473{
474 loff_t ret;

--- 18 unchanged lines hidden ---