Lines Matching refs:buf

49 static int statfs_by_dentry(struct dentry *dentry, struct kstatfs *buf)  in statfs_by_dentry()  argument
56 memset(buf, 0, sizeof(*buf)); in statfs_by_dentry()
60 retval = dentry->d_sb->s_op->statfs(dentry, buf); in statfs_by_dentry()
61 if (retval == 0 && buf->f_frsize == 0) in statfs_by_dentry()
62 buf->f_frsize = buf->f_bsize; in statfs_by_dentry()
66 int vfs_statfs(struct path *path, struct kstatfs *buf) in vfs_statfs() argument
70 error = statfs_by_dentry(path->dentry, buf); in vfs_statfs()
72 buf->f_flags = calculate_f_flags(path->mnt); in vfs_statfs()
108 struct statfs buf; in do_statfs_native() local
110 if (sizeof(buf) == sizeof(*st)) in do_statfs_native()
111 memcpy(&buf, st, sizeof(*st)); in do_statfs_native()
113 if (sizeof buf.f_blocks == 4) { in do_statfs_native()
130 buf.f_type = st->f_type; in do_statfs_native()
131 buf.f_bsize = st->f_bsize; in do_statfs_native()
132 buf.f_blocks = st->f_blocks; in do_statfs_native()
133 buf.f_bfree = st->f_bfree; in do_statfs_native()
134 buf.f_bavail = st->f_bavail; in do_statfs_native()
135 buf.f_files = st->f_files; in do_statfs_native()
136 buf.f_ffree = st->f_ffree; in do_statfs_native()
137 buf.f_fsid = st->f_fsid; in do_statfs_native()
138 buf.f_namelen = st->f_namelen; in do_statfs_native()
139 buf.f_frsize = st->f_frsize; in do_statfs_native()
140 buf.f_flags = st->f_flags; in do_statfs_native()
141 memset(buf.f_spare, 0, sizeof(buf.f_spare)); in do_statfs_native()
143 if (copy_to_user(p, &buf, sizeof(buf))) in do_statfs_native()
150 struct statfs64 buf; in do_statfs64() local
151 if (sizeof(buf) == sizeof(*st)) in do_statfs64()
152 memcpy(&buf, st, sizeof(*st)); in do_statfs64()
154 buf.f_type = st->f_type; in do_statfs64()
155 buf.f_bsize = st->f_bsize; in do_statfs64()
156 buf.f_blocks = st->f_blocks; in do_statfs64()
157 buf.f_bfree = st->f_bfree; in do_statfs64()
158 buf.f_bavail = st->f_bavail; in do_statfs64()
159 buf.f_files = st->f_files; in do_statfs64()
160 buf.f_ffree = st->f_ffree; in do_statfs64()
161 buf.f_fsid = st->f_fsid; in do_statfs64()
162 buf.f_namelen = st->f_namelen; in do_statfs64()
163 buf.f_frsize = st->f_frsize; in do_statfs64()
164 buf.f_flags = st->f_flags; in do_statfs64()
165 memset(buf.f_spare, 0, sizeof(buf.f_spare)); in do_statfs64()
167 if (copy_to_user(p, &buf, sizeof(buf))) in do_statfs64()
172 SYSCALL_DEFINE2(statfs, const char __user *, pathname, struct statfs __user *, buf) in SYSCALL_DEFINE2() argument
177 error = do_statfs_native(&st, buf); in SYSCALL_DEFINE2()
181 SYSCALL_DEFINE3(statfs64, const char __user *, pathname, size_t, sz, struct statfs64 __user *, buf) in SYSCALL_DEFINE3() argument
185 if (sz != sizeof(*buf)) in SYSCALL_DEFINE3()
189 error = do_statfs64(&st, buf); in SYSCALL_DEFINE3()
193 SYSCALL_DEFINE2(fstatfs, unsigned int, fd, struct statfs __user *, buf) in SYSCALL_DEFINE2() argument
198 error = do_statfs_native(&st, buf); in SYSCALL_DEFINE2()
202 SYSCALL_DEFINE3(fstatfs64, unsigned int, fd, size_t, sz, struct statfs64 __user *, buf) in SYSCALL_DEFINE3() argument
207 if (sz != sizeof(*buf)) in SYSCALL_DEFINE3()
212 error = do_statfs64(&st, buf); in SYSCALL_DEFINE3()