Deleted Added
full compact
quot.c (32595) quot.c (41727)
1/*
2 * Copyright (C) 1991, 1994 Wolfgang Solfrank.
3 * Copyright (C) 1991, 1994 TooLs GmbH.
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

26 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
27 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
28 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
29 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 */
31
32#ifndef lint
33static const char rcsid[] =
1/*
2 * Copyright (C) 1991, 1994 Wolfgang Solfrank.
3 * Copyright (C) 1991, 1994 TooLs GmbH.
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

26 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
27 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
28 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
29 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 */
31
32#ifndef lint
33static const char rcsid[] =
34 "$Id: quot.c,v 1.7 1997/10/10 06:31:07 charnier Exp $";
34 "$Id: quot.c,v 1.8 1998/01/17 16:45:03 bde Exp $";
35#endif /* not lint */
36
37#include <sys/param.h>
38#include <sys/mount.h>
39#include <sys/time.h>
40#include <ufs/ffs/fs.h>
41#include <ufs/ufs/quota.h>
42#include <ufs/ufs/inode.h>

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

61
62/*
63 * Original BSD quot doesn't round to number of frags/blocks,
64 * doesn't account for indirection blocks and gets it totally
65 * wrong if the size is a multiple of the blocksize.
66 * The new code always counts the number of 512 byte blocks
67 * instead of the number of kilobytes and converts them to
68 * kByte when done (on request).
35#endif /* not lint */
36
37#include <sys/param.h>
38#include <sys/mount.h>
39#include <sys/time.h>
40#include <ufs/ffs/fs.h>
41#include <ufs/ufs/quota.h>
42#include <ufs/ufs/inode.h>

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

61
62/*
63 * Original BSD quot doesn't round to number of frags/blocks,
64 * doesn't account for indirection blocks and gets it totally
65 * wrong if the size is a multiple of the blocksize.
66 * The new code always counts the number of 512 byte blocks
67 * instead of the number of kilobytes and converts them to
68 * kByte when done (on request).
69 *
70 * Due to the size of modern disks, we must cast intermediate
71 * values to 64 bits to prevent potential overflows.
69 */
70#ifdef COMPAT
71#define SIZE(n) (n)
72#else
72 */
73#ifdef COMPAT
74#define SIZE(n) (n)
75#else
73#define SIZE(n) (((n) * 512 + blocksize - 1)/blocksize)
76#define SIZE(n) ((int)(((quad_t)(n) * 512 + blocksize - 1)/blocksize))
74#endif
75
76#define INOCNT(fs) ((fs)->fs_ipg)
77#define INOSZ(fs) (sizeof(struct dinode) * INOCNT(fs))
78
79static struct dinode *
80get_inode(fd,super,ino)
81 struct fs *super;

--- 499 unchanged lines hidden ---
77#endif
78
79#define INOCNT(fs) ((fs)->fs_ipg)
80#define INOSZ(fs) (sizeof(struct dinode) * INOCNT(fs))
81
82static struct dinode *
83get_inode(fd,super,ino)
84 struct fs *super;

--- 499 unchanged lines hidden ---