Lines Matching refs:buf
55 static int statfs_by_dentry(struct dentry *dentry, struct kstatfs *buf) in statfs_by_dentry() argument
62 memset(buf, 0, sizeof(*buf)); in statfs_by_dentry()
66 retval = dentry->d_sb->s_op->statfs(dentry, buf); in statfs_by_dentry()
67 if (retval == 0 && buf->f_frsize == 0) in statfs_by_dentry()
68 buf->f_frsize = buf->f_bsize; in statfs_by_dentry()
86 int vfs_statfs(const struct path *path, struct kstatfs *buf) in vfs_statfs() argument
90 error = statfs_by_dentry(path->dentry, buf); in vfs_statfs()
92 buf->f_flags = calculate_f_flags(path->mnt); in vfs_statfs()
128 struct statfs buf; in do_statfs_native() local
130 if (sizeof(buf) == sizeof(*st)) in do_statfs_native()
131 memcpy(&buf, st, sizeof(*st)); in do_statfs_native()
133 if (sizeof buf.f_blocks == 4) { in do_statfs_native()
150 buf.f_type = st->f_type; in do_statfs_native()
151 buf.f_bsize = st->f_bsize; in do_statfs_native()
152 buf.f_blocks = st->f_blocks; in do_statfs_native()
153 buf.f_bfree = st->f_bfree; in do_statfs_native()
154 buf.f_bavail = st->f_bavail; in do_statfs_native()
155 buf.f_files = st->f_files; in do_statfs_native()
156 buf.f_ffree = st->f_ffree; in do_statfs_native()
157 buf.f_fsid = st->f_fsid; in do_statfs_native()
158 buf.f_namelen = st->f_namelen; in do_statfs_native()
159 buf.f_frsize = st->f_frsize; in do_statfs_native()
160 buf.f_flags = st->f_flags; in do_statfs_native()
161 memset(buf.f_spare, 0, sizeof(buf.f_spare)); in do_statfs_native()
163 if (copy_to_user(p, &buf, sizeof(buf))) in do_statfs_native()
170 struct statfs64 buf; in do_statfs64() local
171 if (sizeof(buf) == sizeof(*st)) in do_statfs64()
172 memcpy(&buf, st, sizeof(*st)); in do_statfs64()
174 buf.f_type = st->f_type; in do_statfs64()
175 buf.f_bsize = st->f_bsize; in do_statfs64()
176 buf.f_blocks = st->f_blocks; in do_statfs64()
177 buf.f_bfree = st->f_bfree; in do_statfs64()
178 buf.f_bavail = st->f_bavail; in do_statfs64()
179 buf.f_files = st->f_files; in do_statfs64()
180 buf.f_ffree = st->f_ffree; in do_statfs64()
181 buf.f_fsid = st->f_fsid; in do_statfs64()
182 buf.f_namelen = st->f_namelen; in do_statfs64()
183 buf.f_frsize = st->f_frsize; in do_statfs64()
184 buf.f_flags = st->f_flags; in do_statfs64()
185 memset(buf.f_spare, 0, sizeof(buf.f_spare)); in do_statfs64()
187 if (copy_to_user(p, &buf, sizeof(buf))) in do_statfs64()
192 SYSCALL_DEFINE2(statfs, const char __user *, pathname, struct statfs __user *, buf) in SYSCALL_DEFINE2() argument
197 error = do_statfs_native(&st, buf); in SYSCALL_DEFINE2()
201 SYSCALL_DEFINE3(statfs64, const char __user *, pathname, size_t, sz, struct statfs64 __user *, buf) in SYSCALL_DEFINE3() argument
205 if (sz != sizeof(*buf)) in SYSCALL_DEFINE3()
209 error = do_statfs64(&st, buf); in SYSCALL_DEFINE3()
213 SYSCALL_DEFINE2(fstatfs, unsigned int, fd, struct statfs __user *, buf) in SYSCALL_DEFINE2() argument
218 error = do_statfs_native(&st, buf); in SYSCALL_DEFINE2()
222 SYSCALL_DEFINE3(fstatfs64, unsigned int, fd, size_t, sz, struct statfs64 __user *, buf) in SYSCALL_DEFINE3() argument
227 if (sz != sizeof(*buf)) in SYSCALL_DEFINE3()
232 error = do_statfs64(&st, buf); in SYSCALL_DEFINE3()
266 struct compat_statfs buf; in put_compat_statfs() local
280 memset(&buf, 0, sizeof(struct compat_statfs)); in put_compat_statfs()
281 buf.f_type = kbuf->f_type; in put_compat_statfs()
282 buf.f_bsize = kbuf->f_bsize; in put_compat_statfs()
283 buf.f_blocks = kbuf->f_blocks; in put_compat_statfs()
284 buf.f_bfree = kbuf->f_bfree; in put_compat_statfs()
285 buf.f_bavail = kbuf->f_bavail; in put_compat_statfs()
286 buf.f_files = kbuf->f_files; in put_compat_statfs()
287 buf.f_ffree = kbuf->f_ffree; in put_compat_statfs()
288 buf.f_namelen = kbuf->f_namelen; in put_compat_statfs()
289 buf.f_fsid.val[0] = kbuf->f_fsid.val[0]; in put_compat_statfs()
290 buf.f_fsid.val[1] = kbuf->f_fsid.val[1]; in put_compat_statfs()
291 buf.f_frsize = kbuf->f_frsize; in put_compat_statfs()
292 buf.f_flags = kbuf->f_flags; in put_compat_statfs()
293 if (copy_to_user(ubuf, &buf, sizeof(struct compat_statfs))) in put_compat_statfs()
302 COMPAT_SYSCALL_DEFINE2(statfs, const char __user *, pathname, struct compat_statfs __user *, buf) in COMPAT_SYSCALL_DEFINE2() argument
307 error = put_compat_statfs(buf, &tmp); in COMPAT_SYSCALL_DEFINE2()
311 COMPAT_SYSCALL_DEFINE2(fstatfs, unsigned int, fd, struct compat_statfs __user *, buf) in COMPAT_SYSCALL_DEFINE2() argument
316 error = put_compat_statfs(buf, &tmp); in COMPAT_SYSCALL_DEFINE2()
322 struct compat_statfs64 buf; in put_compat_statfs64() local
327 memset(&buf, 0, sizeof(struct compat_statfs64)); in put_compat_statfs64()
328 buf.f_type = kbuf->f_type; in put_compat_statfs64()
329 buf.f_bsize = kbuf->f_bsize; in put_compat_statfs64()
330 buf.f_blocks = kbuf->f_blocks; in put_compat_statfs64()
331 buf.f_bfree = kbuf->f_bfree; in put_compat_statfs64()
332 buf.f_bavail = kbuf->f_bavail; in put_compat_statfs64()
333 buf.f_files = kbuf->f_files; in put_compat_statfs64()
334 buf.f_ffree = kbuf->f_ffree; in put_compat_statfs64()
335 buf.f_namelen = kbuf->f_namelen; in put_compat_statfs64()
336 buf.f_fsid.val[0] = kbuf->f_fsid.val[0]; in put_compat_statfs64()
337 buf.f_fsid.val[1] = kbuf->f_fsid.val[1]; in put_compat_statfs64()
338 buf.f_frsize = kbuf->f_frsize; in put_compat_statfs64()
339 buf.f_flags = kbuf->f_flags; in put_compat_statfs64()
340 if (copy_to_user(ubuf, &buf, sizeof(struct compat_statfs64))) in put_compat_statfs64()
345 …t_sys_statfs64(const char __user * pathname, compat_size_t sz, struct compat_statfs64 __user * buf) in kcompat_sys_statfs64() argument
350 if (sz != sizeof(*buf)) in kcompat_sys_statfs64()
355 error = put_compat_statfs64(buf, &tmp); in kcompat_sys_statfs64()
359 …3(statfs64, const char __user *, pathname, compat_size_t, sz, struct compat_statfs64 __user *, buf) in COMPAT_SYSCALL_DEFINE3() argument
361 return kcompat_sys_statfs64(pathname, sz, buf); in COMPAT_SYSCALL_DEFINE3()
364 int kcompat_sys_fstatfs64(unsigned int fd, compat_size_t sz, struct compat_statfs64 __user * buf) in kcompat_sys_fstatfs64() argument
369 if (sz != sizeof(*buf)) in kcompat_sys_fstatfs64()
374 error = put_compat_statfs64(buf, &tmp); in kcompat_sys_fstatfs64()
378 …SCALL_DEFINE3(fstatfs64, unsigned int, fd, compat_size_t, sz, struct compat_statfs64 __user *, buf) in COMPAT_SYSCALL_DEFINE3() argument
380 return kcompat_sys_fstatfs64(fd, sz, buf); in COMPAT_SYSCALL_DEFINE3()