Re: [PATCH, RFC] mkfs: get sector size from host fs dev when mkfs'ing file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/13/15 7:27 PM, Dave Chinner wrote:
...

> So the current behaviour is to use the underlying filesystem
> sector size, but we might have a 4k fs sector on a 512 physical
> sector device, and you want to detect this, right? The logical
> sector size is exposed by the filesystem in the XFS_IOC_DIOINFO
> information. i.e:
> 
>         case XFS_IOC_DIOINFO: {
>                 struct dioattr  da;
>                 xfs_buftarg_t   *target =
>                         XFS_IS_REALTIME_INODE(ip) ?
>                         mp->m_rtdev_targp : mp->m_ddev_targp;
> 
>                 da.d_mem =  da.d_miniosz = target->bt_logical_sectorsize;
>                 da.d_maxiosz = INT_MAX & ~(da.d_miniosz - 1);
> 
>                 if (copy_to_user(arg, &da, sizeof(da)))
>                         return -EFAULT;
>                 return 0;
>         }
> 
> Isn't this exactly what XFS_IOC_DIOINFO is for?

Oh, right.  SO MANY INTERFACES.  ;)

But sure, that makes more sense, thanks for the reminder.

-Eric

_______________________________________________
xfs mailing list
xfs@xxxxxxxxxxx
http://oss.sgi.com/mailman/listinfo/xfs



[Index of Archives]     [Linux XFS Devel]     [Linux Filesystem Development]     [Filesystem Testing]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux